forums

TNT Basic Forums > Beyond Basic
I'm on C!
< Last Thread     Next Thread >
Author
Thread        Post A Reply

05-31-2004 21:13

Posted by:
matteo

Location:
Venice, ITALY!

Click Here to Email matteo   Find more posts by matteo

Hey guys! Right now, since I only have a PC here where I study, I had to start learning C... with the GNU compiler.

I'm using the allegro library, that is a library for games that is available also for X with XCode, although not much used on the mac...

So I finally made something move! Right now I'm doing a particle simulation engine, i.e. I'm moving a lot of circles, making them bump, and applying gravity between them...

So what about C... It's considered a bad thing to use globals! I mean in TNT you had no choice but using them a lot, In C you can avoid it... so you must use functions and pointers... and they want you to use a bit of object orientation with structs... Oh well maybe you didn't understand much but the conclusion is that you write more "solid" programs (if you're good), but you put at least twice the time .

Performance is good but it's not so dramatically different from TNT with sprites (say it's about 2 times faster), but to draw circles and pixels it's about 100 times faster... So I'm doing a lot of vector stuff now ;-)

BTW a lot of the C people have never released games after 3 years, so they suck a bit, because they're so careful about coding style that they forget to write the game ;-)

Cheers!

Matteo

05-31-2004 21:32

Posted by:
eekaydee

Location:
CA, USA

Click Here to Email eekaydee   Find more posts by eekaydee

Good point. Who cares if the style is terrible, it's better to have a messy game than a clean nothing.

06-02-2004 22:43

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

Good! I'm doing Java but the point is it's the same speed as TNT but what interests me is that it's PC compatible... where did you find your tutorials? I found many C tutorials but they were not suitable for my mac...

06-03-2004 00:50

Posted by:
puffin

Click Here to Email puffin   Find more posts by puffin

two good c books are:
c: step by step
the c programming language

the first is best for learning, the second a good reference to the language and standard library.

06-03-2004 01:59

Posted by:
Wil Hostman

Find more posts by Wil Hostman

C Variables

One of the reasons not to use globals in C is that you can
a) retain a variable between executions of a code snippet by proper declaration
b) pass variable pointers, so you can work any variable you want through the same subroutine
c) have dynamic recovery* of unretained variables' memory

* in theory, at least. In truth, it works on palms, sometimes works in unix/linux, and occasionally works in windows

06-03-2004 16:10

Posted by:
charlie

Location:
norfolk, england

Click Here to Email charlie   Find more posts by charlie

if you want to learn no frills c++ on the mac you can use the built in c++ compiler that is included in the unix command line application Terminal.

youll need a good book, im currently using teach yourself c++ in 24hrs
from sams publishing, which was recomended to me by someone.

every thing is present in unix for learning c++, and also because its text based makes it portable to other systems.

cheers
charlie

09-21-2004 11:10

Posted by:
Fischgurkensenf

Location:
Bern, Switzerland

Click Here to Email Fischgurkensenf   Find more posts by Fischgurkensenf

HELP!!!

I've got a big problem and I think this is the right thread to ask:

1.How do I install/use allegro or SDL??? I'm not able to do this... :-|

2. How can I test the examples that are included with the allegro/SDL files?

I'm using Xcode 1.5 on OS X 10.3.5.

Please help me, thank you!

-IBD

09-21-2004 21:05

Posted by:
matteo

Location:
Venice, ITALY!

Click Here to Email matteo   Find more posts by matteo

really, I guess that's the hardest part of all. alas, I dont have a clue: after hours of tries, I found a clicky installer (for PC), I guess you should do something such as "compile the library", whatever that means...

02-26-2006 20:31

Posted by:
MickMad

Location:
San Giovanni Rotondo, Italy

Click Here to Email MickMad   Find more posts by MickMad

C programming...yummy!

Hi all!
I'm new on TNT Basic but I already hv some programming background..in fact, I used to program in REALbaasic (see MickMad Soft) and I tried to do simple games, with no results at all.Then I tried to learn C and C++, a language that I always liked more than Basic, since it's more powerful, but when I wanted to compile with Terminal, I saw that there's no compiler!
I installed Gcc 3.3 from Mac OS X DVD, reboot, bur even after hundreds of MB of installs, I can't compile with the terminal...why?
I tried to build Gcc after downloading it from its site, but it won't build....please help me!

02-26-2006 23:06

Posted by:
allnodcoms

Location:
hertfordshire (England)

Click Here to Email allnodcoms   Find more posts by allnodcoms

XCode?

You have the OSX DVD? Just install XCode. If it's a pre-Tiger version it's Project Builder, but either way it's a pretty nice piece of kit. You can also sign up at ADC (Apple Developer Connection) for free, and download the appropriate developer tools for your version of the OS.
Using one of the Apple IDEs has the advantage of all the documentation for the platform specific APIs, it provides easy starting point for projects, and there are many code related features in the editors that you can't get with apps like TextEdit. The best IDE for the Mac was CodeWarrior, but it's no longer supporting the Apple platform, but IDEs are definitely the way to go (IMHO, and I've been writing straight ANSI C for nearly twenty years now).

Danny (nods)

02-27-2006 16:35

Posted by:
MickMad

Location:
San Giovanni Rotondo, Italy

Click Here to Email MickMad   Find more posts by MickMad

Thanks, but...

Well, I actually already tried that way, but I don't hv any space left on the HD ( approx 300 megs)...I made some room to install Xcode Tools and Gcc and Mac OS X and BSD SDKs, the essential to begin programming with Xcode, but It just wont work... so I uninstalled Xcode but,hey...where are my 700 megs???I tried to install only Gcc, but it wont find anything on the terminal, uninstall it and my Mac stole my megs again!!!! It's impossible that if i install 700 megs of stuff and completely uninstall that stuff I lose more than a half of my megs!!!
PS i'm on a Blueberry iMac DV, class 1999, 400 Mhz PPC G3, 320 MB SDRAM, with 40 GB of HD and only 400 MB left...:P

02-28-2006 22:53

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

err.. how did you "uninstall"? if you just dragged the developer fodler to trash it won't do. A lot of stuff from the developper packages go into System folder, into invisble folder /usr, and probably other places i don't know about. Basically unless you have an uninstaller or have a precise knowleadge of every file that has been installed, you can't uninstall it.

Anyway as fart as i know these days working on a computer that hasn't got at least a few gigs of free hard disk space is not a good think.

03-04-2006 17:15

Posted by:
MickMad

Location:
San Giovanni Rotondo, Italy

Click Here to Email MickMad   Find more posts by MickMad

ok...

well I opened Terminal andafter i dragged the uninstall-devtools.pl file to my root directory I wrote "sudo /uninstall-devtools.pl" and that's it...

All times are GMT        Post A Reply

Forum Jump:
< Last Thread     Next Thread >

< Contact Us - TNT Basic >

Powered by: vBulletin Lite Version 1.0.1 Lite
Copyright © Jelsoft Enterprises Limited 2000.