Writing openGL programs to be multiplatform

My goal has been to try keep my programs not platform dependent.

I have been playing with glut, because of that fact.

I also have been looking at things like gtk library for windows interface, and nice multiplatform GUI.

I have had one major problem with using glut and gtk, both seem not to exit when I use the [X] button to close them. Like the exit signal is not seen by ether. I have tried with lcc-win32 and Dev-c++, nether seems to work as expected. Anyone use these compileres with glut or gtk?

The [x] button is a known issue with the GLUT toolkit (it becomes even more annoying when you have multiple windows, and closing one window exits the entire program!). Rob Fletcher has a fix for it here (if you’re willing to require every user of your source to patch GLUT himself - GLUT license issue).

An alternative GL toolkit, GLFW , does not suffer from that problem (you can’t prevent the window from being closed, at least not yet, but your application does not exit). And yes, GLFW is portable (design goal), even more so than GLUT in some aspects (less in other - but that will hopefullt be remedied with time).

My problem is the program keep running in the back ground when the is pressed and happens with gtk also.

Originally posted by marcus256:
[b]The button is a known issue with the GLUT toolkit (it becomes even more annoying when you have multiple windows, and closing one window exits the entire program!). Rob Fletcher has a fix for it here (if you’re willing to require every user of your source to patch GLUT himself - GLUT license issue).

An alternative GL toolkit, GLFW , does not suffer from that problem (you can’t prevent the window from being closed, at least not yet, but your application does not exit). And yes, GLFW is portable (design goal), even more so than GLUT in some aspects (less in other - but that will hopefullt be remedied with time).

[/b]

Another cross-platform option is to use SDL with OpenGL. SDL is at www.libsdl.org. It is Open-Source (LGPL) and has cross-platform support for window creation, sound, input, threads, etc…

Just thought I’d mention it as an alternative to glut…

I use wxWindows myself, but there’s something that really bothers me about it. Is there a way to make your program go into fullscreen using it? I haven’t figured out how to, though.
http://www.wxwindows.org/

Originally posted by rpxmaster:
I use wxWindows myself, but there’s something that really bothers me about it. Is there a way to make your program go into fullscreen using it? I haven’t figured out how to, though.
http://www.wxwindows.org/

As I said, GLFW

glfwOpenWindow( 640,480, 8,8,8,8, 24,0, GLFW_FULLSCREEN )

(640x480x32, 24-bit depth, fullscreen)