cross-platform code
I've recently bought an iBook and I'd like to use it to code my opengl apps! I've been coding only for win so far and I'm still a beginner (I've created a stupid game and a tetris clone)
I'd like to make cross-platform code so I can work both on mac and on pc and show my works to my friends!
Is it possible? where can i find some examples?
tnx
I'd like to make cross-platform code so I can work both on mac and on pc and show my works to my friends!
Is it possible? where can i find some examples?
tnx
You've got a few choices, primarily either GLUT or SDL; I'd recommend the SDL library: easy, free, reasonably documented, knowledgable and helpful mailing list, games orientated, and cross-platform for Mac OS X, Windows, Linux, and a host of other minor platforms...
Mark Bishop
The SDL website (http://www.libsdl.org/) has the information you need plus links to tutorials.
Apparently NeHe has a few SDL ports; failing that, I'm not sure - I think there are a few tutorials for 2D SDL code (there's a platform game example/tutorial which is always mentioned on the SDL mailing list) but I don't have the links to hand, sorry - if you want, email me and I'll send you a few SDL/OpenGL examples I coded a while back - they pretty much cover all the basics (creating an OpenGL context with SDL, using SDL_image to load textures, et al; they're not pretty, but they do work
)
)
Mark Bishop
sealfin Wrote:Apparently NeHe has a few SDL ports; failing that, I'm not sure - I think there are a few tutorials for 2D SDL code (there's a platform game example/tutorial which is always mentioned on the SDL mailing list) but I don't have the links to hand, sorry - if you want, email me and I'll send you a few SDL/OpenGL examples I coded a while back - they pretty much cover all the basics (creating an OpenGL context with SDL, using SDL_image to load textures, et al; they're not pretty, but they do work)
thank you for your help!
I have found some examples, but I have a prob lem: xcode
I have create a new empty project, added the opengl, sdl and carbon frameworks and loaded the example files
the problem is the "include"
I've tried with
#include <GL/gl.h> but it gives me error when I compile
sorry for my crappy english
Try #include <OpenGL/gl.h>
If you've installed SDL via one of the packages at the SDL site, you should already have the option of an "SDL OpenGL Application" in the New Project window of Xcode anyway...
If you've installed SDL via one of the packages at the SDL site, you should already have the option of an "SDL OpenGL Application" in the New Project window of Xcode anyway...
Mark Bishop
sealfin Wrote:Try #include <OpenGL/gl.h>
thank you!
now I only need to know how to include sdl! I haven't understand how frameworks work yet

edit:
I really can't figure how to include sdl! I've been searching over the net and it seems to be a common problem! (and no one knows the answer
)
Assuming you're using XCode, you should just need to drag the framework into the Frameworks folder in your project and add #include <SDL/sdl.h> or something like that...
Did you ever wonder why we had to run for shelter when the promise of a brave new world unfurled beneath the clear blue sky?
Steven Wrote:Assuming you're using XCode, you should just need to drag the framework into the Frameworks folder in your project and add #include <SDL/sdl.h> or something like that...
yeah I'm using xcode...
I've added the sdl and opengl frameworks (they are listed among the other files of the project, on the left), however it doesn't work neither with <SDL/SDL.h> nor <SDL.h>
You need to add the following to your linker flags (in the target build settings)
-framework SDL
(and for any other frameworks you are using).
- Iain
-framework SDL
(and for any other frameworks you are using).
- Iain
How about SDL/sdl.h> ?
IBethune Wrote:You need to add the following to your linker flags (in the target build settings)
-framework SDL
(and for any other frameworks you are using).
- Iain
I added -framework SDL to "other link flags" where xcode put -framework Carbon, but it was useless
I think Jabber's right there: #include <SDL/sdl.h> should do the trick (lower-caps on the header)
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Cross platform question | kordeul | 13 | 4,759 |
Aug 22, 2007 03:09 AM Last Post: kordeul |
|
| Cross-platform gui? | Duane | 13 | 4,722 |
Jul 6, 2007 06:38 PM Last Post: mac_girl |
|
| Best cross platform API for PC & MAC | Tarek Demiati | 6 | 2,942 |
Apr 16, 2006 03:07 PM Last Post: Dan Potter |
|
| Cross platform game code on a budget | Carlos Camacho | 7 | 3,415 |
Apr 19, 2003 09:29 PM Last Post: Mars_999 |
|
| Cross-platform Solutions | DJBlufire | 13 | 4,643 |
Feb 16, 2003 02:40 PM Last Post: athomson |
|

