Hassen Dhia
Hassen Dhia

Reputation: 585

rendering with sdl_gfx is so slow , any alternative?

I have been using sdl_gfx ( sdl2 extension library https://github.com/ferzkopp/SDL_gfx ) to make android games , i have always noticed that rendering primitives is so slow .
so i was rendering it once to a texture than drawing the texture on each frame to the screen ,but now im working on a game project in witch that method is not possible
i am looking for an alternative , is there a way to render primitives ( with alpha ) on android using sdl2 ? a crossplatform method ( not gles ) .
sdl_gfx is fine but soooo slow ( double slow on android but even under windows so slow ) i think that's because it is using the sdl2 renderer to render to the screen , by calculating the pixels of the primitive and draw each pixel to the screen , so it is using the cpu not gpu ( software rendering ) , that makes it so slow

Upvotes: 1

Views: 1968

Answers (1)

Jonny D
Jonny D

Reputation: 2344

You can take a look at SDL_gpu to see if it fits your needs (disclaimer: I'm the author). It uses OpenGL ES on Android and iOS (OpenGL on other platforms) directly and provides a few graphics features that SDL_Renderer is missing, like a shader API. It also does a form of simple automatic batching to reduce OpenGL call overhead.

https://github.com/grimfang4/sdl-gpu

Upvotes: 3

Related Questions