Archived

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

MFC and full screen D3D

This topic is 6015 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 have limited experience with MFC, and I was wandering as to the feasiblity of using MFC in a full screen D3D game. Is it possible? I know there will be some penalty in terms of performance, but the scenes I plan to redner aren''t too complex anyway. The reason I would like to use MFC is that I plan on having a lot of user interaction, and I don''t want to write my own GUI. Does anyone know how I would set up my project? The windows GDI would need access to the display as well as D3D (not simultaneoulsy tho).

Share this post


Link to post
Share on other sites
Yes, depending on your degree of MFC/D3D interaction.

Generally, switching between GDI and DX is VERY expensive, so I wouldn''t do something like D3D models with GDI lines or text. You could, but it''s not good.

Doing something like placing a DX window in a dialog box that has buttons, etc. around the DX window is very doable, but I wouldn''t mix the actual drawing. If you want a DX scene with something like a listbox in the DX window, it''s probably best to implement a list box in DX.

One crazy idea... can you inherit off of the list box and override the drawing functions with DX drawing calls? It might not make any sense, but the listbox already knows the data structures, etc. Again, it may be alot more trouble than it''s worth...

Share this post


Link to post
Share on other sites
Well, if you go full screen there''s not a lot of MFC functionality to use. I guess you don''t have to bother writing a message pump, and the messages are cracked for you; but there’s only a couple of message you need to deal with.

You could still use the CFile/CSocket capabilities, but those are the one I''m staying away from. I want the engine to be more flexible – the client can use all the MFC it wants. If the engine uses MFC, then the client must use MFC, which is undesirable.

I intermix GDI drawing with the rendering. Part of our graphics engine lets you retrieve a handle to a DC that I use to blit text to, for things like displaying the frame rate. It takes 267us to GDI draw the text for the frame rate, which is a really long time for just a couple of characters. But you certainly can use it if you don’t have a lot of text to draw, or until you write your own text blitter.

quote:

One crazy idea... can you inherit off of the list box and override the drawing functions with DX drawing calls? It might not make any sense, but the listbox already knows the data structures, etc. Again, it may be alot more trouble than it''s worth...


I was thinging about that, but I''m not sure how feasible it is. I don''t think MFC does the painting; it''s delegated back to the built-in support of Win32 for controls.

Share this post


Link to post
Share on other sites