NB. ogl8.ijs

a_run=: 3 : 0
wd :: ] 'psel a;pclose'
wd A
glaRC ''
R =: 0 0 0
glaFont 'arial 30'            NB. font for text
glaUseFontBitmaps 0 32 26 32  NB. create display lists for font
wd 'pshow;ptop'
)

drawtext =: verb define
glMatrixMode GL_MODELVIEW
glLoadIdentity ''
glColor 1 1 1 0               NB. white
glRasterPos 0 0.1 0           NB. start position
glCallLists 5 ": R            NB. draw text of x y z values
)

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

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 ''
drawtext''                    NB. draw text
glaSwapBuffers ''
)

drawtriangle =: verb define
glMatrixMode GL_MODELVIEW
glLoadIdentity ''
glTranslate 1 1 _1
glRotate R ,. 3 3 $ 1 0 0 0
glColor 1 0 0 0
glBegin GL_POLYGON
 glVertex  1 0 0 , 0 1 0 ,: _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;
)
