glGetTexLevelParameteriv in ilutGLSubTex

  • Nobody/Anonymous

    The usage of glGetTexLevelParameteriv stalls the OpenGL pipeline.
    Can I suggest to execute this piece of code in ilutGLSubTex only in the debug builds?

    ILboolean ILAPIENTRY ilutGLSubTex(GLuint TexID, ILuint XOff, ILuint YOff)
        ILimage    *Image;
    #ifdef IL_DEBUG
        ILint Width, Height;
        glBindTexture(GL_TEXTURE_2D, TexID);

    #ifdef IL_DEBUG
        glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH,  (GLint*)&Width);
        glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, (GLint*)&Height);

        if (Image->Width + XOff > (ILuint)Width || Image->Height + YOff > (ILuint)Height) {
            return IL_FALSE;


    • Anonymous

      Anonymous - 2006-12-29

      I think it's better leave the tests.
      XOff and YOff are user provided values, they may be wrong values.


Log in to post a comment.