PDA

View Full Version : MFC &OpenGL



11-02-2002, 11:05 PM
hi
I have OpenGL code that I have to insern to MFC project, how can I do that?
Is there any Example that I work with?

J P
11-03-2002, 05:12 AM
Try MFC & OpenGL at
http://www.mfcogl.com/

vladk
11-04-2002, 08:49 PM
I strongly suggest you not to use MFC. Using MFC is only adding another layer between your code and openGL renderer. And, besides, OpenGL engine is NOT compatibile with C++ class syntax, since it uses in-state rendering, which means a sort of "brush" properties for the renderer. To query OpenGL variables you need to call a function anyway, so having MFC inbetween is not a good idea.

Deiussum
11-05-2002, 05:36 AM
Uh... there's nothing wrong with using C++ and OpenGL. In fact, I thing using an OOD tends to make 3d graphics in general a bit easier.

Generally I'd agree with staying away from MFC if you are doing something like a game. But if you are doing something like a modeller, or some other type of viewer it's perfectly acceptable, and can make a lot of the windowing stuff easier for you.

jebus
11-05-2002, 05:53 AM
OpenGL engine is NOT compatibile with C++ class syntax

wtf?

jebus

ppinter1
11-05-2002, 08:37 AM
While I wouldn't use MFC in a game engine, the use of OpenGL with MFC is otherwise perfectly harmless in my opinion.

MFC neatly adds an abstraction layer above Windows to make message pump handling easier and provides utility and collection classes among other constructs.

Here's a simple example of a small program that uses MFC to decode 3D Studio MAX meshes, displaying the mesh with OpenGL:

Display3DS (http://p-squared.com/Display3DS.php)

Good luck,
/p2