Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Cromulent

macrumors 604
Original poster
Oct 2, 2006
6,810
1,100
The Land of Hope and Glory
Does anyone know of any good "pure" OpenGL / GLUT templates for Xcode (preferably Xcode 3) at all?

I have the SDL / OpenGL templates but was hoping that there was a simple (and very basic) template available.
 

szymczyk

macrumors regular
Mar 5, 2006
187
17
You can convert the SDL/OpenGL template to a GLUT template pretty easily. Make a copy of the SDL/OpenGL template folder and open your copy's Xcode project. You'll want to remove the parts of the SDL template you don't need for a GLUT template. Remove the SDL, AppKit, Cocoa, and Foundation frameworks from the project. Remove SDLMain.m and SDLMain.h from the project as well as the files in the Atlantis folder, such as atlantis.c.

The main.c file in the SDL template does a lot. You'll want to substitute your own main.c or main.cpp file, depending on whether you want to write your GLUT programs in C or C++. After you get main.c looking the way you want, you have a GLUT project template.
 

Cromulent

macrumors 604
Original poster
Oct 2, 2006
6,810
1,100
The Land of Hope and Glory
You can convert the SDL/OpenGL template to a GLUT template pretty easily. Make a copy of the SDL/OpenGL template folder and open your copy's Xcode project. You'll want to remove the parts of the SDL template you don't need for a GLUT template. Remove the SDL, AppKit, Cocoa, and Foundation frameworks from the project. Remove SDLMain.m and SDLMain.h from the project as well as the files in the Atlantis folder, such as atlantis.c.

The main.c file in the SDL template does a lot. You'll want to substitute your own main.c or main.cpp file, depending on whether you want to write your GLUT programs in C or C++. After you get main.c looking the way you want, you have a GLUT project template.

Excellent, thanks. Hopefully that will just work.

Still getting used to using Xcode.
 

Cromulent

macrumors 604
Original poster
Oct 2, 2006
6,810
1,100
The Land of Hope and Glory
Thought I may as well post what I've been using.

Very simple but saves a bit of boring typing.

Edit : Bah realised I uploaded the wrong template. It should be fixed now.
 

Attachments

  • OpenGL GLUT Application.zip
    152.1 KB · Views: 1,499
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.