MFC and DirectX in an MDI application

Started by
1 comment, last by Ro 24 years, 3 months ago
I couldn''t figure out where to put the code for intitializing DirectDraw, the device, the buffers, viewport, etc. in my MDI application. I need both DirectDraw and Direct3D. Should I put the initialization of DirectDraw in the MainFrame class somewhere, or the View''s OnInitialUpdate. I know that I will need to handle OnSize, so I guess that''s where I would create my primary and secondary buffers. However, I''m not sure where exactly to put the stuff. I''m using the DX5 SDK and VC++ 6.0. If anyone has experience with using DirectX in MFC and as an MDI application and could point me in the right direction, I would appreciate it a lot!
Advertisement
you shouldnt have to worry about responding to the OnSize event. using a clipper and making use of IDirectDrawClipper::SetHWND() can take care of that for you.

Get off my lawn!

At first thought, seems like the best place would be in your CWinApp''s OnInitInstance()... or perhaps in CMainFrame''s init function.

The surface creation should go in the view, tho.

Mason McCuskey
Spin Studios - home of Quaternion, 2000 GDC Indie Games Fest Finalist!
www.spin-studios.com
Founder, Cuttlefish Industries
The Cuttlefish Engine lets anyone develop great games for iPad, iPhone, Android, WP7, the web, and more!

This topic is closed to new replies.

Advertisement