OpenGL and GUI's

Started by
4 comments, last by geekster 20 years, 5 months ago
Is it possible (in performance or just technically) to write a 3d engine that can be used both in-game and in a 3d gui editor written with a toolkit such as wxWindows or FLTK? If so, what are the things/techniques to look in to?
Advertisement
Thats what opengl was made for=)
-BourkeIV
Yes. You can embed an opengl window in just about any modern GUI toolkit. FLTK makes it easy and powerful - you can use gl drawing code in any widget and customise the look how you want.

The only difference between this and in a game is that the 3d scene is probably rendered to a smaller buffer and you are in windowed mode, which will slow things a bit.

Other things to look out for are:

- input: chances are you won''t accept input in the same ways
- event based timing: GUI toolkits run on an event model so your engine will have to do what it needs to when told to by an event and then release control back to the event driven framework.
- selection: you''ll want some kind of picking. this will take some planning to integrate with your engine in a non-hacky way.
- project organisation: it''ll be really handy to have the renderer (for instance) in a dynamic lib so that you don''t have to recompile the tools evertime you change the engine and vise versa.

theres probably a few more, but these are what I''ve come across myself.

Dan
[size="1"]
So events will require parts of the engine to be made in two versions?
Well, I think I''ll just stick to writing a GUI version, as long as both engine (mine or someone else) can use the same file format everything will be fine...

Thanks for the replies
I use GLUI for an application I''m currently developing for Windows and Mac OS X. It''s working great so far. I had to make one small modification to add password masking to the edittext field, but since it''s open source I was able to do this in a few minutes.

http://www.cs.unc.edu/~rademach/glui/

The one thing about it is that it requires you to use GLUT for window management, which isn''t a big deal as GLUT is pretty nice to use on its own. An open source version of GLUT exists here if you''re interested:

http://freeglut.sourceforge.net/fg/



MatrixCubed
http://MatrixCubed.cjb.net

Very interresting! Thanks!

This topic is closed to new replies.

Advertisement