78 lines
1.2 KiB
C#
78 lines
1.2 KiB
C#
using System;
|
|
using System.IO;
|
|
using System.Drawing;
|
|
using System.Drawing.Imaging;
|
|
|
|
using OpenTK.Graphics.OpenGL4;
|
|
using OpenTK;
|
|
|
|
using OpenTK.Audio.OpenAL;
|
|
using OpenTK.Audio;
|
|
|
|
using ImageSharp;
|
|
|
|
using org.niclasundharald.engine.graphics;
|
|
|
|
namespace nhengine
|
|
{
|
|
public class BootStrap
|
|
{
|
|
public static BootStrap _instance;
|
|
public static BootStrap instance()
|
|
{
|
|
return _instance;
|
|
}
|
|
|
|
OpenGLWindow glWindow;
|
|
|
|
SquaredMap map;
|
|
|
|
public static void Main(string[] args){
|
|
_instance = new BootStrap();
|
|
|
|
_instance.run();
|
|
}
|
|
|
|
public BootStrap()
|
|
{
|
|
bootGraphics();
|
|
bootMap();
|
|
}
|
|
|
|
public SquaredMap SquaredMap {
|
|
get { return this.map; }
|
|
}
|
|
|
|
public void bootGraphics(){
|
|
glWindow = new OpenGLWindow();
|
|
glWindow.MakeCurrent();
|
|
|
|
GlobalDefaults.instance();
|
|
|
|
}
|
|
|
|
public void bootAudio(){
|
|
AL.Enable(ALCapability.Invalid);
|
|
}
|
|
|
|
public void bootMap(){
|
|
ImageSharp.Image i = ImageSharp.Image.Load( new FileStream("M3-wip.png",FileMode.Open));
|
|
i.Flip(ImageSharp.Processing.FlipType.Vertical);
|
|
map = new SquaredMap(i);
|
|
|
|
glWindow.Scene.RootObject.addChild( map );
|
|
|
|
}
|
|
|
|
|
|
public void run(){
|
|
glWindow.MakeCurrent();
|
|
glWindow.Run(30,30);
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|