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 am intrigued by this idea although i do not follow perfectly what
you mean, i mean i could populate a struct with vertice information i get
that part, i could create an array or these structs, or multidimensional
array thereof, but i still cannot see how once all the structs are updated
and its 'drawing time' how i can pass the vertice info to the opengl, unless
i just use include gl/gl.h and useopengl calls directly in my main code rather
than within the Fl_Gl_Window::draw() method?
I have thought about a getter/setter function that modifies private vertice
member variables as an idea that occured to me...?
maybe something like:
class GLwin : public Fl_Gl_Window
{
void draw();
public:
void SetRotation(float a,float x,float y,float z);
void SetCubeVerts(float, x, float, y, float, w, float h); // assuming can
extrapolate with these
// arguments for
fixed style cube
GLwin(int X,int Y,int W,int H,const char*L) : Fl_Gl_Window(X,Y,W,H,L){
}
private:
float x, y;
float x2, y2;
float x3, y3;
float x4, y4;
float xpos;
float ypos;
float zpos;
float ang;
};
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk