On 30-May-07, at 1:59 AM, Jeff Ervin wrote:

> Some opengl functions are normally only called once or only when the
> window is resized. However, in factor opengl functions only seem to  
> work
> inside draw-gadget* so, for instance, commands to set the background
> color and the projection matrix are executed every time a new frame is
> drawn. Is it possible to call these functions only once from somewhere
> outside draw-gadget*?

Since draw-gadget* renders to a part of an existing context, normally  
it should not take over the entire GL context and change the  
projection matrix, etc. This way the gadget will behave well when in  
a layout with other gadgets.

If you display your gadget in its own top level window, you can do  
anything to the GL state. The graft* and ungraft* generic words will  
be useful to implement here. Also take a look at libs/canvas, you can  
either use it directly, or just use its find-gl-context word to  
configure the GL context in your graft* method.

Slava


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to