You are right...
I guess it can't be in the constructor because OpenGL is not yet necessary 
started up at constructor time...
Or is there an other reason?

for your other comments, I ofcourse agree on it...
But this was just a dummy example, just to check my texture problem...
My project is of course better code than this ;)

Thanks again,

Loic,


> Loic wrote:
> > Hi All,
> >
> > I setup a very small test program, with a spinning cube...
> > but it is absolutely not textured as expected...
>
>       Pretty sure the problem is your opengl init stuff needs
>       to be moved from the ctor to an if ( !valid() ) { .. } test
>       within the fltk draw function, eg:
>
> ----snip
> void draw() {
>     if ( !valid() ) {
>         valid(1);
>         // YOUR OPENGL INIT STUFF GOES HERE
>     }
>     glEnable(GL_TEXTURE_2D);
>     glShadeModel(GL_SMOOTH);
>     [..]
> ----snip
>
>       Some other observations:
>
>               > #include/#defines missing from your example prevent it from 
> compiling
>               > There's glPushMatrix() calls without pops; gl stack will 
> overflow
>               > Suggest using Fl::add_timeout(), etc. to do the rotation 
> animation

_______________________________________________
fltk-opengl mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-opengl

Reply via email to