protected override void OnRenderFrame(FrameEventArgs e) { // called once per frame; render game.Tick(); GL.BindTexture(TextureTarget.Texture2D, screenID); GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba, game.screen.width, game.screen.height, 0, OpenTK.Graphics.OpenGL.PixelFormat.Bgra, PixelType.UnsignedByte, game.screen.pixels ); GL.Clear(ClearBufferMask.ColorBufferBit); GL.MatrixMode(MatrixMode.Modelview); GL.LoadIdentity(); GL.BindTexture(TextureTarget.Texture2D, screenID); GL.Begin(PrimitiveType.Quads); GL.TexCoord2(0.0f, 1.0f); GL.Vertex2(-1.0f, -1.0f); GL.TexCoord2(1.0f, 1.0f); GL.Vertex2(1.0f, -1.0f); GL.TexCoord2(1.0f, 0.0f); GL.Vertex2(1.0f, 1.0f); GL.TexCoord2(0.0f, 0.0f); GL.Vertex2(-1.0f, 1.0f); GL.End(); game.Render(); SwapBuffers(); }