Guest User

Untitled

a guest
Jun 18th, 2018
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. render
  2.     | gl t k |
  3.     self checkSession.
  4.  
  5.     gl := display gl.
  6.     display clear: Color white.
  7.  
  8.     gl color3f_red: 0 green:  0 blue: 0.
  9.     gl pushMatrix.
  10.     self testDraw.
  11.     gl popMatrix.
  12.  
  13.    
  14.     t := Time millisecondClockValue.
  15.     frameStats add: t.
  16.    
  17.     [ t - frameStats first > 5000 ] whileTrue: [ frameStats removeFirst ].
  18.  
  19.  
  20. testDraw
  21.  
  22.     self
  23.         renderQuad: 50@50 p1: 0@100 p2: 100@100;
  24.         renderQuad: 50@50 p1: 100@50 p2: 100@100.
  25.  
  26.  
  27. renderQuad: p0 p1: p1 p2: p2
  28.  
  29.     display gl
  30.         color3d_red: 0.5 green: 0.5 blue: 0.5;
  31.         begin: GL_TRIANGLES;
  32.             texCoord2i_s: 0 t: 0;
  33.             vertex2f_x: p0 x y: p0 y;
  34.             texCoord2f_s: 0.5 t: 0;
  35.             vertex2f_x: p1 x y: p1 y;
  36.             texCoord2i_s: 1 t: 1;
  37.             vertex2f_x: p2 x y: p2 y;
  38.         end
Add Comment
Please, Sign In to add comment