Which technology(MFC/Win32) is more sutaible for directx application?
Hi i am developing game level editor.Currently I am using win32 with directX.But with win32 I cant achieve fully object oriented implementation.So I am thinking to develop it in MFC. Will it be better option than win32? Which technology(MFC/Win32) 开发者_Python百科is widely used in industry? Also which technology is most suitable for my project?
MFC is quite widely used, but it's an archaic framework that is nowhere close to Codegear VCL, wxWidgets or TrollTech QT in terms of sophistication.
I would never recommend MFC to anyone... If you do not wish to use anything else, WTL is a nice light wrapper around the Win32 API thats much better.
MFC is a dated technology that I believe is not being actively developed by Microsoft anymore. I would recommend staying away from that framework on any new project.
I'm a bit surprised by the amount of dislike towards MFC - yes, it is a bit clunky and it is an "old-style" framework, however it is still supported and expanded by Microsoft (for example in Visual Studio 2008 SP1 MFC was the first of all Microsoft toolkits that got Office 2007-like ribbon).
I'd probably go with MFC. Although MFC itself does nothing to support DirectX graphics, a few people have written various classes to create an MFC view that uses DirectX for the display. While none of these is particularly new, little seems to have changed -- I haven't tested all of them, but (for example) the first link (to CodeProject) built fine in 32-bits with VS 2008, and needed only one trivial change to work as 64-bit code as well (change GetClassLong to GetClassLongPtr, and GCL_CURSOR to GCLP_CURSOR).
Another possibility would be to consider something like Ogre3D, which at least one person has successfully integrated with MFC.
MFC sounds sensible to me, it's a wrapper around the WIN32 API to provide a more object oriented interface, so sounds like what you need. There are of course other alternative frameworks that people have mentioned, but to be honest I'd go with whichever one you are familar with, I doubt that an editor has highly sophisticated UI requirements anyway other than providing menus, buttons and dialog boxes / property editors.
As an alternative have you considered C#? That seems quite a common way to write game level editors these days, and you can still call your C++ game core from it.
Win32 does nothing to stop you from being object-oriented. No matter which object oriented framework you choose, it will eventually call the standard Win32 API. At any rate, MFC fits well for game editors because of the MVC design.
精彩评论