
Sdl-gpu: A library for high-performance, modern 2D graphics with SDL - vmorgulis
https://github.com/grimfang4/sdl-gpu
======
babuskov
I looked at the demos and I still fail to see the point of using this over
SDL2. SDL2 is already high performance and uses DirectX / OpenGL underneath.

What exactly does this library bring to the table?

~~~
girvo
I think the main feature is being able to easily leverage shaders with a nicer
API. Having done a fair bit of SDL over the years, dropping down to pure
OpenGL and shaders can be a bit... low-level, which is to be expected. This
seems to make that quite a bit nicer?

Edit: For example, check out this
[http://dinomage.com/reference/SDL_gpu/group__ShaderInterface...](http://dinomage.com/reference/SDL_gpu/group__ShaderInterface.html)

~~~
bluesilver07
Is it possible to render textured quads of arbitrary shapes? I'm trying to
make a runtime for Spine ([http://esotericsoftware.com/spine-
runtimes](http://esotericsoftware.com/spine-runtimes)) and SDL's inability to
do that directly without using OpenGL was the reason I couldn't use it. I
don't see a way to do that in Sdl-gpu either - maybe I need to look at the
source code.

~~~
badlogic
If you want to render Spine 3.x models, you'll need to be able to render
arbitrary textured triangles so meshes and skewing work correctly. Check out
the new Spine TypeScript runtime (spine-ts), which renders via WebGL. Should
be trivial to port to OpenGL (ES).

~~~
bluesilver07
Oh awesome. Thanks Mario!

------
rileyphone
Finally, bringing (some of) the nice features of SFML to C. SFML, for me, has
just the right amount of control over GPU things without having to really know
the OpenGL pipeline.

~~~
jadbox
Any reason to just use SFML over this?

~~~
rileyphone
SFML is a C++ library, so it provides some of the abstractions C++ has. If
that's your cup of tea, I'd recommend SFML.

~~~
eggy
There's always CSFML, an official binding of C to SFML. I don't know C++. I am
finding C to be a break from all of the new PLs I've been playing with. A sort
of return to basics for me. It was my first language (well, after BASIC ;)).

------
white-flame
Doxygen != documentation, especially in low-comment situations.

Tell us more.

~~~
pavanky
Even if there is copious amounts of comments, doxygen is still pretty
terrible. Unfortunately there's nothing better for C++.

Everything else seems to be more pain in the ass than it is worth.

~~~
bastijn
Making a library nobody uses is even a bigger pain in the ass than spending
considerable time writing proper documentation. For software developer
documentation is a large part of the developer experience. Without it, a large
portion of potential users will switch to a less optimal but well documented
solution. Documentation matters.

------
otabdeveloper1
I've never met a computer where 2D graphics were faster with a GPU. (Try
benchmarking and see for yourself. 2D graphics is mostly blitting pixels,
where a GPU will only slow things down.)

~~~
vardump
I might agree or disagree depending on the details.

Lower latency? Yeah, CPU wins easily.

4k resolution 2D composition? Well, GPU is pretty likely to win this one...

CPU has pretty low latency, easily better than what GPU can achieve. But on
the other hand GPU has insane bandwidth, high degree of parallelism and
hardware ROPs.

