From learning Java to directx...

Started by
3 comments, last by Jazz 24 years ago
Having been taught Java in college and having a very strong grip on programming principles, I decided to learn C++ myself, with a view to proceeding onto game programming. After learning the C++ syntax etc, DirectX seems a good start so I figured just find good tutorials on what the syntax is like, and I can figure out the rest. Unfortunately, things didn''t go as planned (fairly obvious, I know). When I started digging around in DirectX I realised there was more I needed to learn before I could start in on this. However, I don''t even know where to start looking. What do I need to know in order to start learning directX? It seems to me that I just need some Windows programming, but I might be missing something important. Can anyone out there point me in the right direction? I''d really appreciate it. Thanks, keith
Advertisement
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 application. Then you need to know how to create the DirectX components, but if you skip the enumeration at the start it isn''t that hard to get something working. To create a Direct3D application you can take a shortcut through D3DXInitialize() and D3DXCreateContext().

Unfortunately there aren''t that many tutorials on DirectX so your best bet is to look at the samples in the SDK to learn how to.

Java is not that different from C++, except you have to deal with pointers in directx. Start reading the direct draw docs in the sdk, all of them, then do the ddraw tutorials. Then start making a simple 2d game. Don''t worry about the overlays or other advanced stuff, just concentrate on making bitmaps for your animations and take a look at Blt() and BltFast() functions, they''re essential to your game. Also, you can use ddutil.cpp code written by MS for ddraw to help loading of bitmaps and setting of color keys. The best thing is to make bitmaps yourself because there are copyright restrictions on many bitmaps floating around the web or those inside applications. Check out company called ONEMILE for decent graphics, I''m using Corel Draw 3.0 for some of my graphics and ONEMILE is very cool about letting you include/alter their art into your game. Of course the best is to hire artists and musicians in the first place but most people do this as a hobby with hopes someday to make money off of their cool game. Good luck!

Jerry
Jazz,

You could try all that stuff, but I get the feeling you already have.

I highly recommend(if you don''t mind shelling out the money) one of Andre LaMothe''s Books: Windows Game Programming for Dummies or (preferably)Tricks of the Windows Game Programming Gurus. Either one of these books will get you going in no time.

Kaellaar
Thanks guys, I figured it was just the Windows stuff I was missing, but I wasn''t sure. I guessed the DirectX sample SDK was a good place to start, but when you don''t know what a HWND or a HRESULT is it''s kind of hard to make any headway!

Kaellaar, I think I''ll invest in Tricks of the Windows Game Programming Gurus, I was considering it but I wasn''t sure if it would help me at this stage.

cheers,
Keith

This topic is closed to new replies.

Advertisement