Need help with OpenGL and MFC

Started by
0 comments, last by Monder 19 years, 7 months ago
Hi folks! I'm a total newbie in the field of OpenGL and MFC programming. I managed to run an OpenGL child window within a dialog window, added some controls to it and made some objects rotate by mouse. Now I have two problems: 1 - Where can I place OpenGL commands to set up the OpenGL scene and the camera? I tried to put them everywhere but nothing ever happened. 2 - Where can I create display lists? It's like with problem number one, I put them everywhere and nothing happened. I adapted my code from the tutorial "How to Create a CHILD OpenGL Window in a Dialog" by Marc Guy on www.codeguru.com I hope these questions are not too stupid and maybe someone can answer them. Thank you in advance, Elsenhans
Advertisement
If you've set things up properly you need to make sure your GL render context is current when calling OpenGL functions. I'm not sure how it works in MFC but in Win32 you use the function wglMakeCurrent passing in the window HDC and an HGLRC, after you have done that you can execute whatever GL commands you want.

This topic is closed to new replies.

Advertisement