Live data from Hacker News

Sdl-gpu: A library for high-performance, modern 2D graphics with SDL

github.com

11–20 of 27 posts

Re: Sdl-gpu: A library for high-performance, modern 2D graphics with SDL

#11
post #9

Earlier quoted context omitted.

Any reason to just use SFML over this?

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.

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 ;)).

Re: Sdl-gpu: A library for high-performance, modern 2D graphics with SDL

#12
post #9

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.

Any reason to just use SFML over this?

I've found SFML to be quite inefficient if you use it naively (e.g. by using their built-in render target implementation or by creating a lot of sf::Sprite objects). There's no batching and they reset the current shader after every draw call so it never lazily sets it which can cause performance problems on some drivers. They set a LOT of OpenGL state unnecessarily. It's okay for prototyping things or if you really don't care but if you want to do things efficiently you need to start pulling it apart (or just go straight to OpenGL).

Re: Sdl-gpu: A library for high-performance, modern 2D graphics with SDL

#13

Doxygen != documentation, especially in low-comment situations. Tell us more.

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.

Re: Sdl-gpu: A library for high-performance, modern 2D graphics with SDL

#14
post #4
post #2

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?

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...

Is it possible to render textured quads of arbitrary shapes? I'm trying to make a runtime for Spine (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.

Re: Sdl-gpu: A library for high-performance, modern 2D graphics with SDL

#15
post #13

Doxygen != documentation, especially in low-comment situations. Tell us more.

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.

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.

Re: Sdl-gpu: A library for high-performance, modern 2D graphics with SDL

#16
post #4
post #2

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?

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...

Worth noting that the Allegro library also has a shader API:

http://liballeg.org/a5docs/trunk/shader.html

Re: Sdl-gpu: A library for high-performance, modern 2D graphics with SDL

#17
post #2

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?

And is there any way to see the demos or at least some screenshots without spending all night trying to get CMake working under Windows?

Announcing a cool new library, application, or hack by dumping people into a GitHub repo is not what I'd call especially good marketing (to the extent anyone cares, obviously.) This is getting to be a bit of a pet peeve.

Re: Sdl-gpu: A library for high-performance, modern 2D graphics with SDL

#18
post #4

Earlier quoted context omitted.

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...

Is it possible to render textured quads of arbitrary shapes? I'm trying to make a runtime for Spine ( 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.

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).

Re: Sdl-gpu: A library for high-performance, modern 2D graphics with SDL

#19

Earlier quoted context omitted.

Is it possible to render textured quads of arbitrary shapes? I'm trying to make a runtime for Spine ( 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.

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).

Oh awesome. Thanks Mario!
Post reply on HN