Win98 MDI VC 5.0 OpenGL Question

Win98 MDI VC 5.0 OpenGL Question

Post by pride » Sat, 26 Sep 1998 04:00:00



Hey all,
    I've created an MDI application (MFC App Wizard) that does OpenGL
drawing in
the C*View windows. When I have only 1 view open everything is fine.
When I create more (File/New), only the new window is drawn correctly.

First of all, yes I do call wglMakeCurrent() in my paint routine.

This is even wierder: When I size the first window (which is no longer
being updated) my
OnSize() for the new window is executed!

Can someone point me in the right direction please? Is there some
additional thing I must
do other than the wglMakeCurrent()?

    regards,
                    Paul J. Rider.

 
 
 

Win98 MDI VC 5.0 OpenGL Question

Post by Uwe Kotyczk » Tue, 29 Sep 1998 04:00:00


Hi Paul,

You only have one rendering context for your MDI application.
So you shold all wglMakeCurrent() whenever it is needed.
(For example in OnActvateView()). Sometimes it is also a good
idea to store the active contexts, activate the other ones and restore
afterwards the original contexts (for example if your view has to been
updated according to mouse events if that view does not have the focus).
Have a look at my demo
http://www.minet.uni-jena.de/~kotyczka/opengl.html

Hope this helps.

Uwe.

prider schrieb:

Quote:> Hey all,
>     I've created an MDI application (MFC App Wizard) that does OpenGL
> drawing in
> the C*View windows. When I have only 1 view open everything is fine.
> When I create more (File/New), only the new window is drawn correctly.

> First of all, yes I do call wglMakeCurrent() in my paint routine.

> This is even wierder: When I size the first window (which is no longer
> being updated) my
> OnSize() for the new window is executed!

> Can someone point me in the right direction please? Is there some
> additional thing I must
> do other than the wglMakeCurrent()?

>     regards,
>                     Paul J. Rider.


 
 
 

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

I have a VC++ 6.0 MFC app with MDI interface and splitterWnds in the MDI
Views. in one of the (plit)views I have a OpenGL-enabled View (with pretty
much the same structure as shown in the OpenGL SuperBible book, chapter 21),
all the views using only GDI. While this program ran fine in NT 4.0, on 2000
it crashes on windows creation or destruction (but not consistently). In
debug mode though it consistently crashed in the opengl enabled views
OnDestroy member in a call to wglDeleteContext( m_hGLContext );

I have looked through the msdn bug database, and though there are severla
issues with opengl and mdi, I couldnt see anything to di with this one.

Anyone has similar problem, suggestions, or better yet a solution ?

Thanks

2. An Agenda for Education in Scientific Visualization

3. openGL for vc++ 4.0 or Borland C++ 5.0

4. Screamernet help!

5. Problem calling DLL writen in VC 5.0 from VB 5.0

6. Gif liberation day is here

7. Newbie question: OpenGL and VC++.NET

8. openGL32, glut, VC++6, Win98 HELP!

9. MFC MDI OpenGL Question

10. Screen properties iusing Opengl in Win98 question.

11. Looking for TIFF-Library to use with MS-VC++ 5.0

12. VC DLL libs conversion for BC 5.0