Jon
Trying to understand what your advice implies, I found the "init-clip" word.
After a few random tests the following code seems to work !
M: testwin draw-gadget* ( gadget -- )
[ dup ] [ loc>> ] [ dim>> ] tri gl-viewport
flip-rect gl-set-clip
GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT bitor glClear
GL_PROJECTION glMatrixMode glLoadIdentity
-400.0 400.0 -400.0 400.0 0.0 4000.0 glOrtho
100 100 100 0 0 0 100 0 0 gluLookAt
GL_MODELVIEW glMatrixMode
glLoadIdentity
color>> first3 glColor3f
GL_TRIANGLES [
0 0 0 glVertex3f
400 0 0 glVertex3f
0 400 0 glVertex3f
] do-state ;
I will try to use this trick in 4dstroll.
I would lie if I say I understood the problem. But thanks a lot for the clue !
Jeff
Re: multiple opengl gadgets in a single window
Trying your example, both gadgets are rendered in the same window if I comment
parts of draw-gadget* like the following. Hopefully this helps to find your
issue.
M: testwin draw-gadget* ( gadget -- )
! GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT bitor glClear
! GL_PROJECTION glMatrixMode glLoadIdentity
! -400.0 400.0 -400.0 400.0 0.0 4000.0 glOrtho
! 100 100 100 0 0 0 100 0 0 gluLookAt
! GL_MODELVIEW glMatrixMode
! glLoadIdentity
color>> first3 glColor3f
GL_TRIANGLES [
0 0 0 glVertex3f
400 0 0 glVertex3f
0 400 0 glVertex3f
] do-state ;
Jon
------------------------------------------------------------------------------
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works.
Faster operations. Version large binaries. Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk