[osg-users] Texturing w/ osg::Image

Jean-Sébastien Guay jean-sebastien.guay at polymtl.ca
Tue Oct 23 18:01:51 PDT 2007


Hello Shawn,

Not sure this is your problem, but just something I spotted:

> *** in initialize function ***
[...]
>   glGenTextures(1, &texture[0]);
>   glBindTexture(GL_TEXTURE_RECTANGLE, texture[0]);
[...]
>
> *** in draw function ***
[...]
>   glEnable(GL_TEXTURE_2D); // Enable Texture Mapping ( NEW )
[...]
>   glBindTexture(GL_TEXTURE_2D, texture[0]);

Shouldn't you use the same texture mode in the draw function as you  
used in the initialize function? (i.e. GL_TEXTURE_RECTANGLE)

It might be a good idea to make yourself a wrapper class which can  
switch between GL_TEXTURE_2D and GL_TEXTURE_RECTANGLE, or at least  
make a global variable like this:

GLint textureMode = GL_TEXTURE_RECTANGLE; // or GL_TEXTURE_2D

and then use that everywhere...

Hope this at least helps get you closer to your goal. Good luck,

J-S
-- 
______________________________________________________
Jean-Sebastien Guay     jean-sebastien.guay at polymtl.ca
                         http://whitestar02.webhop.org/

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.





More information about the osg-users mailing list