Re: [osg-users] Can not create OpenGL texture in OSG

2009-04-16 Thread Ulrich Hertlein

The reason for this is that you don't have a valid OpenGL context.

But apart from that is there a reason why you're trying to create the texture 
yourself?
Instead of using, say, OSG for that?

/ulrich

On 16/4/09 6:58 AM, su hu wrote:

After glGenTextures, I use glGetError to get the error. The result is :
GL_INVALID_OPERATION.
...
2009/4/16 su hu ttts...@gmail.com mailto:ttts...@gmail.com

Hi all,

When I tried to create a texture by glGenTextures in OSG, I met a
problem.  glGenTextures can not create a texture object. Zero is
returned and no texture is created. Source codes are as follow:
...
else if(LoadTexture)
{
 GLuintTexID = 0;
 glGenTextures(1, TexID );
 
}

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Can not create OpenGL texture in OSG

2009-04-16 Thread su hu
Thank you, ulrich.

Now I load texture files in camera callback and solve the problem.

I use ms3d models and render them by OpenGL.  So I have to load model and
texture files by myself.

Thanks for your help.

Su Hu




2009/4/16 Ulrich Hertlein u.hertl...@sandbox.de

 The reason for this is that you don't have a valid OpenGL context.

 But apart from that is there a reason why you're trying to create the
 texture yourself?
 Instead of using, say, OSG for that?

 /ulrich

 On 16/4/09 6:58 AM, su hu wrote:

 After glGenTextures, I use glGetError to get the error. The result is :
 GL_INVALID_OPERATION.
 ...
 2009/4/16 su hu ttts...@gmail.com mailto:ttts...@gmail.com

Hi all,

When I tried to create a texture by glGenTextures in OSG, I met a
problem.  glGenTextures can not create a texture object. Zero is
returned and no texture is created. Source codes are as follow:
 ...
else if(LoadTexture)
{
 GLuintTexID = 0;
 glGenTextures(1, TexID );
 
}

 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Can not create OpenGL texture in OSG

2009-04-15 Thread su hu
Hi all,

When I tried to create a texture by glGenTextures in OSG, I met a problem.
glGenTextures can not create a texture object. Zero is returned and no
texture is created. Source codes are as follow:

while(!Viewer.done())
{
  ...
  if(Render)
  {
 
  Viewer.frame();
   }
   else if(LoadTexture)
   {
GLuintTexID = 0;
glGenTextures(1, TexID );

   }

   
}

Version of my osg is 2.8 for vs2005. OS is Win XP professional.  Graphics
card is ATI X1600.

Thanks for your help!

Su Hu
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Can not create OpenGL texture in OSG

2009-04-15 Thread su hu
After glGenTextures, I use glGetError to get the error. The result is :
GL_INVALID_OPERATION.

OpenGL manual (
http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/gentextures.html)gives
the reason as:

*GL_INVALID_OPERATION* is generated if *glGenTextures* is
  executed between the execution of *glBegin* and the
  corresponding execution of *glEnd*.


But I dont know how to do. Thanks for your help.


Su Hu

2009/4/16 su hu ttts...@gmail.com

 Hi all,

 When I tried to create a texture by glGenTextures in OSG, I met a problem.
 glGenTextures can not create a texture object. Zero is returned and no
 texture is created. Source codes are as follow:

 while(!Viewer.done())
 {
   ...
   if(Render)
   {
  
   Viewer.frame();
}
else if(LoadTexture)
{
 GLuintTexID = 0;
 glGenTextures(1, TexID );
 
}


 }

 Version of my osg is 2.8 for vs2005. OS is Win XP professional.  Graphics
 card is ATI X1600.

 Thanks for your help!

 Su Hu


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org