On Thursday 01 March 2007 02:40, you wrote:

> Or you can create a quadric the first time draw-gadget* is called, then

Ah yes. I remember using this technique for lindenmayer (now apps/lsys). The 
problem was that I wanted to use opengl display lists with slate. A slate 
looks like:

        TUPLE: slate action dim ;

And it's draw-gadget* method is:

        M: slate draw-gadget* ( slate -- )
        origin get swap slate-action with-translation ;

Basically what's happening is the action slot (which is a quot) is called.

I found that to make a display list work, I can't just make the list from any 
old place in factor. The list must be generated by the slate gadget itself. 
So I have to do something like this:

        [
          dlist> GL_COMPILE glNewList
          <<<opengl commands>>>
          glEndList
        ]
        slate>
        set-slate-action

Then "redraw" the slate, for the purpose of calling the above code to make the 
display list:

        slate> relayout-1

Finally, I can use the display list:

        [ opengl commands... dlist> glCallList ]
        slate>
        set-slate-action

This (and the similar solutions for quadrics) are kludgy. There should be a 
better way to explictly initialize contexts in the case that you are setting 
one up for an application or demo. Idioms and styles from general opengl 
programming should carry over to opengl programming in Factor when possible.

Ed

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to