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

Thread: glut and other newbie stuff.

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2000
    Posts
    3

    glut and other newbie stuff.

    I'm pretty new to programming in opengl, I've been learning mainly from the red book.

    should I or should I not be using glut? I've heard it's better to just learn to do things without it as it is slow and offers little customization. however, I've yet to find a good example on how to set up a window or set it fullscreen using a console application without glut.

    any help would be appreciated.
    tef

  2. #2
    Intern Contributor
    Join Date
    Jul 2000
    Location
    Braga, Portugal
    Posts
    97

    Re: glut and other newbie stuff.

    GLUT is wonderfull because it lets you test your opengl without messing up with the windows system.

    I've never heard a complain about it being slow, altough by definition it must be slower. Nevertheless any application can benefit rfom using GLUT in the early stages. If you're really looking for developing openGL apps, my advice would be to start with GLUT and when everything is working as it should remove GLUT and implement the windows code. If you separate the rendering from the windows commands then this should be pretty straight forward.

    Antonio www.fatech.com/tech
    Antonio Ramires Fernandes www.lighthouse3d.com

  3. #3
    Intern Contributor
    Join Date
    Aug 2000
    Location
    Webster, Ma 01570
    Posts
    64

    Re: glut and other newbie stuff.

    Glut is nice because it is portable across many systems.
    I also don't think it is any slower(or faster) than other options (such as MFCs, etc). (At least I havn't run across any real preformance problems using it).

    Hope this helps!

  4. #4
    Intern Contributor
    Join Date
    Sep 2000
    Location
    Copenhagen, Denmark
    Posts
    56

    Re: glut and other newbie stuff.

    This is a newbie question, but I guess that's what this forums for. Where do I get GLUT? If you could also tell in short terms how to connect it to the compiler (I use MS Dev. studio C++), I'd be most gratefull.

    Regards Anders

  5. #5
    Intern Contributor
    Join Date
    Sep 2000
    Location
    Copenhagen, Denmark
    Posts
    56

    Re: glut and other newbie stuff.

    Plz disregard my last post. I have gotten it to work now. If I'd realized sooner how easy it would be, I wouldn't have posted in the first place. Well, I guess that's what you get when you act before you think. Sorry for wasting your time.

    Regards Anders

  6. #6
    Junior Member Newbie
    Join Date
    Sep 2000
    Posts
    3

    Re: glut and other newbie stuff.

    ok, another question about glut. is it neccesary to use glutMainLoop()? sounds like a wierd question, but when I use it, it seems difficult to do things other than the display stuff. theres glutIdleFunc(), but the glut documentation states that there shouldn't be much code put into there, so where does your programs main non-display processing go? any way to input into the glutMainLoop() other than the predefined callbacks?

    thanks,
    tef

  7. #7
    Member Regular Contributor
    Join Date
    May 2000
    Location
    Oxford, England
    Posts
    471

    Re: glut and other newbie stuff.

    At a basic level,

    you register your callback functions to do specific things within your programs.

    ie,

    glutMouseFunc() for button presses

    glutKeyboardFunc() for keyboards

    etc

    glutIdleFunc() is pretty much essential for animations and movement (you need your computer to redraw the frame if its not doing anything. You can process your data in there and then call glutPostRedisplay() to draw the screen)

    As for the barest minimum (as far as I'm aware) glutDisplayFunc(); and glutMainLoop();
    are absolutly essential. (and the other stuff like glutInit() etc).

    Checking out the glut.h file is a good idea ocassionaly, you can often find some interesting functions......

  8. #8
    Intern Contributor
    Join Date
    Jul 2000
    Location
    Braga, Portugal
    Posts
    97

    Re: glut and other newbie stuff.

    Yes, glutMainLoop is essential. And yes, you're processing should be called from whatever callback you did register in glutIdleFunction.

    Antonio www.fatech.com/tech
    Antonio Ramires Fernandes www.lighthouse3d.com

  9. #9
    Intern Contributor
    Join Date
    Jul 2000
    Location
    Braga, Portugal
    Posts
    97

    Re: glut and other newbie stuff.

    I forgot to mention in my previous reply that you can also have input using pop-up menus in glut.

    Check out my glut tutorial at www.fatech.com/tech/glut

    Antonio
    Antonio Ramires Fernandes www.lighthouse3d.com

Posting Permissions

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