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 4 of 4

Thread: GL_ARB_texture_rectangle causing GL_INVALID_ENUM?

  1. #1
    Member Regular Contributor
    Join Date
    Apr 2007
    Location
    Fairfax, VA
    Posts
    252

    GL_ARB_texture_rectangle causing GL_INVALID_ENUM?

    I'm trying to write a *very* simply GLUT program for OSX which just shows an image in a window. (It does a bit more than that, but that's the essentials.)

    Naturally I'd rather not constraint the image to power-of-two size, or resample it myself, so I'm trying to use GL_ARB_texture_rectangle as my target.

    The code:

    glBindTexture reports error GL_INVALID_ENUM.
    Clearly the extension is supported, so what's the problem? I did call glewInit() previously.....

    This is on OSX using XCode, incidentally.

    Unrelated question----is GLUT on OSX known to be broken? Because my windows keep having garbage from elsewhere on the screen showing up in them.

  2. #2
    Administrator Contributor
    Join Date
    Jan 2002
    Location
    Mt. View, CA
    Posts
    85

    Re: GL_ARB_texture_rectangle causing GL_INVALID_ENUM?

    so I'm trying to use GL_ARB_texture_rectangle as my target.
    "GL_ARB_texture_rectangle" is a preprocessor token that's #defined to indicate the presence of the corresponding extension interface at compile time. It is not a valid parameter to BindTexture; the target you want to use is "GL_TEXTURE_RECTANGLE_ARB".
    Jon Leech
    Khronos API Registrar
    ARB Ecosystem TSG Chair
    GL/EGL/GLES Spec Editor
    ...and suchlike

  3. #3
    Member Regular Contributor
    Join Date
    Apr 2007
    Location
    Fairfax, VA
    Posts
    252

    Re: GL_ARB_texture_rectangle causing GL_INVALID_ENUM?

    Gah. You know, I was suspicious of the lowercase letters.

    There's still the matter of my GLUT window being contaminated by random garbage, although I can see the majority of the image behind it well enough. I know it's not a texture error, because the same garbage shows up on top of the color gradient when I disable textures.

    More importantly, glTexSubImage2D is reporting GL_INVALID_VALUE on every call *after* the first when used as such.....

    Code :
    //(setupTextures function which is called every time a certain event happens)
     
    if (firsttime)
    {
    glTexImage2D(texTarget, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, 0);
    firsttime = false;
    }
     
    glTexSubImage2D(texTarget,0,0,0,width,height,GL_RGB,GL_UNSIGNED_BYTE,texim);

  4. #4
    Junior Member Regular Contributor
    Join Date
    Oct 2004
    Posts
    153

    Re: GL_ARB_texture_rectangle causing GL_INVALID_ENUM?

    no glut is not broken on osx. try to run some other demo programs to verify the problem is with glut.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •