Jump to content
  • Advertisement
Sign in to follow this  

win32 and mfc, which one is more "Usefull"

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

When I go back to school there will be some more courses and some of them deal with win32 and others deal with mfc(This is for the game industry). I understand that mfc is suppose to be a simpler system to create windows with c++(that was the pre requisite courses I took) but is it as useful for programming in the field of games? Most online tutorials as well as websites show DX and OpenGL(windows opengl) using win32. Is one more preferred to know or more streamlined for creating windows? Thanks

Share this post


Link to post
Share on other sites
Advertisement
Of all the things you tend do in games, only windowing is really covered by MFC. So no, most developers don't go that route, as it's easy enough to set up a window with Win32 and use that. Input and sound are not covered by MFC, so you're forced to use Win32 directly or some library to handle those.

Keep in mind that MFC is just a wrapper for parts of Win32.

Share this post


Link to post
Share on other sites
As a windows programming guru I tell you:
FORGET MFC, you don't need it in game programming, and you don't need it to get a normal programming job.
win32 is the juice you need to become a master of windows programming.
MFC is just a library that calls win32 inside its C++ classes.
But good things come with pain, and win32 is hard to learn.
Fortunately you only need this bible:
Programming Windows, by Charles Petzold, Microsoft Press

This book will lead you from zero to intermediate windows programmer.

You will also need a copy of Visual C++ and MSDN.
You can get Visual C++ express for free. You can use MSDN online from the microsoft site, but it's better if you buy a copy to use it locally. It's much faster.

Share this post


Link to post
Share on other sites
Quote:
Original post by hiigara
As a windows programming guru I tell you:
FORGET MFC, you don't need it in game programming, and you don't need it to get a normal programming job.
win32 is the juice you need to become a master of windows programming.
MFC is just a library that calls win32 inside its C++ classes.
But good things come with pain, and win32 is hard to learn.
Fortunately you only need this bible:
Programming Windows, by Charles Petzold, Microsoft Press

This book will lead you from zero to intermediate windows programmer.

You will also need a copy of Visual C++ and MSDN.
You can get Visual C++ express for free. You can use MSDN online from the microsoft site, but it's better if you buy a copy to use it locally. It's much faster.



I am intrigued. Since then have there been any major difference in standards with win32 that may break the code( c++ 6 ---> c++ .net for example)(currently using vs 2008(dream spark).

Share this post


Link to post
Share on other sites
win32 is your best bet,

a) for the little bit of code it takes to do a game, MFC in't gonna make the code a whole lot cleaner, and


b)at some point, you're gonna run into a situation where you're gonna need some knowledge of the api itself, you might as well get it out of the way now

Share this post


Link to post
Share on other sites
Quote:

I am intrigued. Since then have there been any major difference in standards with win32 that may break the code( c++ 6 ---> c++ .net for example)(currently using vs 2008(dream spark).

Not really. They added a few changes (The ribbon in the new office, translucent windows) but since all apps that ran in 1998 need to run in 2008 nothing really changed.Look at it this way, Windows Forms sits on top of Win32.

Keep in mind the next big thing is WPF, which I think finally no longer uses Win32. (This is more for windows app development then for game stuff, stock win32 should work for a long while to come).

Anyway that is the book to use for Win32, but if people start to move over to WPF you might want to plan for that. It probably depends on how Windows 7 performs.

Share this post


Link to post
Share on other sites
Quote:
Original post by Hard Rock
Quote:

I am intrigued. Since then have there been any major difference in standards with win32 that may break the code( c++ 6 ---> c++ .net for example)(currently using vs 2008(dream spark).

Not really. They added a few changes (The ribbon in the new office, translucent windows) but since all apps that ran in 1998 need to run in 2008 nothing really changed.Look at it this way, Windows Forms sits on top of Win32.

Keep in mind the next big thing is WPF, which I think finally no longer uses Win32. (This is more for windows app development then for game stuff, stock win32 should work for a long while to come).

Anyway that is the book to use for Win32, but if people start to move over to WPF you might want to plan for that. It probably depends on how Windows 7 performs.



But if and when MS goes completely to WPF will it mean that win32 will be gone(I know technology evolves and things are added and removed)? What do you mean by the success of Windows 7(sorry I am slow and had very little sleep for the last 3 days).

Share this post


Link to post
Share on other sites
Quote:
Original post by Ra
Of all the things you tend do in games, only windowing is really covered by MFC. So no, most developers don't go that route, as it's easy enough to set up a window with Win32 and use that. Input and sound are not covered by MFC, so you're forced to use Win32 directly or some library to handle those.

Keep in mind that MFC is just a wrapper for parts of Win32.

Yeah that's main point is that like .NET MFC is a wrapper so if you want to utilize everything that is available in Windows you have to use Win32.
For example there was like 5,000 new win32 functions added for Vista and I doubt even the newest version of MFC covers a majority of them.
MFC was supposed to appeal to C++ programmers since it make use of C++ unlike raw win32 that uses just C but it never worked out besides you can just hide your win32 stuff in your own classes if you want.
If you look at the DX SDK several of the examples actually use MFC. It just depends on who wrote it.

Share this post


Link to post
Share on other sites
I see, so even though wpf is getting a lot of books and such as the new Charles Petzold Microsoft Press book, win32 api will still have a good a mount of features and use? Is the book still in production? Why was there never a 6th version??

Share this post


Link to post
Share on other sites
Quote:
Original post by bobsaget
I see, so even though wpf is getting a lot of books and such as the new Charles Petzold Microsoft Press book, win32 api will still have a good a mount of features and use? Is the book still in production? Why was there never a 6th version??

If you check out the author's website it explains why.
Basically he got fed up with programming in C and found C# so much easier as the majority of programmers do.

So he pretty much rewrote the book for C# and .NET framework using winforms first calling it Programming Microsoft Windows with C# and his latest version that uses WPF is called Applications = Code + Markup
A Guide to the Microsoft Windows Presentation Foundation

I dunno if it's still in print but you can get a copy off Amazon for like $12 and it's worth it if you are going to stick with programming especially on Windows.


Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!