Clarification on MonoGame GL and SDL

I was poking around with MonoGame GL v3.6 and noticed that in the root of the Visual Studio project there is a libSDL2-2.0.0.dylib file.

It got me thinking, is SDL itself its own GPU rendering library? Or does SDL use OpenGL under the hood. I see SDL in the project but the project is OpenGL. This is why I am asking.

Thanks!! :smiley:

SDL is a library that is meant to be used together with a graphics API like OpenGL or DirectX and provide you with the window/input/audio handling, and in MonoGame its used like that. There are many games that use it like that and a good example are Valves games and Steam.

SDLs renderer is something of an extension and a good comparison for it is JavaScripts 2D canvas, yes you could use it if you need to just draw some simple shapes and such, but for anything more complex you’ll just use WebGL. For more information, you can see the wiki page for it:

1 Like

Ah very cool. That clears the things up a little bit. Very awesome!!

Thanks!! :smiley:

Another quick question if you don’t mind. If I use the .NET SDL binding downloaded from the website. How do you know if it is using OpenGL or DirectX.

SDL bindings don’t use either, they just provide you with the window and possibly context.

So this means it is not a wrapper around any OpenGL or DX calls? Which means if I want to do any drawing, I have to use OpenGL myself? For example.

Yes, SDL does not provide a wrapper for a graphics API, as that is not its purpose.

Ok awesome. Kind of. :smiley:
Here is a post on stackoverflow about SDL.

It says that it uses GDI by default. Which of course I have no interest in. But does that mean you can do OpenGL rendering using SDL by changing a setting or something? They make it seem like you can.

Sorry about my confusion, I just do not want to go down a road using something that is not doing hardware rendering.

Again, SDL Renderer can do rendering and stuff, but it should not be used for anything more complex, besides that component SDL does absolutely NOTHING regarding the rendering and that is what the stack overflow post is talking about.

You just create a window with SDL, get the context, and continue using OpenGL/DirectX/Vulkan etc, using the created window.

I have already stated the exact same thing in my previous 2 comments, I really have no idea how else to state it anymore :confused: Just make a 3D game using SDL if you are not able to understand it.