Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo


glGetTexLevelParameteriv in ilutGLSubTex

  • 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;


    • Dario Meloni
      Dario Meloni

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