quick easy question about openGL.
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.
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.
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!
For windowing/input, GLUT is a fairly simple way to do it. SDL, already mentioned, works too.
Hope it helps!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement