PDA

View Full Version : Writing openGL programs to be multiplatform



nexusone
12-30-2002, 05:41 AM
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?

marcus256
12-30-2002, 02:55 PM
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 (http://www-users.york.ac.uk/~rpf1/glut.html) (if you're willing to require every user of your source to patch GLUT himself - GLUT license issue).

An alternative GL toolkit, GLFW (http://hem.passagen.se/opengl/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).

nexusone
12-30-2002, 05:27 PM
My problem is the program keep running in the back ground when the [X] is pressed and happens with gtk also.


Originally posted by marcus256:
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 (http://www-users.york.ac.uk/~rpf1/glut.html) (if you're willing to require every user of your source to patch GLUT himself - GLUT license issue).

An alternative GL toolkit, GLFW (http://hem.passagen.se/opengl/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).

azcoder
12-31-2002, 12:48 PM
Another cross-platform option is to use SDL with OpenGL. SDL is at www.libsdl.org. (http://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...

rpxmaster
12-31-2002, 04:16 PM
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/

marcus256
01-03-2003, 03:13 AM
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 (http://hem.passagen.se/opengl/glfw) http://www.opengl.org/discussion_boards/ubb/wink.gif

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

(640x480x32, 24-bit depth, fullscreen)