How to set up an OpenGL project using Xcode 4.2 in C ++?

I am trying to move on to some graphics in C ++. I figured it was best to start with the most capable graphical shell, so I'm going with OpenGL included in Lion.

Basically, I started a command line tool in C ++ in Xcode 4.2 and that's all I did.

I need to somehow associate OpenGL with Xcode so that I can use it. After I installed it on my Mac platform, I hope that I can use the basic OpenGL guide for C ++ to continue, because if you haven’t noticed, I don’t quite understand how it should be. Pretty much everything I read is some background information on how OpenGL uses the CPU and GPU along with the OpenGL client and server. I would appreciate any guidance from the management.

The question arises: how do I link OpenGL with Xcode 4.2 in C ++ (not objective-c, it's funky) so that I can use the graphics capabilities?

+5
source share
2 answers

To use OpenGL in Xcode, you need to add the OpenGL structure to your project. After that, the header and library files will be available to the compiler and linker.

This page provides a step-by-step guide on creating a C project using OpenGL and GLUT. If you start with OpenGL, then by the way, using GLUT might be a good idea. In this tutorial, you will be asked to create a file main.cat some point. Instead, you need to create main.cppif you want to use C ++.

+5
source

GLUT, openGL .. C, ++ objective-C. objective-C ++, . , , objective-C ++ bridge .mm, objective-C .m ++.cpp XCode .

, OpenGL , ...

+3

All Articles