• Advertisement
Sign in to follow this  

Xcode?

This topic is 3316 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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>



Share this post


Link to post
Share on other sites
Alright thanks, also heard that codewarrior can be used on macs, is it any good?

Share this post


Link to post
Share on other sites
cool I'll check into shark, also I don't care about price so I just want to know codewarrior is a good buy.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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)

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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"<<endl;
cout<<"answer the following questions to create your own story"<<endl;

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

Share this post


Link to post
Share on other sites
#include <iostream>
#include <string>

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"<<endl;
cout<<"answer the following questions to create your own story"<<endl;

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<<prompt;
cin>>text;
return text;
}

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



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



(sorry not sure how to compact code into scroller)

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
lol you just beat me to the punch, just got that now, thanks for the help though

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement