public PreviewWindow(string modelPath)
            : base(1920, 1080, new OpenTK.Graphics.GraphicsMode(32, 24, 0, 8), "Model preview", GameWindowFlags.Default, DisplayDevice.Default, 3, 0, OpenTK.Graphics.GraphicsContextFlags.Default)
        {
            dragX = 0;
            dragY = 0;
            dragZ = 0;
            angle = 0.0f;

            Keyboard.KeyDown += Keyboard_KeyDown;

            ActiveCamera = new OldCamera(Width, Height);

            filename = modelPath;

            if (filename.EndsWith(".m2"))
            {
                Exit();
                //M2Loader.LoadM2(filename, cache);
                isWMO = false;
            }
            else if (filename.EndsWith(".wmo"))
            {
                WMOLoader.LoadWMO(filename, cache);
                isWMO = true;
            }
        }
Example #2
0
 protected override void OnResize(EventArgs e)
 {
     GL.Viewport(0, 0, Width, Height);
     ActiveCamera     = new OldCamera(Width, Height);
     ActiveCamera.Pos = new Vector3(dragX, dragY, dragZ);
     ActiveCamera.setupGLRenderMatrix();
 }