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: Texture Problem

  1. #1
    Junior Member Newbie
    Join Date
    May 2011
    Posts
    26

    Texture Problem

    Most users are not having problems with my application, but a good number of them still are. Here is what the problem looks like:

    Where the black boxes are, the font should be. I am using OpenGL wrapped in SDL. I am using SDL to call the texture, but I have modified my code so that the texture is hard-coded and there is no SDL_Surface to OpenGL texture conversion. There is still no dice. Suggestions? Thank you!

  2. #2
    Super Moderator OpenGL Guru
    Join Date
    Feb 2000
    Location
    Montreal, Canada
    Posts
    4,264
    glGetError()
    ------------------------------
    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. #3
    Junior Member Newbie
    Join Date
    May 2011
    Posts
    26
    Thank you for your response. Here is what I get from that: OpenGL Error: invalid enumerant I decided to place the code that prints an error after each "glEnable();" line. This happens after "glEnable(GL_SMOOTH);" is called. When I comment that out, I get a lot of underflow errors when I use glGetError();. What baffles me is why it is happening at that line and why the text displays properly for half the people who tested, but not the other half (rough estimates... I would say it works for more than just half). Thank you!

  4. #4
    Advanced Member Frequent Contributor
    Join Date
    Dec 2007
    Location
    Hungary
    Posts
    985
    First of all, GL_SMOOTH is not a valid parameter to glEnable. I'm not sure what you wanted to do, maybe wanted to use GL_POINT_SMOOTH, GL_LINE_SMOOTH or GL_POLYGON_SMOOTH, but what's for sure is that GL_SMOOTH is only a valid parameter to glShadeModel.
    Disclaimer: This is my personal profile. Whatever I write here is my personal opinion and none of my statements or speculations are anyhow related to my employer and as such should not be treated as accurate or valid and in no case should those be considered to represent the opinions of my employer.
    Technical Blog: http://www.rastergrid.com/blog/

  5. #5
    Junior Member Newbie
    Join Date
    May 2011
    Posts
    26
    With that changed to one or all of the above, I get multiple occurrences of "OpenGL Error: stack underflow" instead of a single "OpenGL Error: invalid enumerant" error. It looks like I will have to do a lot of back-tracing to find the true root of this problem. EDIT: The "stack underflow" was due to the number of pops exceeding the number of pushes. With that out of the way, there is now a "stack overflow" that I am trying to take care of. EDIT #2: All of the errors are now taken care of. The only thing left is getting the shading back. It was smoother and more gray. This may be due to all of the other errors that were occurring, however.
    Last edited by Flotonic; 03-07-2013 at 09:51 PM.

  6. #6
    Junior Member Newbie
    Join Date
    May 2011
    Posts
    26
    Update: OpenGL is no longer detecting errors but the font is still not working for the people that it has not been working for.

Posting Permissions

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