How is OpenGL related to SDL?

Started by
14 comments, last by badblood909 21 years, 11 months ago
quote:Original post by i8degrees

Well, for one, SDL wouldn''t be able to acess all the hardware specific, or feature specific, functions that DirectX might be able to handle. Since it is a cross-platform library, every function has to work on ALL platforms, and obviously, not all graphics features are available on all platforms.



Wrong dude, as already mentioned, SDL wraps DX on Windows systems and OGL on Linux systems. So basicly, you could use SDL for serious game programming. BTW, Loki used SDL for some of their ports of Windows games( or was it for all of them? I don''t remember ). So SDL could be used for Serious Game programming as the original poster calls it.



"And that''s the bottom line cause I said so!"

Cyberdrek
danielc@iquebec.com
Founder
Laval Linux

/(bb|[^b]{2})/ that is the Question -- ThinkGeek.com
Hash Bang Slash bin Slash Bash -- #!/bin/bash
[Cyberdrek | ]
Advertisement
quote:
Wrong dude, as already mentioned, SDL wraps DX on Windows systems and OGL on Linux systems. So basicly, you could use SDL for serious game programming. BTW, Loki used SDL for some of their ports of Windows games( or was it for all of them? I don''t remember ). So SDL could be used for Serious Game programming as the original poster calls it.


SDL wraps OGL on Windows also. It uses DX for everything else(input, sound, etc).

I''ve done some DX programming, and had to write wrapper classes to avoid constantly rewriting all the tedious DX setup junk. And my wrapper classes ended up looking very similar to SDL. So for me, SDL does what I would want a wrapper library to do, and I get portability for free.

I don''t think that Loki is a good example of the use of SDL. They made good ports, to be sure, but only on Linux. I''m wondering why a major studio doesn''t use SDL to target more than one platform. Or even use SDL for a windows only project.

Take care,
Bill




SDL is good for many reasons. Some of them are:

It's a cross platform API.
It's open source.
It gives you full access to OpenGL (some minor differences are initialization and flipping buffers)
It's used (and developed) by a lot of people, which means it's relatively bug free.
It's updated often.
It's a much better wrapper for DirectX than you can ever write
It has a function for generating decaf coffee and bagels with cream cheese.

It really is a good API though. It even has its own multithreading wrappers and timers. I don't know why big companies don't use it, maybe it's because they don't care about other platforms and/or want to use Direct3D. There is one problem I encountered with SDL which is supposed to be fixed soon, and that's the mouse wheel scrolling isn't working very well. Other than that I have no complaints.

[edited by - Supernova on May 1, 2002 12:25:51 PM]
>>It gives you full access to OpenGL (some minor differences are initialization and flipping buffers)<<

the reason for this is so u can support voodoo cards (1,2,3) without having to change your code, in the old days this was a major pain

http://uk.geocities.com/sloppyturds/gotterdammerung.html
SDL doesnt wrap opengl anywhere. It can be used to create a window and handle input and then you can use opengl to draw in the window.
antistuff you''re pretty much right. The difference is that you have to tell SDL you''re using OpenGL, and then use SDL buffer flipping function instead of OpenGL''s because SDL has access to the window internally. In other words you don''t know the handle of the window only SDL does, so you have to let it take care of some OpenGL init and the buffer flipping.

This topic is closed to new replies.

Advertisement