Archived

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

win32 or mfc?

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

if i want to start to learn game programming in windows. which api should i need to learn, win32 or mfc? what are the differences between these two? thanks..........s..........s.........s

Share this post


Link to post
Share on other sites
think of MFC as tons of classes written for you to encapsulate WIN 32 API function, to make it easier

if you want to be a win game programmer, no doubt, you need WIN 32 API

MFC is slower, harder to get started with
hmm you can ofcourse write a game with MFC but that sux big time!

Arkon
http://qsoft.cjb.net

Share this post


Link to post
Share on other sites
MFC is designed for use with utility programs. Things were you have one or more documents, and the user saves, loads, and creates them. All of that wrapping will just get in your way and cause a performance loss in the end.

The Win32 API is what you''re going to want to use for games. That doesn''t rule out using MFC for a Map Editor or something though.

"Finger to spiritual emptiness underlying everything." -- How a C manual referred to a "pointer to void." --Things People Said
Resist Windows XP''s Invasive Production Activation Technology!
http://druidgames.cjb.net/

Share this post


Link to post
Share on other sites
I use MFC for data editing and handling. I''ve mucked around with having to create from scratch many interfaces in DOS for lists and stuff that I really appreciated MFC speed. If you have a lot of data to manipulate, like in a RPG, then MFC is a useful tool/ And if you want a 2nd party to do some data editing.

In MFC learn how to do lists, trees, amd data entry screens. I''ve got a character editor that I''ve done in MFC.

ZoomBoy
Developing a iso-tile 2D RPG with skills, weapons, and adventure. See my old Hex-Tile RPG GAME, character editor, diary, 3D Art resources at Check out my web-site

Share this post


Link to post
Share on other sites
I was recently in the same boat. After messing on with MFC I decided to revert to the Win32 api.

But... I couldn''t find any decent reference material. Not on the net, nor in my local book shops. Then I happened to take a closer look at a book I had bought months ago but never really examined.

Tricks of the Windows Game Programming Gurus (Andre Lamothe).

Turns out, the material I need was right under my nose. It''s very good for Game related Win32 information. I''m using it this very second, and can''t recommend it highly enough.

Eight

Share this post


Link to post
Share on other sites
Perhaps my nick may suggests a slight bias, but that''s just an illusion.

MFC is a wrapper for the Win32 API, making some things easier and giving you more of a "foundation" to work on. But to use MFC, you need an understanding of the Win32 API. So, by necessity (really), you need to learn the Win32 API first. You can learn them both in parallel, but for a beginner that might be more confusing.

As for games development, there is really nothing really wrong with MFC other than the (approx) 1 MB MFC library DLL that will be required on top of whatever code you write. Also, for games, a lot of MFC''s functionality will probably go unused. The major benefit of using MFC, the way I see it, are the message maps & routing. Also, it helps you structure your program in a more object-oriented way; vanilla Win32 has a tendancy to lead to rather messy spaghetti code if you''re not careful.

On a side note, there are some other "Class Libraries" out there that you may want to consider. Once you have a basic understanding of the Win32 API and how to write programs, you can check out wxWindows and WTL (Windows Template Library) to see what they offer you & determine if they will make things easier for you.

Hope that helps!
// CHRIS

Share this post


Link to post
Share on other sites
I havent read that, but I have read "Programming Windows" by Charles Petzold. And its awesome for Win32 API.

Which, as previously stated, is your foundation before going onto MFC.

-Mezz

Share this post


Link to post
Share on other sites
If you want to write a spreadsheet or business app, use MFC. If you want to write a game (and I asume you do), use straight Win32.

Charles Petzold will get you up and running. Its what I used to learn Windows 3.0 (okay, I''ll admit it, I''m an old fart).



D.V.

Share this post


Link to post
Share on other sites
i try to found the programming windows in book store today, but i can not find the english, i can only found the taiwan chinese (i am a chinese and living in HK), this is really suck, i dont want to get the chinese one cause programming book translated from english to chinese like a mess, it shows in HK few people know low level programming, no one interested to buy it, and the book store need me to wait for shipping from US............ZZZZZZZZZ

Share this post


Link to post
Share on other sites
There is little performance penalty for using MFC just to get a window on the screen. If you start using the CArray, CFile or the like it''s a different story...
Run your game in a seperate thread (which is a good idea anyway).
You .exe will be ~200k bigger in release mode (if you statically link the MFC libraries).

That said, I think the WTL is the way to go. It''s brand new and damn cool. As powerful as MFC with no code bloat - templates rock.


Magmai Kai Holmlor
- The disgruntled & disillusioned

Share this post


Link to post
Share on other sites
If you''re new to Windows programming, MFC is easier to use. But, if you want a game that is smaller and faster, use Win32. MFC is good if you want your game''s interface to look like a traditional Windows program. If, however, you are planning to write your own GUI, use Win32. Overall, I would definitely say go with Win32.

Share this post


Link to post
Share on other sites