require 'gl3'

A=: noun define
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=: verb define
wd A
glaRC''
R=: 20 30 0
wd 'pshow;ptop'
)

a_g_size=:verb define
glMatrixMode GL_PROJECTION
glLoadIdentity''
glOrtho 0 400 0 400 _1 1
)

a_g_paint =: verb define
glPixelStore GL_UNPACK_ALIGNMENT,1
glClearColor 1 1 1 1
glClear GL_COLOR_BUFFER_BIT
glColor 0 0 0 1
glRasterPos 20 20 0
glBitmap 8 8 0 0 0 0 ;2#".'2b',32$'01'
glRasterPos 80 80 0
glBitmap 8 8 0 0 0 0 ;_1 _1
glRasterPos 180 180 0
glBitmap 8 8 2.5 2.5 2.5 2.5;_1 _1

glRasterPos 20 150 0
glPixelZoom 1 1
glDrawPixels (20 20,GL_BLUE,GL_INT); 400 $ 2147482496

glPixelZoom 2 2
glRasterPos 0 200 0
glCopyPixels 0 0 100 100,GL_COLOR

glPixelZoom 1 1
d=.glReadPixels 0 0 100 100,GL_RGBA,GL_INT
glRasterPos 200 0 0
glDrawPixels (100 100,GL_RGBA,GL_INT);d

glaSwapBuffers ''
)

a_run''
