Advertisement
Guest User

Untitled

a guest
Feb 13th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. protected override void OnRenderFrame(FrameEventArgs e)
  2. {
  3. base.OnRenderFrame(e);
  4.  
  5. GL.MatrixMode(All.Projection);
  6. GL.LoadIdentity();
  7. GL.Ortho(-1.0f, 1.0f, -1.5f, 1.5f, -1.0f, 1.0f);
  8. GL.MatrixMode(All.Modelview);
  9. GL.Rotate(3.0f, 0.0f, 0.0f, 1.0f);
  10.  
  11. GL.ClearColor(0.5f, 0.5f, 0.5f, 1.0f);
  12. GL.Clear((uint)All.ColorBufferBit);
  13.  
  14. GL.VertexPointer(2, All.Float, 0, square_vertices);
  15. GL.EnableClientState(All.VertexArray);
  16. GL.ColorPointer(4, All.UnsignedByte, 0, square_colors);
  17. GL.EnableClientState(All.ColorArray);
  18.  
  19. GL.DrawArrays(All.TriangleStrip, 0, 4);
  20.  
  21. SwapBuffers();
  22. }
  23.  
  24. float[] square_vertices = {
  25. -0.5f, -0.5f,
  26. 0.5f, -0.5f,
  27. -0.5f, 0.5f,
  28. 0.5f, 0.5f,
  29. };
  30.  
  31. byte[] square_colors = {
  32. 255, 255, 0, 255,
  33. 0, 255, 255, 255,
  34. 0, 0, 0, 0,
  35. 255, 0, 255, 255,
  36. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement