View Full Version : Open GL and X-Windows
03-03-2003, 07:35 AM
I am having problems creating a pop-up file selection dialog box. How do you create the X-Window and start its own event loop, and get out of that without exiting the entire program (i.e. exit(0)). Or do I even need to start an event loop for the new dialog window. Basically, I can't get back to the Open GL loop after the file has been selected. Are there any convenient functions built-in to Open GL (any toolkits, etc) which allow file selection or keyboard input into your application. Any help would be much appreciated!
03-03-2003, 09:38 AM
Try GLUT I think this is it what You want.
03-03-2003, 05:52 PM
You might also try GLUI.
03-03-2003, 11:03 PM
GLUT and GLUI do give you some GUI stuff, but you will not get any file selection dialogs from there,you need to use some GUI toolkit for this, have a peek at Fltk, FOX, Qt and others.
You could of course make one yourself... but that's much more work.
03-04-2003, 05:39 AM
Thanks, I hadn't heard of most of those and I was having a real hard time finding stuff. I have already used X-Windows though http://www.opengl.org/discussion_boards/ubb/frown.gif and was wondering if anyone knew how to open an X-Window within the Open GL event loop. I can get the window to open and read in the file, but I cant find a way to get rid of the window after I am done selecting the file. Thanks!
Thanks, I hadn't heard of most of those and I was having a real hard time finding stuff. I have already used X-Windows though and was wondering if anyone knew how to open an X-Window within the Open GL event loop. I can get the window to open and read in the file, but I cant find a way to get rid of the window after I am done selecting the file.
OpenGL _doesn't_ have an event loop because it doesn't have callbacks (well, except arguably for tessellation) and doesn't respond to events.
I'm guessing that you're using OpenGL with GLX and Xlib, right? If so, then you probably want to call one of XDestroyWindow() or XDestroySubwindows(). (See the relevent manual pages for args).
But just to reiterate: opengl doesn't haev an event loop, nor does it represent windows/drawables, so there is no standard opengl way to destroy such things.
BTW, you *should* check out one of the APIs the other users suggested. I code GL with X/GLX and also with Gtk. I've also looked at OpenGL under FOX and FLTK but decided they weren't for me. You have to pay for OpenGL support under Qt.
03-05-2003, 12:18 AM
I do think he means that he wants to create an ordinary XLib window while running from inside GLUT, correct me if I am wrong.
Fltk is pretty simple and does not look that nice (at least not V1), but it's getting better.
FOX is much nicer, but does lack some documentation, even though it has improved a lot.
A correction, you do not have to pay to use OpenGL with Qt (on X), all parts of Qt are GPL'd on X including OpenGL, you do have to pay to use it on Windows though, unless you use the free for non commercial use 2.03 version.
03-05-2003, 12:52 AM
Why not think the other way around...
Use XFORMS, write the OpenGL to an OpenGL
enabled canvas widget (ie with the correct GC, GLX).
XFORMS will give you all the gadgets you need, file dialogs, buttons, sliders and so on.
Open Source too ...
Runs on all Unix platforms.
Powered by vBulletin® Version 4.2.2 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.