943,526 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Unsolved
  • Views: 1320
  • C# RSS
Sep 16th, 2008
0

OpenGL in MDI application

Expand Post »
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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
kashifbhatti is offline Offline
6 posts
since Mar 2008
Sep 16th, 2008
0

Re: OpenGL in MDI application

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.
Reputation Points: 196
Solved Threads: 190
Posting Virtuoso
LizR is offline Offline
1,735 posts
since Aug 2008
Sep 16th, 2008
0

Re: OpenGL in MDI application

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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
kashifbhatti is offline Offline
6 posts
since Mar 2008
Sep 16th, 2008
0

Re: OpenGL in MDI application

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.
Reputation Points: 196
Solved Threads: 190
Posting Virtuoso
LizR is offline Offline
1,735 posts
since Aug 2008
Sep 17th, 2008
0

Re: OpenGL in MDI application

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).
Reputation Points: 10
Solved Threads: 0
Newbie Poster
kashifbhatti is offline Offline
6 posts
since Mar 2008
Sep 17th, 2008
0

Re: OpenGL in MDI application

That is quite a lot, especially then if you multiply it up over multiple forms. What sort of FPS are you getting?
Reputation Points: 196
Solved Threads: 190
Posting Virtuoso
LizR is offline Offline
1,735 posts
since Aug 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: accesss c# help
Next Thread in C# Forum Timeline: Reflect on Life; Reflect on C#





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC