Пример #1
0
 private void tmrPaint_Tick(object sender, EventArgs e)
 {
     UpdateLogic();
     // clean opengl to draw
     Gl.glClear(Gl.GL_COLOR_BUFFER_BIT | Gl.GL_DEPTH_BUFFER_BIT);
     //draws the entire scene
     control.DrawScene();
     //change buffers
     Winapi.SwapBuffers(hdc);
     //tell opengl to drop any operation he is doing and to prepare for a new frame
     Gl.glFlush();
 }
Пример #2
0
        private void tmrPaint_Tick(object sender, EventArgs e)
        {
            UpdateLogic();

            // clean opengl to draw
            Gl.glClear(Gl.GL_COLOR_BUFFER_BIT | Gl.GL_DEPTH_BUFFER_BIT);
            //draws the entire scene
            lightPosition[0] = x;
            lightPosition[1] = y;
            lightPosition[2] = z;
            Lighting.AmbientLightPosition = lightPosition;
            Lighting.SetupLighting();
            control.DrawScene();
            //change buffers
            Winapi.SwapBuffers(hdc);
            //tell opengl to drop any operation he is doing and to prepare for a new frame
            Gl.glFlush();
        }