-
Problem with glBindTexture
I'm having a really strange problem with glBindTexture: when I try to bind a texture to load the actual data onto it, glBindTexture(GL_TEXTURE_2D, textureID) gives error 0x0500 (INVALID_ENUM) just like GL_TEXTURE_2D isn't a valid constant. The strangest thing is that if I call glBindTexture() two times (one after another) the second time the function doesn't give any error but the texture isn't displayed anyway. The texture data is loaded correctly because glDrawPixels draws it correctly. Very similar code by NeHe works fine. My system is: Win XP, Visual C++ 6.0 and a GeForceFX 5800.
Please Help!
-
Re: Problem with glBindTexture
Just for more info: i'm using MFC and when i call glBindTexture the rendering context is active. Thanks again for help.
-
Junior Member
Regular Contributor
Re: Problem with glBindTexture
do you call glGenTextures ?
if so, test gl error after genrate the texture name:
if ((error=glGetError()) != GL_NO_ERROR)
{
print the string returned by glu
}
-
Re: Problem with glBindTexture
I call glGenTextures(1, texID), where texID is a GLint pointer. It also gives INVALID_ENUM error which has no sense as in the OpenGL manual it is not a contemplated error for glGenTextures... i'm going crazy with this!
-
Senior Member
OpenGL Guru
Re: Problem with glBindTexture
Check the rendering context. It must be valid at the point you start calling OpenGL functions.
-
Re: Problem with glBindTexture
Thanks to all. Problem resolved. Just have to set the texture filters for the textures I loaded.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules