Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm not sure this is what you need but i'll give you the basics for running an opengl/glut-based program using Xcode.</p> <ol> <li>Create a new empty project, name it whatever you want</li> <li>Under the project menu click "<strong>New Target</strong>"</li> <li>On the left menu select "<strong>Cocoa</strong>", then click "<strong>Application</strong>", name it whatever you want</li> <li>You should have a new window called "Target <em>'your-program's-name'</em> info" </li> <li>Under the tab "<strong>Build</strong>" scroll all the way down to "<strong>GCC_PREFIX_HEADER</strong>", double click the value (wich should be something like <strong>"$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"</strong>, delete this line, click ok.</li> <li>Close the info window</li> <li>Right click your project's name, click <strong>Add</strong> > <strong>Existing frameworks</strong> > Select "<strong>OpenGL.framework</strong>", click <strong>add</strong>. </li> <li>Again, right click your project's name, click <strong>Add</strong> > <strong>Existing frameworks</strong> > Select "<strong>GLUT.framework</strong>", click <strong>add</strong>.</li> <li>Right click your project's name, click <strong>Add</strong> > <strong>New File</strong> > under the "<strong>C and C++</strong>" tab, select <strong>C++ file</strong>, click next, name it whatever you want. (make sure it's being added to your project and target), click finish.</li> <li>You're now ready to build and run any c++ project using OpenGl.framework and GLUT.framework</li> </ol> <p>-You can use command + enter for building and running and command + shift + enter for closing an active window.</p> <p>-When you require input from the user you should run it from terminal, compile like this:</p> <p>"<em>gcc -o func2d func2d.c -framework carbon -framework OpenGL -framework GLUT</em>"</p> <p>where func2d is the name of your application executable and func2d.c is the c file used</p> <p>The imports required in case you don't have them are:</p> <pre><code>OpenGL/gl.h OpenGL/glu.h GLUT/glut.h stdlib.h </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload