Skip to main content
gamedev.net
🔒 Locked

Xcode?

Started by mutton Dec 24, 2008 at 2:18 PM 19 replies 3.3k views
Original Post
mutton
mutton
Hello, My computer running Vista has crapped out on me so I can't use it another windows computer until a couple months. The only thing I have in my house is a macbook. I have had a craving to program and I need to satisfy that craving but I only have a mac so I can't run Microsoft compilers. I'm just wondering if XCode is worth using as a compiler. I've heard some mixed feeling about this compiler. My other option is to duel boot windows and mac but that takes up a lot of space that I might not have on this old macbook. I'm just wondering if anyone has any suggestions and to let me know if there is anything wrong with Xcode etc. Also another little question, I can't use directx and win32 programming correct? So would it be better to duel boot with windows so I can make games or is Xcode good for making non-Itouch games. Thanks for the Help! ~Mutton
pointer
pointer
Xcode is only an IDE and a set of tools. It uses the gnu compiler - gcc, so there's nothing wrong with the compiler.
The IDE in itself is a little bit different, but it's not bad. I kinda like it!

Xcode is also used for developing software for the Mac, including games. The GLUT framework comes with the system, and so does the latest OpenGL. Decide between either GLUT or SDL and use it with OpenGL and your game will not only run fine on the Mac but also in Windows*.
Note though, last time I checked SDL needs some extra glue on OS X to work.


* extra bindings for OpenGL extensions might be needed in windows if you're using more advanced stuff, but there are libs that take care of that
Oluseyi
Oluseyi
Quote:
Original post by mutton
I'm just wondering if XCode is worth using as a compiler.

Xcode is fine. It's an IDE, not just a compiler, and it comes with a lot of companion tools - Interface Builder, Shark, CHUD, Quartz Composer, OpenGL Shader Builder, etc.

Quote:
Also another little question, I can't use directx and win32 programming correct?

Correct. If you want to make GUI applications, you'll need to use Carbon for C++ or Cocoa for Objective-C. For performance 3D graphics, you'll need to use OpenGL. Note, however, that OpenGL on older (pre-aluminum) Macbooks as well as the current introductory level unit is generally poor, so you won't be able to do a ton of 3D graphics programming.

Another option is to use the SDL bindings, as pointer mentioned, especially if you're unfamiliar with programming Mac OS X. Or if you're comfortable with Python, PyGame or Pyglet are very usable alternatives.

Quote:
...is Xcode good for making non-iPod touch games?

Yes, Xcode is fine. I use it.
Viral_Fury
Viral_Fury
I have used XCode for projects just fine (using opengl+glut, have not tried it with SDL).

It's pretty simple to do it. All you have to do is create a new project, add the appropriate frameworks (Opengl and GLUT), and you're ready to code.

Something to keep in mind: There are some differences. For example, where you would use

#include <GL/glut.h>#include <GL/gl.h>


with windows or linux, on a mac you would use:

#include <GLUT/glut.h>#include <OPENGL/gl.h>


swiftcoder
swiftcoder
Quote:
Original post by Viral_Fury
with windows or linux, on a mac you would use:
*** Source Snippet Removed ***
But take note that many Macs are case-sensitive, so you need to write those as and
Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]
mutton
mutton
Alright thanks, also heard that codewarrior can be used on macs, is it any good?
Oluseyi
Oluseyi
Quote:
Original post by mutton
Alright thanks, also heard that codewarrior can be used on macs, is it any good?

No. CodeWarrior is a discontinued, non-free product. There's no reason to choose it.
Alastair Gould
Alastair Gould
Xcode has some really good tools that comes with it.

Like instruments(Understandble dtrace front end), and Quartz composer
swiftcoder
swiftcoder
Quote:
Original post by Alastair Gould
Xcode has some really good tools that comes with it. Like instruments(Understandble dtrace front end), and Quartz composer
Don't forget Shark - to my mind it is the ultimate reason to develop on a Mac [wink]
Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]
mutton
mutton
cool I'll check into shark, also I don't care about price so I just want to know codewarrior is a good buy.
Oluseyi
Oluseyi
Quote:
Original post by mutton
cool I'll check into shark, also I don't care about price so I just want to know codewarrior is a good buy.

Of course it's not a good buy. Didn't you see where I said it's discontinued?

Use Xcode.
swiftcoder
swiftcoder
Quote:
Original post by mutton
cool I'll check into shark, also I don't care about price so I just want to know codewarrior is a good buy.
Before the leap the Mac OS X, CodeWarrior was pretty much the only C/C++ compiler for Mac. These days you have a choice of compilers, and Codewarrior has not withstood the competition. The compiler is outdated, the IDE is terrible, and the standard library shipped with it it seriously broken.
Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]
mutton
mutton
Wow I download Xcode but its so confusing. I don't even know how to start a project. It asks you what template to use but there are like 100 and I just want to make a normal game but I don't know which to choose. I tried empty project but I can't do anything in it. Anyone know which template is good for a beginner person like me? (c++ btw)
Viral_Fury
Viral_Fury
for my GL stuff I usually just use command line program. I have no idea if this is what you're "supposed to" use, but it works.
swiftcoder
swiftcoder
Quote:
Original post by mutton
Wow I download Xcode but its so confusing. I don't even know how to start a project. It asks you what template to use but there are like 100 and I just want to make a normal game but I don't know which to choose. I tried empty project but I can't do anything in it. Anyone know which template is good for a beginner person like me? (c++ btw)
If you install SDL, it will install a set of templates specifically for games with SDL. I would suggest that you use some or other platform library (SDL, GLFW, or similar), as otherwise the platform setup code must be written in Objective-C. You can also find a couple of tutorials, and a Mac centric game development forum, over at http://www.idevgames.com.
Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]
Oluseyi
Oluseyi
Quote:
Original post by mutton
Anyone know which template is good for a beginner person like me? (c++ btw)

Command Line Utility > C++ Tool

It's roughly the equivalent of a Win32 console application.
mutton
mutton
Alright thanks guys I got it working. so far so good but I'm have trouble with my small little program, I'm using int main() but say i need an initializer before 'int'. since theres no point on starting a new thread for this error I might as well post it here and see whats wrong with it.
Ill only post about of the code:

int main()
{

cout<<"welcome to Mad Lib"< cout<<"answer the following questions to create your own story"<
string name = AskText("please enter a name");
string noun = AskText("please enter a noun");
int number = AskNumber("please enter a number");
string bodypart = AskText("please enter a bodypart");
string verb = AskText("please enter a verb");

TellStory(name, noun, number, bodypart, verb);

return 0;
}

error: expected initializer before 'int'

any ideas what initializer i need? I though int was the initializer
Oluseyi
Oluseyi
Show the entire source file. C and C++ errors cascade.
mutton
mutton
#include
#include

using namespace std;

string AskText(string prompt);
int AskNumber(string prompt);
void TellStory(string name, string noun, int number, string bodypart, string verb)


int main()
{

cout<<"welcome to Mad Lib"< cout<<"answer the following questions to create your own story"<
string name = AskText("please enter a name");
string noun = AskText("please enter a noun");
int number = AskNumber("please enter a number");
string bodypart = AskText("please enter a bodypart");
string verb = AskText("please enter a verb");

TellStory(name, noun, number, bodypart, verb);

return 0;
}

string AskText(string prompt)
{
string text;
cout< cin>>text;
return text;
}

int AskNumer(string prompt)
{
int num;
cout< cin>>num;
return num;
}



error:expected initializer before 'int'(the int is the int main())



(sorry not sure how to compact code into scroller)
Viral_Fury
Viral_Fury
you forgot a semicolon

at this line:

void TellStory(string name, string noun, int number, string bodypart, string verb)


It's right before you started your int main.

and use source tags;

[sou rce lang="cpp]
[/sou rce]

just change sou rce to source

Topic Locked

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

Sign in to reply to this topic.