MDI and OpenGL

Started by
2 comments, last by TheSnowMan 20 years, 6 months ago
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.
Adam BeatyRhino Productions
Advertisement
quote: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]
My opinion is a recombination and regurgitation of the opinions of those around me. I bring nothing new to the table, and as such, can be safely ignored.[ Useful things - Firefox | GLee | Boost | DevIL ]
iNsAn1tY, you sly devil!

[edited by - nfz on September 23, 2003 11:05:04 PM]

This topic is closed to new replies.

Advertisement