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 2 of 2

Thread: OpenGL 3.2 Tutorial needed (Preferably Mac)

Hybrid View

  1. #1
    Junior Member Newbie
    Join Date
    Jun 2013
    Posts
    5

    OpenGL 3.2 Tutorial needed (Preferably Mac)

    Hi,

    I've been doing my best to understand OpenGL on the Mac platform. Currently it is supporting 3.2. I'd like to find a resource out there that does only 3.2 stuff.

    I've managed to find a really good tutorial on open.gl (I hope it's ok to mention other sites here).

    I've run into a texture problem and I don't know where to turn. I am looking for simplicity.

    I guess it's back to breaking things down to their simplest parts.

    OpenGL is really cool, learning it however is bit of a learning curve.

    Shooting from the hip; Can someone tell me why the samples programs off of open.gl using GLEW & GLFW only consume like 1% of my CPU while the GLUT consumes over 100% of the CPU?

    Just wondered if there is anyone out there that can answer that off hand.

    Thanks,

    Perry

  2. #2
    Member Regular Contributor
    Join Date
    Jun 2013
    Posts
    498
    Quote Originally Posted by perrya View Post
    Shooting from the hip; Can someone tell me why the samples programs off of open.gl using GLEW & GLFW only consume like 1% of my CPU while the GLUT consumes over 100% of the CPU?
    That depends upon the code in question. A common mistake is to misuse glutIdleFunc(). An idle function will be called repeatedly while no events are pending. If the idle function doesn't call any blocking functions, and either it doesn't cause any events to be generated or the generated events can be processed quickly, it can end up consuming close to 100% CPU (at least for a single core). Note that glutPostRedisplay() typically won't block, and redraw events generated while a buffer swap is pending may be queued or coalesced rather than resulting in a direct call to the display function.

    For animation, use a timer function.

    Idle functions should be reserved for coalescing updates. E.g. if you want to call an update function in response to an event, and a series of events should only call the function once (rather than once per event), register the idle function when the event occurs and have the idle function de-register itself (with glutIdleFunc(NULL)) upon completion.

Posting Permissions

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