Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


OpenGL MDI and OpenGL

This topic is 5560 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I am trying to mix MDI and OpenGL to create a Photoshop setup. I will have a set number of windows (4 of them) and I need to be able to draw different items on all the different windows and have each of those windows be able to respond to different inputs. There will be OpenGL used in some of the windows and just win32 used in the others. I don''t want to use mfc. Please if you have any tutorial, sample code, link, please send it over.

Share this post

Link to post
Share on other sites
Original post by TheSnowMan
I don't want to use mfc.
See, now that's a real problem, because MFC is tailor-made to solve exactly the problem you have. In MFC, an MDI child window can have what's known as a view associated with it. The view fills the window's client area, and in effect becomes the window's client area. As a view is a class, it can have it's own functions for drawing, updating, responding to mouse clicks, etc. Say you created your four windows in an MDI window. Each could have a view which responded the way you wanted it to (views are classes based on windows, and support OpenGL, too). You'd just have to make four view classes, put different code in each, and tell each MDI child which to use. I didn't like MFC until I was somewhat forced into using it by my programming. When you think that Microsoft's expert programmers have put together and debugged thousands of lines of code for you to use, to save you time, it's kind of good.

If I've changed your mind, go and pick up Programming Windows with MFC, Second Edition, by Jeff Prosise. If you want to stick to the Win32/MDI system, I suggest you look in Programming Windows, Fifth Edition, by Charles Petzold. You might also want to try www.codeproject.com, however, they are oriented to C++ and MFC, and might not be much help.

Actually, how are you creating your child windows? Surely they all have a WinProc callback function? Why not create four different WinProcs (do it in four different files to avoid confusion) then get each of your MDI child windows to call a different WinProc. That way, when your child windows are created, you can initialize them with a WM_CREATE handler. You can process input with WM_LBUTTONDOWN and the like, and repaint them using WM_PAINT. Each child window has it's own WinProc callback handler. It's almost like using a class...

[Insert witty signature here]

[edited by - iNsAn1tY on September 23, 2003 8:42:21 PM]

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!