On a related note to last post i have been drawing 'pseudo3d' objects
> in an FL_Group so far for my 3d game of life, but i really need to
> convert it to OpenGl drawing objects now that it is working.

Or do you?
If the drawing is working and provides the view you need, what will GL
provide in addition?
Drawing with GL is very different from drawing by filling a group with
coloured widgets...

> I am stuck with the idea of how my gl window can 'know' about drawing
> all my world cells?

You make some data abstraction that represents your world - maybe just
an array of little structs or something - and at drawing time (for
example, there are other options, GL is very flexible...) you interpret
that abstraction and use GL to render the appropriate scene.

You do not update the GL scene as you run your model, only the data is
changed. Once you have a "complete" set of data ready you request a
redraw() and carry on...

> I mean i cannot directly cll the gl window draw()
> function (...can i?)

I would advise against it. The effects can be "interesting". (Though
technically under some circumstances you can get away with that... But
don't...)

There are several GL drawing examples in the test folder, and Greg has a
few more on his Cheat Pages. You can refer to any and all of those for
some hints.
Note that drawing with GL is very different from drawing with fltk
"native" calls, so you'll have a wee bit of work to do there!


haha, ok good advice there thanks, i do have some opengl knowledge
so am failry comfortable taking on a transition in the drawing, the
main motivation for me doing this is managing shading or drawing of
surfaces that are supposed to be 'next to/ on top of each other etc
so will be trying to take advantage of the depth buffer in that
respect. My issue with the present drawing is that i will have to
twist up my code a bit now to make the order of the cells always draw
in correct 'layer' order to maintain 3d illusion, or at least to
enhance what i am supposed to be seeing.

at present my world is
20 x (20 x 20) planes which are drawn in psuedocode like:

for each(i) {
    for each (j) {
        for each (k) {

            draw_a_cell_at(i, j, k)
        }
    }
}

where 0 is top left of screen, so the top layers are drawn first
instead of bottom, so i need to flip all that around to get it right really
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to