How portable is OpenGL?

Started by
14 comments, last by PredeX 22 years, 5 months ago
Yes, of course any extra layer adds overhead. But then again, so does using C when you could use Assembly language.

~~~~~~~~~~
FreeBSD.org - worship the Daemon!
ReactOS - an Open-source operating system compatible with Windows NT apps and drivers
Advertisement
ABSOLUTELY ... THAT'S MY POINT!!!!

We all accept that a good engine is written in assembly ... right?


NO ... with the right compilers it doesn't matter (much)

But by trying to include the overhead for each OS, you are not doing yourself a favour! Target your system for a specific sytem, then re-write the OS stuff!

Edited by - Shag on October 25, 2001 9:03:56 PM
quote:Original post by Shag
NO ... with the right compilers it doesn't matter (much)

Exactly, which the right interoperability wrapper it doesn't matter (much). SDL is meant for games, you think they'll make it slow on purpose? I haven't noticed any loss of speed yet.

[Resist Windows XP's Invasive Production Activation Technology!]

Edited by - Null and Void on October 25, 2001 10:00:24 PM
quote:Original post by Shag
But by trying to include the overhead for each OS, you are not doing yourself a favour! Target your system for a specific sytem, then re-write the OS stuff!

Why include the overhead of OpenGL when you could write directly to the card? Target your game for a specific graphics card, then re-write the card specific stuff to support other graphics cards.

It''s all a matter of trade-offs.
quote:Original post by Dactylos
Why include the overhead of OpenGL when you could write directly to the card? Target your game for a specific graphics card, then re-write the card specific stuff to support other graphics cards.

It''s all a matter of trade-offs.


But wouldnt that be much more work since theres a whole bunch of cards which are used by gamers??

Let''s say i want to program a game for Windows and Linux, could i use GCC (DJGPP) with OGL and just compile under both platforms(preferably) without any changes?

AP lacks the ability to understand sarcasm

But the answer to the question is yes an no. Once you have the rendering context, you can write code that won''t change OS to OS, but you will have to abstract GLX, WGL or AGL (are there any others now).

My library compiles under GCC (Cygwin - not DJGPP as thats DOS and OpenGL support would have to be through Mesa) for Windows and Linux. Programs that use it compile to Windows & Linux without changes.

There is -negligable overhead-. You are only making virtual function calls on OS specific stuff, not OGL stuff. Virtual functions aren''t so slow anyway out of inner loops, especially when it is only for resizing windows, etc that you don''t do often.

So, yes, OpenGL is portable. (Hey, is there really any competition anyway? What else can you use for 3D on Linux - DirectX via Wine?!


~~~
Cheers!
Brett Porter
PortaLib3D : A portable 3D game/demo libary for OpenGL
Community Service Announcement: Read How to ask questions the smart way before posting!
~~~Cheers!Brett PorterPortaLib3D : A portable 3D game/demo libary for OpenGLCommunity Service Announcement: Read How to ask questions the smart way before posting!

This topic is closed to new replies.

Advertisement