quick easy question about openGL.

Started by
3 comments, last by CJWR 18 years, 9 months ago
i've heard that openGL is a cross system. which means that it is for windows as well as linux and perhaps macs. now does this mean that if i write an openGL game for linux, if i take the code and compile it on a window's compiler it should compile without any problems, and run? i've been learning directX, but i don't really like it, and i'd rather use be able to have my games work on more then one os. thank you for your time.
Charles Reed, CEO of CJWR Software LLC
Advertisement
Ze thing about OpenGL is that yes it is cross platform but that is mainly because it does not provide any of its own window creation or user interaction code. As far as I know.
What we do in life... Echoes in eternity
If you use SDL (or anything else that is cross platform for making windows, reading from the keyboard, etc) then you can make your programs cross platform. If you code an OpenGL program using just the Win32 API, you'll be stuck on Windows.

OpenGL in general (i.e. glBegin() ) is cross-platform, however each OS provides its own way of making windows render with OpenGL/load extensions - under Windows it's WGL, under X it's GLX. The WGL/GLX code and the windowing system code is likely all you'll need to change if you stick to other cross-platform code throughout your program.

For windowing/input, GLUT is a fairly simple way to do it. SDL, already mentioned, works too.

Hope it helps!
- fyhuang [ site ]
hmm, interesting, i think i'll leave directx after the game i'm working on now then and try opengl/sdl. thank you.
Charles Reed, CEO of CJWR Software LLC

This topic is closed to new replies.

Advertisement