Advertisement

Help! Where can I find info on game-programming in C, NOT C++ ?

Started by January 15, 2002 01:52 PM
5 comments, last by Markie 22 years, 9 months ago
Hi I''m a newbie. I want to learn game programming from the ground up, meaning I would like to be able to create a game in pure C before I venture into C++. But help! There seem to be NO books, tutorials or other media available at all about creating games in pure C!!!!!! Is there a good reason for this? Are perhaps all directX functions only accessible with C++? I have bought and read more than one book on C, but they''re all lame! They all stop at pointers, structures etc. and especially at displaying boring text in a DOS-screen (working with VSC++ 6)! No color, no movement, no sound, no sprites or anything!!! :-((( How are these things created in C and where can I learn more. There''s tons of game-stuff for C++, even in the tutorials on this site, but it seems impossible to create a game with pure C... Yet MAME, not a game, but an emulator, supposedly is coded in pure C, so how is it done? Heeeelllp!!! Markie
quote: Original post by Markie
I want to learn game programming from the ground up, meaning I would like to be able to create a game in pure C before I venture into C++.

  1. Learning C before C++ is not necessary.

  2. Creating applications in C before C++ isn't, either.

If your objective is to develop applications in C++, get right to it.

quote: But help! There seem to be NO books, tutorials or other media available at all about creating games in pure C!!!!!!

Teach Yourself Game Programming in 21 Days By Andre LaMothe.
Tricks of the Windows Game Programming Gurus by Andre LaMothe (with a light sprinkling of C++).

quote: Are perhaps all directX functions only accessible with C++?

No. Read the SDK documentation; you'll find tutorials on accessing COM/DirectX objects in C.

quote: I have bought and read more than one book on C, but they're all lame!
They all stop at pointers, structures etc. and especially at displaying boring text in a DOS-screen (working with VSC++ 6)!
No color, no movement, no sound, no sprites or anything!!!

That is because color, movement, sound, sprites and "anything" are not a part of the C (or C++) programming languages. What you need to do is learn your language fairly well, learn the principles of what you intend to accomplish (graphics programming, input, sound, etc) and then implement them using your acquired knowledge.

[Edit:] Unpaired list tag.

[ GDNet Start Here | GDNet FAQ | MS RTFM | STL | Google ]
Thanks to Kylotan for the idea!

Edited by - Oluseyi on January 15, 2002 3:25:03 PM
Advertisement
Hi Oluseyi

Thanx for your reply.
I actually do plan an being able to create games in pure C.
What''s the SDK, and what''s its documentation? Where can I find it?
About the books:
I have La Mothe''s "Tricks of the Windows Game Programming Gurus" in storage (in the attic), but it states, that it uses C and C++ and is not for beginners, so I was hoping for an easier source which is limited to pure C.

The other book of LaMothe which you mentioned does not seem to exist... I could only find a book:
SAMS "Teach Yourself Game Programming with Visual Basic in 21 Days", by Clyton Walnum, ISBN 067231987X.

The only other book of LaMothe which I found was "Windows Game Programming for Dummies"...

Please confirm if you didn''t mix this up, and if not, please name the pulisher and ISBN of that source on pure C Game Programming.

Thanx a lot,
Markie
Hi Markie

I am also in the same dilema you are in. I want to learn how to write games in C before venturing to C++.

I understand why most of the games out there were created using C++. However i thought whatever can be created in C++ can also be created in C and vice versa.
I don''t think Oluseyi mixed things up, but I believe one of the books he mentioned is quite old and is perhaps out of print (unsure).

OK, if you''re into pure C creation and (if what you say is true) have only learnt stuff up to pointers/structures then I recommend you find a decent book that covers a lot more.
My personal preference in this area would be "Teach Yourself C" by Herbert Schildt.

The DirectX SDK comes with it''s documentation attached - the SDK is a Software Development Kit, it contains all the files / code you need to use all the components of DirectX. You can get it from Microsoft on the web, I believe the total package is around 160MB of download.

You''ll see in the documentation (a large help file) that accessing DirectX via C is a matter of virtual tables and pointers. It''s a little messier than the C++ variety, but if thats what you want then you''ll have to live with it.

Once you''ve got that down, you might take a look at "Tricks..." even though it contains moderate C++, there is still a great deal of C in it.

Well, if you come through all that you should know a fair deal of stuff - if you want to take a look at some games written in C I suppose you could download the Quake 1/2 source code. It''s quite heavy going though, so be prepared.

-Mezz
quote: Original post by Mezz
I don''t think Oluseyi mixed things up, but I believe one of the books he mentioned is quite old and is perhaps out of print (unsure).

You''re perfectly right. The Teach Yourself Game Programming... title is the precursor to Tricks (even the examples were rehashed, which is why I never actually _read_ Tricks ) and is out of print. But the Tricks... book; it covers the same material - and a lot more.

Of course, you could possibly find a used copy of the older book.

Microsoft DirectX website

[ GDNet Start Here | GDNet FAQ | MS RTFM | STL | Google ]
Thanks to Kylotan for the idea!
Advertisement
Hi Mezz, hi Oluseyi

Thanx a lot guys! Great help!
Thanx to Mezz for that suggestion of Teach Yourself C form Herbert Schildt - I didn''t know he wrote such a book... I''l probably get that one... :-)
Thanx a lot also about your explanation of the SDK-stuff (pointers and tables accessible messily in C...). Now I''m getting an idea of what this might be about... I''ll have to look into the SDK documentation next to find out more. Thanx! :-)

I''ll leave my little newbie-fingers off of full-blown 3D-appllications -err games such as Quake for a little while... :-)
What''t I''m into right now is creating a simple 2D-arcade-style oldies-but-goodies type of game... A jumping dot with sound for instance... :-))))

Cheers,
Markie

This topic is closed to new replies.

Advertisement