Win32 Proggraming

Started by
4 comments, last by Blah! 24 years ago
How much of the Win32 API will I have to actually learn in order to make games for it? Thanks in advance !
"End Communication!", Kang from Rigel-4
Advertisement
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
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
______________Martin EstevaolpSoftware
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.




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
Thanks for your answers

I plan on only making games with DX/OpenGL.
So now I won''t have to worry about completly learning a new API!
"End Communication!", Kang from Rigel-4

This topic is closed to new replies.

Advertisement