View Full Version : OpenGl in MFC?

10-26-2000, 10:21 PM
I know this question(s) is going to sound really uneducated, but here goes.

I also apologize in advance for any misuse of terminology.

I want to use OpenGL with the options of pulldown menus, (File->Open,Close, Exit, etc..) buttons, text boxes etc..I tried GLUI but it's not really what I had in mind.

Most tutorials (like Nehe) use Visual C for Windows creation. This seems very difficult to me. Glut however makes things much nicer.

Is there such a thing as using glut with MFC. I'd like the ease of Visual Basic (layout wise) with the speed of C++ in a GUI design.

Is using GLUT with MFC a contradiction of terms? I don't want to spin wheels forever if what I'm trying to do just doesn't make sense to start with..

I read a tutorial on using opengl with MFC and it had lots of info on device contexts, pixelformats, etc...(i.e., the confusing parts) Is this all neccesary?

Any clarification would grealy be appreciated. And thanks to all the people who've helped me in the past on this board.

10-27-2000, 12:43 AM
Actually, MFC stands for Microsoft Foundation Classes: it is just a set of classes...

You could use the MFC (I mean the classes !) with GLUT: you could use CString, CException, ....

But as far as using an MFC framework (which means an SDI or MDI application) and GLUT at the same time, I think you will not be able to do that: such a framework is based on a Document/View architecture. You basically tell MFC what you document is and how your view should display it ; then MFC will handle the windows management.

When using GLUT, you just tell it to open an OpenGL window.

I do not think there is a way of telling MFC that a GLUT window should be seen as a view on a certain document.....

To make a long story short, I do not think you can use an MFC GUI with GLUT...

But the good news is that using MFC with rendering contexts, device contexts, ... is not that difficult !

Best regards.


P.S. : I have never seen GLUT used in an MFC framework but perhaps someone has done it... I am sure it involves going deep into the MFC source code (which I now do on a daily basis for other purposes and I can say, it is not fun !).

10-27-2000, 01:54 AM
hello Ace_Man,

I'm not a special in MFC, but I have a URL for you... It's not very difficult to use it. It's an little exemple.

I know a personne who make a little application with GLUT and he says that it's the same to use GLAUX or anything else.

I hope that help you