Archived

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

Blah!

Win32 Proggraming

Recommended Posts

To make basic games you only really need to the learn how to set up a window, and handle messages that are passed to your window. Once you can do that, you can just use DirectX for all your graphics needs (or OpenGL). So basically, once you get the window handling code out of the way, you are ready to start programming your game.

PreManDrake

Share this post


Link to post
Share on other sites
You''ll have to know only a very little bit of the win32 api when it comes to game programming. Frankly, all you need to know is how to create a window class, display the window, and how to handle all the calls to your basic window, etc. ...the basic "window skeleton."

Wait...hold on. Are you going to write your games in DirectX, or just the win32 api. Each is a totally different story.

Martin

Share this post


Link to post
Share on other sites
You need a little knowledge on how to create and manage a window. Here are some of the functions you''ll need:

RegisterClass()
CreateWindow() or CreateWindowEx()
WindowProcedure() // Defined by you
PostQuitMessage()
DefWindowProc()
TranslateMessage()
DispatchMessage()
GetMessage()
PeekMessage()

Some window messages that are good to know:

WM_CREATE
WM_SIZE
WM_CLOSE
WM_DESTROY
WM_ACTIVATE
WM_ACTIVATEAPP
WM_SYSCOMMAND

Much more than that you don''t need to know about the Win32 API to create a DirectX (or OpenGL) game. But if you want to make the game in Win32 only (as Martin mentioned) you''ll need to learn about GDI and perhaps even menus etc.




Share this post


Link to post
Share on other sites
Hi,

It is also helpful to know about the Win32 memory management system and its file access API (Memory mapped files, reserve\commit memory...).

(Be careful with relying on virtual memory too much though as Win32''s paging system (different on each Win32 OS) may not be optimized for a game type situation).

If you plan to stream stuff from disk it is definitely better to use the Win32 API for example. You might also want to use the Win32 mem management calls as well to better control you memory management on the system. I package my memory manager up in its own class so that my code is still relatively easy to port - This also allows you to control pointer alignment easier as well(important for SIMD instructions for example).

But if this is your first time game programming on any platform forget about all this stuff. You''ll probably have other things to worry about first!

MikeW
Sha-Ku-Do Industries

Share this post


Link to post
Share on other sites