MFC MDI OpenGL Question

MFC MDI OpenGL Question

Post by Peter J. Wahl » Fri, 23 Apr 1999 04:00:00



I'm in the process of porting my OpenGL code to MFC (VC++ 5.0) from GLUT.
I'm rather new to MFC, but have been using OpenGL & GLUT for a few years.

I can get the cube example to run, but it is only SDI and I need MDI.  I
need each new document window to be an independent OpenGL window (perhaps an
orthographic cone view in one window, a perspective view cube in another, a
2-D image in a third window, etc.).

Are there some WebPages covering this that you could point me to, or perhaps
some basic MFC MDI code to get me started correctly?

 
 
 

MFC MDI OpenGL Question

Post by Jon » Fri, 23 Apr 1999 04:00:00


For each of your views in the MDI app before you start drawing you need to
make the current view the active gl context by calling :

wglMakeCurrent(hDC, hRC)

and calling :

wglMakeCurrent(NULL, NULL)

when you finish your drawing in your view.



Quote:>I'm in the process of porting my OpenGL code to MFC (VC++ 5.0) from GLUT.
>I'm rather new to MFC, but have been using OpenGL & GLUT for a few years.

>I can get the cube example to run, but it is only SDI and I need MDI.  I
>need each new document window to be an independent OpenGL window (perhaps
an
>orthographic cone view in one window, a perspective view cube in another, a
>2-D image in a third window, etc.).

>Are there some WebPages covering this that you could point me to, or
perhaps
>some basic MFC MDI code to get me started correctly?


 
 
 

MFC MDI OpenGL Question

Post by David Le » Fri, 23 Apr 1999 04:00:00


Ron Fosner wrote an article on programming OpenGL using VC++ (with MFC).
Check Nov. 1996 issue of MSJ for that article.


>I'm in the process of porting my OpenGL code to MFC (VC++ 5.0) from GLUT.
>I'm rather new to MFC, but have been using OpenGL & GLUT for a few years.

>I can get the cube example to run, but it is only SDI and I need MDI.  I
>need each new document window to be an independent OpenGL window (perhaps
an
>orthographic cone view in one window, a perspective view cube in another, a
>2-D image in a third window, etc.).

>Are there some WebPages covering this that you could point me to, or
perhaps
>some basic MFC MDI code to get me started correctly?

 
 
 

1. Need help: OpenGL in MFC MDI Application

Hi all!

I spent a whole day searching the web for tutorials on how to animate simple
objects in multiple child windows in a MDI application created with MFC.
Let's take an example of rotating objects in each child window.  Each child
window's view will call OnDraw which calls the function to draw the OpenGL
objects.  How do I make them all work concurrently or at least make it seem
like it is?  I know that a child window's call to a draw function cannot
stay in a loop or else the others will freeze right?

Any help would be very appreciated... links to tutorials would be nice too.
I tried NeHe tutorials already and found nothing for child windows.

Regards,

Lee

2. ***CALL FOR VOTES*** rec.arts.bodyart

3. opengl crash on nt2000 VC 6.0 MFC MDI app using spliiterWnds

4. MPEG info and/or C source needed?

5. OpenGL & multithreaded MFC/MDI

6. We Meet You Graphic Needs

7. MFC: MDI 4 wndws with OpenGL HOWTO

8. WANTED: CONTOUR PLOTTING (FORTRAN) ROUTINE

9. mdlviewer source released (MFC MDI OpenGL app)

10. MFC-MDI OpenGL example wanted...

11. OpenGL, MFC, MDI

12. A MDI OpenGL view class (MFC on Win95/NT)

13. For David DNA (Reg: MFC MDI and OpenGL)