Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected override void OnRenderFrame(FrameEventArgs e)
- {
- base.OnRenderFrame(e);
- GL.MatrixMode(All.Projection);
- GL.LoadIdentity();
- GL.Ortho(-1.0f, 1.0f, -1.5f, 1.5f, -1.0f, 1.0f);
- GL.MatrixMode(All.Modelview);
- GL.Rotate(3.0f, 0.0f, 0.0f, 1.0f);
- GL.ClearColor(0.5f, 0.5f, 0.5f, 1.0f);
- GL.Clear((uint)All.ColorBufferBit);
- GL.VertexPointer(2, All.Float, 0, square_vertices);
- GL.EnableClientState(All.VertexArray);
- GL.ColorPointer(4, All.UnsignedByte, 0, square_colors);
- GL.EnableClientState(All.ColorArray);
- GL.DrawArrays(All.TriangleStrip, 0, 4);
- SwapBuffers();
- }
- float[] square_vertices = {
- -0.5f, -0.5f,
- 0.5f, -0.5f,
- -0.5f, 0.5f,
- 0.5f, 0.5f,
- };
- byte[] square_colors = {
- 255, 255, 0, 255,
- 0, 255, 255, 255,
- 0, 0, 0, 0,
- 255, 0, 255, 255,
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement