Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 6 of 6

Thread: Problem with glBindTexture

  1. #1
    Junior Member Newbie
    Join Date
    Jun 2003
    Posts
    5

    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!

  2. #2
    Junior Member Newbie
    Join Date
    Jun 2003
    Posts
    5

    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.

  3. #3
    Junior Member Regular Contributor
    Join Date
    Apr 2003
    Location
    Toulouse, France
    Posts
    133

    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
    }

  4. #4
    Junior Member Newbie
    Join Date
    Jun 2003
    Posts
    5

    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!

  5. #5
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    3,115

    Re: Problem with glBindTexture

    Check the rendering context. It must be valid at the point you start calling OpenGL functions.

  6. #6
    Junior Member Newbie
    Join Date
    Jun 2003
    Posts
    5

    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
  •