ddraw.h basics.

7 views
Skip to first unread message

JoeC

unread,
Jan 16, 2006, 10:22:28 PM1/16/06
to C++ Game Programming
I have been learning some windows programming and have done some
intersting little programs. I have been getting into the basics of
directX and it is realy confusing. I realize that DirectX is not the
best graphic interface out there but I am trying to learn how to use
it. I have learning game programs in 24 hours and it has been very
helpful in what I have been doing. I have the guru game programming
but the examples are tough to understand and I can get a program to
work unless I cut and paste the programs from the disk. I know they do
a good job on showing features it is tough to follow the code examples
of the very basics.

Andreas Tropschug

unread,
Jan 17, 2006, 2:22:09 AM1/17/06
to C-Game-Pr...@googlegroups.com
If you want a hint on how to go through difficult code examples:
recreate them by hand, but not line by line.
Whenever you do a code example line by line, from the beginning to end,
and if it is not "Hello world anymore" you lose the thread.
1.
First create the basic structure of it, e.g. all the functions/methods only as
function heads with a return statement if necessary.
So that it compiles.
2.
Write in or copy and paste everything you really already understand.
Check that it compiles.

Now that you got rid of everything that only distracted you from the
real problems, get another cup o' coffee, and dive in:
3.
Then add the difficult part, Object by Object or whatever seems
appropriate. Then add anything that this particular object needs to
work. Not more.
Never add anything that is a complete mystery to you,
always look them up in the msdn or google.
Keep it compiling.

If at all possible, run it during all three steps as often as possible
or sensible,
(usually no problem but directx can be a bit of a bugger there)

This way your brain should have understood the underlying structure,
what is essential for the prog to run, and you know how the
difficult part was made. Closing the last gaps should not
be problem now.

On ddraw:
there are easy examples in the msdn and the sdk.


2006/1/17, JoeC <enk...@yahoo.com>:

JoeC

unread,
Jan 17, 2006, 11:50:51 AM1/17/06
to C++ Game Programming
Thanks much, that is pretty much what I am doing and how I go about
learning win32 and dirX programming.

So far I understand directXcreate, SetCooperativeLevel, and SetDisplay.
I am stilll wresting with VC++ because I don't know how to access the
dirX libs from DevC++. Still I am wresting with ways to simplify my
code and make it easier to organize and work or sections as I
understand them.

I will try to use on-linse sources but usally I don't find them very
helpful.

JoeC

unread,
Jan 17, 2006, 12:09:52 PM1/17/06
to C++ Game Programming
Just a question

When I write this code I get my windows screen not a direct x one is
there more code I have to add? My program dosn't show any more.

int start(void *parms = NULL, int num = 0){

DirectDrawCreateEx(NULL, (void**) &lpdd, IID_IDirectDraw7, NULL);
if(FAILED(lpdd->SetCooperativeLevel(hwnd, DDSCL_FULLSCREEN |
DDSCL_EXCLUSIVE)));

lpdd->SetDisplayMode(ScrWd, ScrLn, 16,0,0);

return 1;

}

Andreas Tropschug

unread,
Jan 17, 2006, 3:06:46 PM1/17/06
to C-Game-Pr...@googlegroups.com
Sorry, but DirectX is a blind spot of mine.
I coded some direct3d thingy for a project,
but inside a standing framework, so i don't know much
about what makes DirectX tick.
Sry.

Andreas

2006/1/17, JoeC <enk...@yahoo.com>:

Troop

unread,
Jan 17, 2006, 3:18:13 PM1/17/06
to C++ Game Programming
Sry, I don't know much about directX.

I only know a thing or two about opengl.

Andreas

JoeC

unread,
Jan 17, 2006, 4:36:25 PM1/17/06
to C++ Game Programming
I hear openGL is easier to use but I have books that show me how to use
DirectX and somthing on paper is much easier to learn for me. I like
the challenge, I doublt that I will ever create realy high performance
games. My intrest is with programming in general and C++. I would
like to get a programming job if I can learn enough. Just playing with
graphics and making games is more intersting for me and keeps me
learning.

JoeC

unread,
Jan 17, 2006, 4:40:49 PM1/17/06
to C++ Game Programming
No problem, I hope I can learn enough to do somthing useful. I have
been doing things with win32 programming I was seeing what I could do
with directX. It is a challenge.

Reply all
Reply to author
Forward
0 new messages