|
|
opengl in c
|
|
|
|
Forum Regular
Join Date: Sep 2002
Location: The land of evil: Redmond
Status:
Offline
|
|
I am trying to figure out how to program opengl using C. I want this to be easy to port over to other Operating systems so Objective C will not work. Does anybody have any experience in setting up opengl/glut in OSX for use in C? I can't seem to get anything to work.
|
12" PB 867 *Retired :( *
2.2 Ghz 15" Macbook Pro
|
|
|
|
|
|
|
|
Mac Enthusiast
Join Date: Jul 2002
Status:
Offline
|
|
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status:
Offline
|
|
Originally posted by Altair:
I am trying to figure out how to program opengl using C. I want this to be easy to port over to other Operating systems so Objective C will not work. Does anybody have any experience in setting up opengl/glut in OSX for use in C? I can't seem to get anything to work.
OpenGL is all natively C code. Most of the examples out there should be C. You could always download the Quake 2 Source code too, since it's all C/OpenGL.
|
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
|
|
|
|
|
|
|
|
Mac Enthusiast
Join Date: Jul 2002
Status:
Offline
|
|
To be precise, rendering OpenGL content is done in C. But you first have to create some sort of window to render INTO, and that might be in C/C++ (Carbon, GLUT) or Obj-C (Cocoa). The GL core does not know anything about the windowing system, so you have to pick an interface (NSGL/AGL/CGL). GLUT uses Cocoa underneath, btw.
|
|
|
|
|
|
|
|
|
Forum Regular
Join Date: Sep 2002
Location: The land of evil: Redmond
Status:
Offline
|
|
Thank you, this is exactly what i needed!
|
12" PB 867 *Retired :( *
2.2 Ghz 15" Macbook Pro
|
|
|
|
|
|
|
|
Forum Regular
Join Date: Sep 2002
Location: The land of evil: Redmond
Status:
Offline
|
|
I tried doing the above tutorial but i get the same error that i was having earlier:
gltutorial:0: Undefined symbols: _glClear _glViewport _glutCreateWindow _glutDisplayFunc _glutIdleFunc _glutInit _glutInitDisplayMode _glutInitWindowSize _glutMainLoop _glutPostRedisplay _glutReshapeFunc _glutSwapBuffers
Anybody have a clue on what is causing this?
|
12" PB 867 *Retired :( *
2.2 Ghz 15" Macbook Pro
|
|
|
|
|
|
|
|
Mac Enthusiast
Join Date: Jul 2002
Status:
Offline
|
|
Those are linker errors complaining that GL functions can't be found. You have to link against the GL framework. In Xcode, add the framework to your project. Or in a makefile, "-framework OpenGL".
Keith shows this in his seventh screenshot in the tutorial.
|
|
|
|
|
|
|
|
|
Forum Regular
Join Date: Sep 2002
Location: The land of evil: Redmond
Status:
Offline
|
|
Originally posted by arekkusu:
Those are linker errors complaining that GL functions can't be found. You have to link against the GL framework. In Xcode, add the framework to your project. Or in a makefile, "-framework OpenGL".
Keith shows this in his seventh screenshot in the tutorial.
Thank you. The gcc command is what i needed. For some reason xCode didn't register the frameworks or something. Also I found out that you have to include the Cocoa framework as well.
|
12" PB 867 *Retired :( *
2.2 Ghz 15" Macbook Pro
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Nov 2000
Status:
Offline
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|