Exemple #1
0
        public TerrainWindow(string modelPath, BackgroundWorker renderWorker)
            : base(1920, 1080, new OpenTK.Graphics.GraphicsMode(32, 24, 0, 8), "Terrain test", GameWindowFlags.Default, DisplayDevice.Default, 3, 3, OpenTK.Graphics.GraphicsContextFlags.Debug)
        {
            if (renderWorker == null)
            {
                renderWorker = new BackgroundWorker();
                renderWorker.WorkerReportsProgress = true;
            }

            worker = renderWorker;

            dragX = 0;
            dragY = 0;
            dragZ = 0;
            angle = 0.0f;

            Keyboard.KeyDown += Keyboard_KeyDown;

            ActiveCamera = new OldCamera(Width, Height);

            terrainShader = ShaderLoader.LoadShader("terrain");
            modelShader   = ShaderLoader.LoadShader("model");

            Console.WriteLine(modelPath);
            string[] adt = modelPath.Split('_');

            Console.WriteLine("MAP {0}, X {1}, Y {2}", adt[0], adt[1], adt[2]);
            //LoadADT(adt[0], adt[1], adt[2]);
            LoadMap(adt[0], int.Parse(adt[1]), int.Parse(adt[2]), 1);
        }
Exemple #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();
 }