Win32 vs GLUT
Oka.. Im curious what are pros and cons to using either of these two to create the open gl with..
I mean sure, GLUT has alot less code for opening window and initializing and such..but the win32 is more in depth, and linked with windows..
Which is better to use?
When is it better to use?
Any other pro''s cons?
-Phar
Beginner/demos/small applications = GLUt
Advanced/pofessional applications = Win32 OpenGL
Advanced/pofessional applications = Win32 OpenGL
"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared
GLUT is just a wrapper around the Win32 API (or XWindow on Linux), registering callbacks for the most usual windows messages, that kind of stuff.
There really isn''t much difference between its message pump and the one you would write yourself. GLUT is sufficient unless you need access to functionality it doesn''t have.
... which of course you could just add to the library
[ Start Here ! | How To Ask Smart Questions | Recommended C++ Books | C++ FAQ Lite | Function Ptrs | CppTips Archive ]
[ Header Files | File Format Docs | LNK2001 | C++ STL Doc | STLPort | Free C++ IDE | Boost C++ Lib | MSVC6 Lib Fixes ]
There really isn''t much difference between its message pump and the one you would write yourself. GLUT is sufficient unless you need access to functionality it doesn''t have.
... which of course you could just add to the library

[ Start Here ! | How To Ask Smart Questions | Recommended C++ Books | C++ FAQ Lite | Function Ptrs | CppTips Archive ]
[ Header Files | File Format Docs | LNK2001 | C++ STL Doc | STLPort | Free C++ IDE | Boost C++ Lib | MSVC6 Lib Fixes ]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
just use win32
when i started out, i was working on a small project type thing.. and well... had to start again because i started out using glut and had limitations
save urself now and just use win32
when i started out, i was working on a small project type thing.. and well... had to start again because i started out using glut and had limitations
save urself now and just use win32
Want to get started with OpenGL ? Use glut (really easy to use).
Want to code Windows-only apps ? use Win32.
Want to code Windows/Linux/MacOS apps ? use SDL.
SaM3d!, a cross-platform API for 3d based on SDL and OpenGL.
The trouble is that things never get better, they just stay the same, only more so. -- (Terry Pratchett, Eric)
Want to code Windows-only apps ? use Win32.
Want to code Windows/Linux/MacOS apps ? use SDL.
SaM3d!, a cross-platform API for 3d based on SDL and OpenGL.
The trouble is that things never get better, they just stay the same, only more so. -- (Terry Pratchett, Eric)
SaM3d!, a cross-platform API for 3d based on SDL and OpenGL.The trouble is that things never get better, they just stay the same, only more so. -- (Terry Pratchett, Eric)
GLUT is better to use when you have small to medium projects, that have no chance of becomming large. GLUT tends to break down the larger the project, unless you plan ahead.
Win32 does have a lot more flexability, and allows you to arrange things better for larger projects, but the extra work in creating a small project using it, is usually not worth the time.
~~~~~
"i feel wempty inside." - my evil twin.
Download and play Slime King I.
Win32 does have a lot more flexability, and allows you to arrange things better for larger projects, but the extra work in creating a small project using it, is usually not worth the time.
~~~~~
"i feel wempty inside." - my evil twin.
Download and play Slime King I.
~~~~~Screaming Statue Software. | OpenGL FontLibWhy does Data talk to the computer? Surely he's Wi-Fi enabled... - phaseburn
My demonstration application using GLUT works fine:
now I need to integrate it into another Win32 application
(for which I do not have the source code, soemone else does).
What is the simplest way of getting GLUT to use an exisiting
window in this application: can he pass an hWnd into my classes
and so to GLUT? Any examples?
I didn''t anticipate this difficulty. nn @ nicknisbet . com
now I need to integrate it into another Win32 application
(for which I do not have the source code, soemone else does).
What is the simplest way of getting GLUT to use an exisiting
window in this application: can he pass an hWnd into my classes
and so to GLUT? Any examples?
I didn''t anticipate this difficulty. nn @ nicknisbet . com
I don''t see how GLUT cannot be used for large applications. It is after all creating the window and initialising all the Win32 crap for you.
I think GLUT is perfect for any fullscreen application. It also makes it portable. I used to use GLUT but i bought into what most of these people on this forum say and therefore switched to Win32. Now that i have switched, i still don''t see any reason why using Win32 code has been of any advantage to me.
Unless you want to use Menus,buttons and Win32 GUI components, GLUT should suit you fine.
I think GLUT is perfect for any fullscreen application. It also makes it portable. I used to use GLUT but i bought into what most of these people on this forum say and therefore switched to Win32. Now that i have switched, i still don''t see any reason why using Win32 code has been of any advantage to me.
Unless you want to use Menus,buttons and Win32 GUI components, GLUT should suit you fine.
The main problem I had with glut is that because its main loop doesn''t exit normally it doesn''t play nice with C++ destructors.
Objects which would get destroyed after the loop finishes don''t. Or at least that''s how I remember it, I may be wrong.
Why you shouldn''t use iostream.h - ever! | A Good free online C++ book
Objects which would get destroyed after the loop finishes don''t. Or at least that''s how I remember it, I may be wrong.
Why you shouldn''t use iostream.h - ever! | A Good free online C++ book
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement