Jump to content
  • Advertisement
Sign in to follow this  
healeyx76

OpenGL Noob question : setting up opengl

This topic is 5136 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

Im just starting OpenGL, and ive looked at some tutorials and it all seems easy. The hardest part im having is getting it to work with my system. Im on a Mac with OS x 10.3. Now I DONT want to use project builder or xcode stuff. I CAN get opengl to work with these, but i need it to work just as an include in my code. Do I have to set links in my directory to the header files? Or is there a special path I have to add to my enviroment variables? It just gives me the undefined function errors, though it doesnt say it cannot find the .h files. What should I do?

Share this post


Link to post
Share on other sites
Advertisement
I have a Mac also, and have OpenGL working with OSX. Not sure what you are looking to do, but you need to either setup OpenGL in Cocoa or Carbon. If you use SDL it setups OpenGL through Cocoa. But you need to use this preprocessor directive to include gl

#include <GL/OpenGL.h>
#include <GL/gl.h>
#include <GL/glext.h>

and make sure you have included the opengl.framework into your project. Not sure thats what you're looking for....

Share this post


Link to post
Share on other sites
I was looking for a way to avoid using the frameworks, and just have those include statements in my code. I mean, I want to be able to code using VI and use a makefile to compile, not using codewarrior or any sort of project management. It doesnt find those .h files, so I think its a path problem, but what should I do.

I guess I can start a new project (it DOES work using XCode) but its a lot of hassle because the code is done, im just working on an output interface.

Share this post


Link to post
Share on other sites
Well, let me just explain exactly what I want.

I have code writtin in C/C++. I want to add an openGL window that does very simple drawing. It is on a MacOSx system. I currently build by makefile/gcc and have never used XCode or Codewarrior, though it doesnt seem too hard. I want to be able to, in the end, build just an executable that when built on most systems it works. Right now it works on any platform, but I DONT want to build a .app file(which is what XCode makes me build).

Share this post


Link to post
Share on other sites
Then you want to use SDL to set up OpenGL. There are SDL ports available for Linux, Windows and Mac OS X (and probably some other OSes too).

Share this post


Link to post
Share on other sites
XCode doesn't make you build a .app, just choose the project type for Tool or whatever. And you can build with a makefile, you just need to add -framework OpenGL or something like that to gcc.

It seems that GLUT would be the easiest way to do this, SDL for OSX requires an obj-c project ( which is kind of dumb, unless you used the UNIX installation. )

BTW you can always build xcode projects from the command line anyways, it's xcodebuild or something similar, I'm not sure what is exactly but you can find out by reading the documentation ( I don't have a mac at work so I can't tell you exactly. )

Share this post


Link to post
Share on other sites
If you want cross platform and are making games which I assume you are doing based on you are on gamedev.net. You have to use SDL on the Mac. Why not use SDL? You can code it once and the recompile it for PC/Linux ect... and it will work on the other OS's/hardware without having to recode it. Look into SDL and you can use SDL from a command line compiler also. I think the example comes with a make file if I remember right...

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!