Skip to main content
gamedev.net
🔒 Locked

Game Programming for Dummies code problem

Started by Lennart Aug 14, 2001 at 1:35 PM 9 replies 1.2k views
Original Post
Lennart
Lennart
Hi. I have the book "Game Programming For Dummies" and the code on the CD just doesn't work. I have Directx8 and VC++ 6.0 and I think that's the problem. I can't compile a single sourcefile on the CD (almost). I really want to learn game programming and this book is very good except the sourcefiles. I was woundering if anyone of you have this book and the CD and have gotten the code to work with VC++ 6.0 and Directx8. If you have, could you please post the Chapter16 catalogue (StarFerret Deluxe) or just some other code on the that you have gotten to work modified for VC++ 6 and Directx8 so I can start programming sometime. I get errors on DirectInput and some other stuff. I've been trying to get this to work for a long time but I haven't been able to fix it. Please help. /Lennart Edited by - Lennart on August 14, 2001 2:48:54 PM
acraig
acraig
You have to let us know what sort of errors you are having. It maybe a simple compiler setting or something that you are missing. What exactly happens when you try and compile the code? What sort of errors does the compiler respond with?
Lennart
Lennart
Ok, here are some errors:

error C2065: ''DSBCAPS_CTRLDEFAULT'' : undeclared identifier
D:\test\Gpdumb2.cpp(1136) : error C2065: ''DirectInputCreate'' : undeclared identifier
D:\test\Gpdumb2.cpp(1163) : error C2065: ''DIDEVTYPE_JOYSTICK'' : undeclared identifier


Now I have tried to change DirectInputCreate to DirectInput8Create (Directx8) but then it says that the function does not take 4 parameters. The function looks like this: if (DirectInputCreate(main_instance,DIRECTINPUT_VERSION,&lpdi,NULL)!=DI_OK)

I don''t know about the other error because I''m just trying to compile the code from the book. If you have the book maybe you could tell me how to fix all this.

Thanks.
Lennart
Lennart
I discovered that I had some .cpp files in the project that should'nt be there and the only error that comes up now is:
error C2065: 'DSBCAPS_CTRLDEFAULT' : undeclared identifier

It looks like DirectInput is the problem.
Maybe if someone who would like to help me could add me on ICQ and I can send the code or something.

My ICQ is: 5497311

Edited by - Lennart on August 14, 2001 4:34:11 PM
Dobbs
Dobbs
To clarify, is the book "Windows Game Programming for Dummies" by Andre LaMothe? Then the code was written for DirectX 5 I think. DirectX IS backwards compatible, but I''ve seen cases where you have to use some special defines in order to compile code written for old versions. Something like #define DIRECTINPUT_VERSION 0x00007. I can''t remember exactly, sorry.
Lennart
Lennart
Yeah it''s Windows Game Programming for Dummies by Andre LaMonthe.
Heh sorry, I forgot the "Windows" part... my fault.
I added your line to my code and something did happen! I got some new errors! :D
Now I get these errors:

error C2146: syntax error : missing '';'' before identifier ''lpdi''
d:\test\gpdumb2.h(117) : fatal error C1004: unexpected end of file found

All I did was adding the #define DIRECTINPUT_VERSION 0x00007

Thanks for helping though.
Any other sugestions?
Lennart
Lennart
Thanks alot for helping!

I played around with it for a while but I couldn't get to to work, it's wrong with me, not with your code :D. I'm not sure how to replace the existing code with yours though.
Can we talk over ICQ and I can send you the code and you can have a look at it?

Thanks

ICQ UIN: 5497311

Edited by - Lennart on August 14, 2001 7:31:58 PM
Lennart
Lennart
Hi.

Yeah that would be great...

my email is: penzo@chello.se

just send me a mail and I'll mail you the code and then we can discuss it

I live in sweden so I have to go to bed now but if you send a mail now I'll reply to you when I wake up

Thanks alot!



Edited by - Lennart on August 14, 2001 8:10:35 PM

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.