Results 1 to 2 of 2

Thread: glutBitmapString mess with my OpenGL ES App

  1. #1

    glutBitmapString mess with my OpenGL ES App


    I know its a little offtopic but i dont know where else to ask.

    Im using GLUT|ES and i wanna show the FPS.
    I alreay calculate the FPS, but when i try show the FPS using glutBitmapString or glutTrueTypeString, the FPS appear but my model looks weird.

    And when i try show the FPS with a bigger model, the application stuck (without the glutBitmapString procedure, the model is well rendered).

    Im using the code below, before the "glutSwapBuffers()" in the method display()
    Code :
    glutBitmapString(GLUT_BITMAP_8_BY_13, 5, 5, "Test");

    What im doing wrong?

    Thank you

    Wendel B Silva

  2. #2
    Senior Member
    Join Date
    May 2006
    The problem is likely that glutBitmapString does not reset all GL state it changes.

    If you look at the source, you can see that e.g. glutBitmapStringPoints does push and pop the matrices, however it fails to reset DEPTH_TEST and ALPHA_TEST enable, MatrixMode, AlphaFunc, as well as all the vertex array enables and VertexPointer to their previous values.

    Most importantly the pointer to the vertex position array will be invalid after glutBitmapString returns. So even if you're rendering only a single object you can't set it just once in your init code.
    Georg Kolling, Imagination Technologies
    Please ask questions specific to PowerVR hardware or SDKs on the PowerVR Insider Forum |

Similar Threads

  1. Trying to get an OpenGL view in an IPhone app
    By Stoff81 in forum OpenGL ES
    Replies: 1
    Last Post: 12-21-2008, 01:49 AM
  2. Problem with normals in OpenGL ES in S60 app
    By Fadi Chehimi in forum OpenGL ES
    Replies: 5
    Last Post: 09-05-2005, 12:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Proudly hosted by Digital Ocean