NB. ogl5.ijs

a_g_size =: verb define
glViewport 0 0  , glqwh ''
glMatrixMode GL_PROJECTION
glLoadIdentity ''
glOrtho 0 2 0 2 0 2   NB. view is a box, xyz coords of 0 to 2
)

a_g_paint =: verb define
glClearColor 0 0 1 0
glClear GL_COLOR_BUFFER_BIT
drawtriangle ''
glaSwapBuffers ''
)

drawtriangle =: verb define
glMatrixMode GL_MODELVIEW
glLoadIdentity ''
glTranslate 1 1 _1            NB. shift triangle so it is in view
glRotate (0{R) , 1 0 0        NB. rotate x axes
glRotate (1{R) , 0 1 0        NB. rotate y axes
glRotate (2{R) , 0 0 1        NB. rotate z axes
glColor 1 0 0 0
glBegin GL_POLYGON
 glVertex  1 0 0
 glVertex  0 1 0
 glVertex _1 0 0
glEnd ''
)

A=: 0 : 0
pc a closeok;
xywh 0 0 100 100;cc g isigraph ws_clipchildren ws_clipsiblings rightmove bottommove;
pas 0 0;
rem form end;
)

a_run=: 3 : 0
wd :: ] 'psel a;pclose'
wd A
glaRC ''
R =: 0 0 0     NB. xyz rotations
wd 'pshow;ptop'
)
