3 ms·
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 ex
by babuskov 10y ago
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?
- moon4u 10y agoI've used this library before. It is really good. The biggest difference that I can point out is that you can use shaders with SDL-gpu. Also - it plays nicely with the standard SDL2 lib.
- girvo 10y agoI 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.html http://dinomage.com/reference/SDL_gpu/group__ShaderInterface...
- stateoff 10y agoI agree. I think the main purpose is a "2D Accelerated Rendering" replacement that allows for shaders and other custom techniques.
- bluesilver07 10y agoIs 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 10y agoIf 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 10y agoOh awesome. Thanks Mario!
- grimfang4 10y agoGPU_TriangleBatch() lets you submit an array of triangle vertex data. That way you can integrate with Spine, librocket, and everything else like that.
- okasaki 10y agoWorth noting that the Allegro library also has a shader API: http://liballeg.org/a5docs/trunk/shader.html http://liballeg.org/a5docs/trunk/shader.html
- wingless 10y agoAre you talking about the low level SDL2 API or the simple game API?
- CamperBob2 10y agoAnd 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.
- grimfang4 10y agoHey, SDL_gpu dev here! :) There's actually a lot that is special about SDL_gpu, but most pertinent are: * Higher performance (it automatically collects and submits batches instead of separate draw commands for each sprite and redundant state changes) * Shader API * Arbitrary geometry rendering (triangles) * Can be integrated with explicit OpenGL calls * Full blend state control (not just "ADD", "SUB", "MULT") * Built-in primitive shapes (points, lines, tris, rects, ellipses, polygons, even arcs) * Uses a style familiar to SDL 1.2 users that I wish SDL_Renderer had gone with... * Came out before SDL 2.0 and is compatible with SDL 1.2 and 2.0 * Loads BMP, TGA, and PNG files * Rotates and scales about the center of images, making reasoning about the resulting corner coordinates more obvious (adjustable via anchor settings) Hope that helps!
- babuskov 10y ago> Rotates and scales about the center of images You can specify the rotation point in SDL2. Calculating corner coordinates is simple trigonometry. But the rest seems useful. Thanks.