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

Thread: glut update game on idle or draw

  1. #1
    Junior Member Newbie
    Join Date
    Dec 2012
    Posts
    8

    glut update game on idle or draw

    What is the better way to update my game. Update it before I draw during glutDrawFunc, or update it during glutIdleFunc?

  2. #2
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,948
    Neither. You shouldn't be using GLUT of any kind to make a game. GLFW is far better for that task.

  3. #3
    Junior Member Newbie
    Join Date
    Dec 2012
    Posts
    8
    Hmm, never hear of it, how is it better?

  4. #4
    Member Regular Contributor Nowhere-01's Avatar
    Join Date
    Feb 2011
    Location
    Novosibirsk
    Posts
    251
    Quote Originally Posted by cookedbird View Post
    Hmm, never hear of it, how is it better?
    well using glut, while you making progress, you will notice that it requires some parts of your application to be centered around it. it is quite awkward, it may limit you and it is not suitable for real projects. it has more educational purpose, it is handy to build quick demo. and as far as i'm aware, it still uses a lot of deprecated functionality. it uses immediate mode to draw primitives, which is very inefficient and also not supported in modern opengl. GLFW is a tool which is designed to make context creation easy, also it has some input functionality, extension handling et c. basically, it handles all the OS-dependent stuff decently. but it doesn't interfere rendering and project's structure. and it's not outdated.

    and for updating the game logics\physics\animation you should have a separate thread. rendering thread should be as independent as possible.
    Last edited by Nowhere-01; 01-12-2013 at 01:58 AM.

Tags for this Thread

Posting Permissions

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