What do u think? I’ve heard that glut has a frame rate hit to the app. Is it better to use winapi or glut for making a simple or a more complex game?
GLUT has a lot of overhead. thats what hurts its performance.
The good thing of GLUT is that its platform independant.
If you plan on porting to other OSs, use GLUT. if not, and u have a good knowledge of win32, use that.
The performance hit you get with GLUT is not very big. Thats what I can tell you by my experience. If you’re doing demos, is the way to go, if you’re looking for a ‘serious’ project, you should choose wisely…
I’d recommend only using GLUT for quick demos or to test algorithms mainly because once you enter the GLUT main loop, say bye bye to your main thread.
In my opinion GLUT is better, it is far cleaner in terms of readability, it is platform independant and is easy to learn. What do you mean when you said that thing about saying bye bye to the main thread when you enter glutMainLoop? Also I dont think the overhead would matter much. In most apps you will only call around 5-10 glut functions, thats not many, and I doubt 5-10 functions would cause alot of overhead.
One reason not to use glut would be if you want to do any Windows specific stuff with your window. For instance, adding custom controls, toolbars, etc.
glutMainLoop basically takes over control of your message pump, so if you want to do anything specialized in that, you would be better off using the Win32 API as well.
For quick, portable demos Glut is great, though.
win32 gives you far better control over the interfacing. As for portability, you could make an alternate version that uses glut or whatever you want for 'nix/mac. The api should only interface to your code so there shouldn’t be too much to reprogram. I find glut just a little to simple and fairly slow.