Right, any good C game tutorials?

DudetheCreator
Unregistered
 
Post: #1
Does anybody know any good game turorials for C? Something really simple to start, that doesnt involve OpenGL (that's what I was told to get...).

???
Quote this message in a reply
Member
Posts: 567
Joined: 2004.07
Post: #2
this uses c for most of the tutorials, but you can use C++ later, It's not incredibly different.

Anyway, NeonHelium (otherwise known as NeHe)

It's not magic, it's Ruby.
Quote this message in a reply
Moderator
Posts: 700
Joined: 2002.04
Post: #3
If you're not using OpenGL for the graphics in these tutorials, what are you using? SDL? Allegro? (I don't know the link off-hand...) [any other libraries which I can't be bothered to list]? Otherwise your only real option for a 'game' is a text adventure...

And Nayr, for tutorials which don't involve OGL, sending somebody to NeHe is a pretty odd move Wink

Mark Bishop
--
Student and freelance OS X & iOS developer
Quote this message in a reply
Moderator
Posts: 1,560
Joined: 2003.10
Post: #4
You need to pick a graphics API. There's OpenGL, QuickDraw, Quartz, SpriteWorld, things like SDL that have their own...
  • QuickDraw is being deprecated in Tiger. Not recommended.
  • Quartz is typically too slow for real-time games, although some have managed to get it to run fast enough. uDevGames 2003 entry Garden Pests used Quartz.
  • SpriteWorld may be your best bet if you don't want to get into OpenGL. http://www.spriteworld.org/
  • OpenGL is, in general, the best choice. If you can afford a copy of the Red book, I'd highly recommend getting it.

- Alex Diener
Quote this message in a reply
Member
Posts: 567
Joined: 2004.07
Post: #5
sealfin Wrote:Allegro? (I don't know the link off-hand...)

That's for java, not C. Wink

It's not magic, it's Ruby.
Quote this message in a reply
Moderator
Posts: 608
Joined: 2002.04
Post: #6
Nayr Wrote:That's for java, not C. Wink
There is most certainly a C/C++ version. I believe Steven used/uses it.

http://www.talula.demon.co.uk/allegro/
Quote this message in a reply
DudetheCreator
Unregistered
 
Post: #7
Ok, thx

I got spriteworld... I'll try experimenting with that...

DirectX is windows only thing?
Quote this message in a reply
DudetheCreator
Unregistered
 
Post: #8
Right, i got the OpenGl CFM SDK thing. And I have started out with the NeHe tutorials, but there is one thing I don't get:

This is going to sound really silly, and make me look really lazy, cuz it's probably the one thing that i havn't bothered to figure out which has stopped me from really learning anything.

How do incorporate the OpenGL SDK into an application I make? Do I have to? Do Macs already have it? Do I build my applications and just stick the SDK files in my apps reaources? Basically...When Xcode asks me what to do at the start, WHAT THE HECK DO I DO?

(* not necessary to answer

And how come the C++ that works on the windows computers at the course i took is different than in xcode ( ie: have to std:: before cout<<"blahblah"endl; )? And how come a terminal tool written in c that works on my computer, doesn't work on the Macs at my school?

*)

Thank you so much!
Quote this message in a reply
Moderator
Posts: 608
Joined: 2002.04
Post: #9
DudetheCreator Wrote:How do incorporate the OpenGL SDK into an application I make? Do I have to? Do Macs already have it? Do I build my applications and just stick the SDK files in my apps reaources? Basically...When Xcode asks me what to do at the start, WHAT THE HECK DO I DO?
If you're using Xcode, you don't need to download any extra OpenGL SDK. Make whatever type of project you want (i.e., Carbon, Cocoa, etc) and then you'll need to add the OpenGL.framework framework to your project. OpenGL.framework can be found in /System/Library/Frameworks.

Quote:And how come the C++ that works on the windows computers at the course i took is different than in xcode ( ie: have to std:: before cout<<"blahblah"endl; )?
Because the Xcode compiler is correct. Wink Perhaps whatever compiler you used at school assumes the std namespace. To avoid having to put std:: in front, put the line:
Code:
using namespace std;
Somewhere near the top of your file.

Quote:And how come a terminal tool written in c that works on my computer, doesn't work on the Macs at my school?
A little more info would be needed to solve that one Wink
Quote this message in a reply
Moderator
Posts: 771
Joined: 2003.04
Post: #10
Nayr Wrote:That's for java, not C. Wink

Blink Where did you read that? Blink

Allegro is a C/C++ library like say, SDL.

This is a good starting point: http://www.allegro.cc/
And this is the official site: http://alleg.sourceforge.net/
Quote this message in a reply
Member
Posts: 749
Joined: 2003.01
Post: #11
uh, dont bother with allegro, its dying-dead, no real updates in ages

©h€ck øut µy stuƒƒ åt ragdollsoft.com
New game in development Rubber Ninjas - Mac Games Downloads
Quote this message in a reply
Member
Posts: 116
Joined: 2002.04
Post: #12
DudetheCreator Wrote:And how come the C++ that works on the windows computers at the course i took is different than in xcode ( ie: have to std:: before cout<<"blahblah"endl; )?

Becuase most PC compilers will let almost anything pass as valid code - Mac compilers are much better about adhering to the standards.


Quote: And how come a terminal tool written in c that works on my computer, doesn't work on the Macs at my school?

If you wrote in in C with XCode, chances are your did a development build, which uses Zero-link and therefore it will work only on your computer.

To resolve it, change the build style to Deployment, then do a "Clean All" and rebuild.

The other possibility is that you're building on a 10.3 system and the system at schools is a 10.2 (or earlier) system. If that's the case, let us know and we can tell you have to resolve that.

Wade
Quote this message in a reply
Member
Posts: 201
Joined: 2002.06
Post: #13
wadesworld Wrote:Becuase most PC compilers will let almost anything pass as valid code - Mac compilers are much better about adhering to the standards.

Actually, it is GCC, a cross-platform compiler, that is adhering to the standards. I am guessing you are using something other than GCC on the PCs. Maybe Intel's compiler or something? I don't know what compiler doesn't enforce namespaces.
Quote this message in a reply
Member
Posts: 129
Joined: 2005.02
Post: #14
I've always liked http://www.gamedev.net
Quote this message in a reply
Post Reply