Hi all,

I want to have a MDI application with OpenGL enabled on child forms. additionally each form can have controls than OpenGL. I have tried Nehe's lessons but all of them have used an infinite loop to call glDraw function which can not be done in MDI application as there may be multiple forms opened simultaneously. I need a replacement of OnDraw function of CView class in VC++. I have tried to overried OnPaint event of Form but it is not usefull as image disappears if you resize window etc.

You can do it as an infinite loop you would just need to call a function to do te drawing on each of the relevant forms in the loop.

I have already tried and found of no use, as i mentioned my original post that when form is resized or restored from minimized state then all drawings disappear and i have to wait for a couple of seconds. But when i coded same thing using CView in VC++ it was perfect.

That doesnt sound normal. As long as your form calls invalidate it should paint, and as part of your paint it should draw the openGL part.. I dont see ayn reason that wouldnt work.

I have called Form.Invalidate/Refresh from each event of the Form to repaint the form, but it is not doing so well. I think reason may be the number of triangles i am drawing (whcih is more than 300 thousands).

That is quite a lot, especially then if you multiply it up over multiple forms. What sort of FPS are you getting?