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: glut vs. Win32 vs. MFC

  1. #1
    Intern Contributor
    Join Date
    Feb 2000
    Posts
    89

    glut vs. Win32 vs. MFC

    I have some experience with openGL under glut, MFC, and vanilla Win32 and I was wondering if anyone had strong opinions about the pro's and con's of the different approaches to windowing.

    I am about to start a fairly large OpenGL project which will entail doing some interactive virtual worlds sort of stuff with lots of wacky, off-the-beaten-path input/output devices.

  2. #2
    Intern Contributor
    Join Date
    Feb 2000
    Posts
    89

    Re: glut vs. Win32 vs. MFC

    Oh yeah, I guess I should add that my application will probably spend most or all of its time in a full-screen mode, which means I'm not needing to use any Windows GUI widgets.
    I'm kind of leaning towards glut, but I thought I'd see if anyone had compelling arguments to the contrary.

  3. #3
    Advanced Member Frequent Contributor
    Join Date
    Feb 2000
    Location
    London
    Posts
    503

    Re: glut vs. Win32 vs. MFC

    I wouldn't bother with MFC in this case; it doesn't gain you anything and it creates a hell of a mess.

    GLUT is pretty good in most respects, but a couple of points to bear in mind:

    1) Although you can run fullscreen in glut 3.7, you can't actually change screenmode (i.e. resolution or colour depth).

    2) glut's support for input controllers is a bit limited (only recognizes 2 joystick axes, and I think buttons are quite limited as well). You may be able to use input device APIs alongside glut though - anybody tried this?

    3) You can't get at the message pump. Some performance impact, but not a huge one.

    If these are OK, go with glut. Otherwise, you're probably better off with vanilla Win32.

  4. #4
    Junior Member Regular Contributor
    Join Date
    Feb 2000
    Posts
    154

    Re: glut vs. Win32 vs. MFC

    Totally agree with MikeC except on 1. You can change resolution with GLUT 3.7. Although I haven't found any docs on it, but after looking in the source... try this:

    void glutGameModeString(const char *string);
    int glutEnterGameMode(void);
    void glutLeaveGameMode(void);

    The format for the mode string, for example:
    "800x600:16@60"

    Instead of glutCreateWindow you call glutEnterGameMode, but before that you should ofcourse specify resolution with glutGameModeString. At exit call glutLeaveGameMode.

    Well, thats it. Although I had have little success with this on voodoo cards it works on all other cards I tested.

    The only documentation I found on this is the man pages that comes with the source and source itself, doh.

    Cheers

  5. #5
    Member Regular Contributor
    Join Date
    Feb 2000
    Location
    milano, italy
    Posts
    282

    Re: glut vs. Win32 vs. MFC

    about mode changing, when i was using glut i usually set the new screen reolution with a call to ChangeDisplaySettings() BEFORE calling the first glut function (glutInit() or something like that)

    however, i've found no way to freerly make it change when the application was running...

    Dolo/\/\ighty
    Dolo/\/\ightY

  6. #6
    Junior Member Newbie
    Join Date
    Feb 2000
    Location
    Japan
    Posts
    1

    Re: glut vs. Win32 vs. MFC

    You can check the asteroid demo in the Glut distribution for an example of GlutGameMode.

Posting Permissions

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