Archived

This topic is now archived and is closed to further replies.

Zaxxon21

Whats the best GLUT alternative?

Recommended Posts

I have been using GLUT for quite a while, but I have two main problems with it. The first and more major one is that I want to make my game very object oriented, but because the callback functions in glut are static I am required to have tons of static/global objects and I think that makes my code look a lot less eligant. Gripe numbers 2 is the classic lack of a "good way" of being able to exit the glut main loop. I know of the hack, but its not that eligant to hack the source code. I have seen large numbers of glut alternatives, but the few I have looked at I haven''t been overly impressed with, ie. GLOW, GLFW, VR Juggler. Does anyone have a favourite GLUT alternative and care to explain why they like it?

Share this post


Link to post
Share on other sites
As I said in another thread, Win32 works exactly the same way.
The "WndProc" is the callback function for a window. So if
you find GLUT "less elegant", then how do you cope with Win32?

Besides, it''s easy to wrap things up into nice C++ classes.
The same way you''d wrap Win32 into something like MFC.

The "never-return" glut main loop is annoying , but
not impossible to deal with. There is no need to hack the
source code. I found a solution that uses atexit() without
touching the GLUT source code. It''s actually in the OpenGL
FAQ document, which can be found on the OpenGL web site.

Other libraries that you are likely to come across just
does this exact same thing behind your back, that''s all.



Kami no Itte ga ore ni zettai naru!

Share this post


Link to post
Share on other sites
quote:
Original post by Zaxxon21
Does anyone have a favourite GLUT alternative and care to explain why they like it?


Erm ... yeah - try programming it yourself. It''s actually very simple after the first few attempts, and a damn site more powerful.


Before I say more ... try answering the following questions ...

1: Why do you use glut?
2: Why don''t you do it yourself?
3: What addvantages / disadvantages are there with each of the above?

Share this post


Link to post
Share on other sites
I don't use glut at all, probably because glut based progs tend to crash frequently. I have looked into the glut sources before. Glut merely wraps the win32+ogl stuff - sort of like using MFC to program the windows UI. I'd rather deal with the Win32 stuff myself. If I was going to use a toolkit, I'd start with CPW and proceed forward from there.

// Edit

Looks like Jim Mathies of CPW has put together a really great reference page on OpenGl toolkits.

[edited by - lessbread on August 16, 2002 3:10:21 AM]

Share this post


Link to post
Share on other sites
I''d say it depends on how portable you want your code to be.

If you are working on only one platform then code it yourself. Its not that hard, learn from and extend the NeHe tuts for your platform.

On the other hand, if you want to be portable than use SDL. In conjunction with OpenGL it can do pretty much everything DirectX can do, does it fast, and has a relatively easy to use interface.

Coding it yourself is a huge task in itself if you want to stay portable. SDL even includes cross platform threading functions, which I''m sure would be a nightmare to implement from scratch..

Dan

Share this post


Link to post
Share on other sites