I think maybe you have a different meaning of "wrapper" than I do?
A wrapper is basically an abstraction layer. Something which abstracts or even simplifies the process of using an underlying library.
In this case... SDL does not do the graphics work itself... it merely relays your requests to an underlying lib which does the work. Therefore, SDL is a wrapper.
@Lumpkin
Do you set out to act like a know-it-all just to be proven to absolutely know almost nothing?
Disch is right in what he says. SFML, SDL, Allegro are all wrappers in regards to graphics as they hide everything that is going on by calling OpenGL or DirectX according to OS.
To clear things up, that image refers to how SDL covers over a given windowing subsystem, not how it covers over the graphics subsystem. That image isn't a good representation of all of SDL functionality.
@chrisname
I don't really care anymore. "Fool me once. Shame on you. Fool me twice. Shame on me." He was banned once for doing this exact thing, wrong remarks and thread derailment while under the guise of 'wanting to learn', but never showing any effort to do so. So there is the "Fool me once." Now he is doing the same things under a new account again under the guise of 'learning his lesson and wanting to learn' while again showing no effort to do so. "Fool me twice."
If he had shown effort to change I would have bit my tongue, but fact is that veteran users on here have to spend too much time watching for his replies so they can tell the OP to ignore his erroneous answers. Enough is enough.
To be fair, nobody spends deliberate time on the forums.
Also, there are times, even whenever I was a younger programmer on this forum where I've corrected more veteran members, especially in example code. I didn't do it with disdain but instead more of a suggestion.
Heads will butt, hopefully logic will always prevail.
I simply said on windows it wasn't an OpenGL wrapper. It's a direct x and win32 on, OpenGL doesn't have a windowing system...
And we are trying to tell you that you are wrong. But you don't want to believe that.
There is no need to always go on the defensive and try and defend your view whenever someone points out something that contradicts what you say. Specially when what you say is usually misinformed.
We are not trying to lay into you just to prove you wrong (At least most of us aren't) we are just trying to give you the correct information and for some reason you just want to ignore it because you believe you know better even though multiple people have pointed out otherwise.
Now SDL is still a openGL wrapper (And a DirectX wrapper, GDI wrapper, Quartz wrapper, ect) no matter what system it is on. The part of the library that wraps openGL code doesn't simply disappear because it is not using openGL on windows. Yes like we have said many times SDL does not use openGL as a backend on windows but that doesn't mean it is not a wrapper of openGL.
It's a direct x and win32
If you really want to get into the back end of SDL on windows it actually doesn't use directX as a default, it actually uses GDI. Though a directX back end is available.
OpenGL doesn't have a windowing system...
I really have no clue what point you are trying to make with this statement. I don't believe anyone ever said it did.
Actually, SDL does use OpenGL on Windows if you ask it too which I generally do (since I never use DX). Although, I haven't used Windows in years now...
ARRHG. Cire, I know I said that. SDL doesn't use OpenGL by default, that's what I meant by it.
SDL doesn't actually wrap OpenGL functions. You use them directly.
As a 2D renderer, Direct X is used. However if you want more control, you can use OpenGL. It doesn't use OpenGL to render anything by itself. It has the option to create a OpenGL context though.
> I've heard that there is some kind of DirectX support in SDL. Is SDL
> wrapping DirectX in Win32. Or does it contain wrapper functions or
> somekind of DirectX implementation in other operating systems?
SDL is its own interface, designed to be platform independant. One of
the platforms that SDL has been ported to is DirectX/Win32.
Ie. The code you write can be compiled (hopefully) for the other platforms
SDL has been ported to, and will work on them with (hopefully) no modifications.
So, it is kind of wrapper functions, but on a higher level, and wrapper
functions have been writted for a few different interfaces (like X11, Beos,
DirectX). :-)
cya
Josh
-----
Expert, n.:
Someone who comes from out of town and shows slides.
On Windows, SDL uses Direct X to render it's NORMAL rendering. Not With OpenGL.
What does SDL wrap in OpenGL? I'm not talking using it as a windowing system for OpenGL, I'm talking pure SDL alone.
IT CALLS DIRECT X TO DO UNDERLYING GRAPHICS WORK. (On Windows)
On other platforms, it does use OpenGL in place of Direct X. (How would they even use Direct X on Linux/Mac?)
I'm not talking about windowing either. You can use OpenGL to back all of the 2D API whenever you generate an SDL renderer. I'm going to explain this even though I seriously shouldn't have to.
Whenever you create an SDL _Renderer (via whatever functions you use), all functions allow you to pass an index to choose which driver you want. You can find which driver you want by calling SDL_GetNumRenderDrivers, iterating through the list via SDL_GetRenderDriverInfo,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#include <SDL2/SDL.h>
#include <stdio.h>
int main(){
int numDrivers = SDL_GetNumRenderDrivers();
for (int i = 0; i < numDrivers; ++i){
SDL_RendererInfo info;
int error = SDL_GetRenderDriverInfo(i, &info);
if (error != 0){
printf("Failed to get renderer driver info for index %i!\n", i);
continue;
}
printf("Index %i has the name %s\n", i, info.name);
}
return 0;
}
In my case, this outputs:
[computerquip@caedo test]$ ./a.out
Index 0 has the name opengl
Index 1 has the name opengles2
Index 2 has the name opengles
Index 3 has the name software
In your case, it will have all of the above plus whatever Direct X devices are available, including OpenGL.
While it defaults to DirectX, functionality pertain to OpenGL is not removed and still quite usable on Windows.