NB. ogl6.ijs

drawtriangle =: verb define
glMatrixMode GL_MODELVIEW
glLoadIdentity ''
glTranslate 1 1 _1
glRotate R ,. 3 3 $ 1 0 0 0          NB. rotate xyz
glColor 1 0 0 0
glBegin GL_POLYGON
 glVertex  1 0 0 , 0 1 0 ,: _1 0 0   NB. triangle
glEnd ''
)

a_g_size =: verb define
glViewport 0 0  , glqwh ''
glMatrixMode GL_PROJECTION
glLoadIdentity ''
glOrtho 0 2 0 2 0 2
)

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

a_g_char =: verb define
R =: 360 | R + 2 * 'xyz' = {.sysdata
glpaintx''
)

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
NB. initialize form here
glaRC ''
R =: 0 0 0     NB. x y z rotations
wd 'pshow;ptop'
)
