Archived

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

DX 8 in MFC SDI apps

This topic is 5654 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

i''m trying to make a dx8 app run in a MFC SDI environment and i don''t quite know where to begin. i read the dx8 in mfc tutorial in the articles section but that wasn''t much help (backbuffer dimensions, i am supposedly drawing into a view, but where was i suppose to specify that? etc.) initially i thought this was easy, i just get the client area, make that the back buffer, and draw... but that didn''t work (the DX drew over my toolbar which was apparently in the client area, and the white client area remained blank along with other bizarre effects). ive done a lot of stuff with dx and opengl in full screen environments but for my current application i think the easy mfc-made gui would be really useful so if anybody can give me the low-down or even better, a sample project of dx8 in sdi, that wud b highly appreciated. thx

Share this post


Link to post
Share on other sites
quote:
Original post by wannabe H4x0r
initially i thought this was easy, i just get the client area, make that the back buffer, and draw... but that didn't work (the DX drew over my toolbar which was apparently in the client area, and the white client area remained blank along with other bizarre effects).


You need to use the view window, not the frame window, for rendering. See there. Note: the article doesn't present the optimal way of combining DX & MFC (in particular, you should call UpdateFrame from CMyApp::OnIdle handler instead of invalidating view's client area), but it should get you started.

[edited by - IndirectX on June 23, 2002 10:15:22 PM]

Share this post


Link to post
Share on other sites
thanx, so wat i need to do is... since CView class is inherited CWnd, i should just GetClientRect on my app''s CView object and make that my buffer instead, do everything else normally and that should work?

Share this post


Link to post
Share on other sites