I may have a simpler solution than having multiple
paint verbs as I requested before (see below). Perhaps an
adequate alternative would be to have dyadic gsinit and
gsfini for which the LHA controls the alloc and
draw/draw_keep selection. I have place models of these
proposed verbs far below.
On Tue, 2 May 2006, Brian Schott wrote:
+ ... I understand that Chris is going to rework
+ jzopenglutil to accommodate some additional "housekeeping"
+ and I guess I am saying that it would be best for me if that
+ revision also contemplated the need for reintroducing
+ genlist and LISTS as well as multiple paint verbs, not just
+ the one defined by GS_PAINT. The discussion thread focused
+ only on paints for resizing being different from paints
+ resulting from transforming the objects, but in a simulation
+ there are the startup paints and the simultaneous repaints
+ of multiple dynamic objects, also.
+
(B=)
gsinit_jzopenglutil_=: 3 : 0
1 gsinit y
:
GSWH=: glqwh''
if. x do. alloc__ogl GSWH end.
glEnable GL_DEPTH_TEST
gsclearcolor GS_CLEARCOLOR
glClear GL_COLOR_BUFFER_BIT + GL_DEPTH_BUFFER_BIT
gscolor GS_COLOR
glViewport 0 0,GSWH
glMatrixMode GL_PROJECTION
glLoadIdentity''
gluPerspective (%/GSWH) 1 } GS_PERSPECTIVE
glMatrixMode GL_MODELVIEW
glLoadIdentity''
gluLookAt GS_VIEWXYZ,0 0 0,GS_VIEWUP
glTranslate GS_TRNXYZ
glRotate GS_ROTNDX { GS_ROTXYZ ,. GS_ID3
if. GS_LIGHT e. y do.
id=. GL_LIGHT0
glaLight id, GL_AMBIENT, gscolor4 GS_AMBIENT
glaLight id, GL_DIFFUSE, gscolor4 GS_DIFFUSE
glaLight id, GL_SPECULAR, gscolor4 GS_SPECULAR
glEnable GL_LIGHTING
glEnable id
if. GS_COLORMATERIAL do.
glEnable GL_COLOR_MATERIAL
glColorMaterial GL_FRONT_AND_BACK,GL_AMBIENT_AND_DIFFUSE
glaMaterial GL_FRONT_AND_BACK,GL_SPECULAR, alpha4 GS_MATSPECULAR
glaMaterial GL_FRONT_AND_BACK,GL_SHININESS, alpha4 GS_SHININESS
end.
if. #GS_POSITION do.
glaLight id,GL_POSITION, alpha4 GS_POSITION
end.
end.
if. GS_BLEND e. y do.
glEnable GL_BLEND
glBlendFunc GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA
end.
)
gsfini_jzopenglutil_=: 3 : 0
1 gsfini y
:
if. x
do.
draw__ogl''
else.
draw_keep__ogl''
end.
)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm