Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Memory Leak - can't find it

  1. #11
    Junior Member Newbie
    Join Date
    Feb 2011
    Posts
    9

    Re: Memory Leak - can't find it

    Nope, that did not help. The data itself is valid. I think there's something wrong with the way nVidia's OpenGL handles 16bit (at least I read that somewhere when searching).

    Since 16bit image display is not an issue in the first place, I guess this one is resolved.

    Thanks for all the input.

  2. #12
    Super Moderator OpenGL Guru
    Join Date
    Feb 2000
    Location
    Montreal, Canada
    Posts
    4,421

    Re: Memory Leak - can't find it

    glTexImage2D(GL_TEXTURE_2D, 0, GL_INTENSITY16, width, height, 0, GL_LUMINANCE16, GL_UNSIGNED_SHORT, Data());

    should generate GL_INVALID_VALUE or GL_INVALID_ENUM because GL_LUMINANCE16 is not in the book. You need

    glTexImage2D(GL_TEXTURE_2D, 0, GL_INTENSITY16, width, height, 0, GL_LUMINANCE, GL_UNSIGNED_SHORT, Data());
    ------------------------------
    Sig: http://glhlib.sourceforge.net
    an open source GLU replacement library. Much more modern than GLU.
    float matrix[16], inverse_matrix[16];
    glhLoadIdentityf2(matrix);
    glhTranslatef2(matrix, 0.0, 0.0, 5.0);
    glhRotateAboutXf2(matrix, angleInRadians);
    glhScalef2(matrix, 1.0, 1.0, -1.0);
    glhQuickInvertMatrixf2(matrix, inverse_matrix);
    glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
    glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

  3. #13
    Junior Member Newbie
    Join Date
    Feb 2011
    Posts
    9

    Re: Memory Leak - can't find it

    Thanks for that, with LUMINANCE it's working now for all 3 monochrome modes.
    One last question though, why does it work with MONO12? I specify it as GL_UNSIGNED_BYTE, so that'd be too little, but UNSIGNED_SHORT would be too much. As Internal format I set it to GL_INTENSITY12, so my guess is, this overrides the other value, but according to documentation the 3rd value represents how that texture should be used, and not what the data looks like?

    Edit: turns out, an error in my code used the default conversion to BGR, so the display of Mono12 actually never worked.

Posting Permissions

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