


With the other renderers the problem is more complex and there are too many factors to be taken into account (drivers, platform, API implementation, batching, and so on)
#Texturepacker sdl software
The performance difference will be given by the renderer you choose(or SDL chose), so first one, for software renderer there should be no performance difference! ) and (except the software one) all of them are implemented in the same fashion:
#Texturepacker sdl code
The short answer: Using one big texture atlas will probably be faster and should definitely not be slower than multiple small textures and here is why:Īfter taking a look at the SDL source code i can see that SDL supports a bunch of renderers (OpenGL, Gles2, Psp, D3D. So my question is: are these 2 approaches the same in terms of performance, when using SDL 2? However, I'm not sure that a SDL texture is translated into a real Texture. I know SDL 2 takes advantage of 3D acceleration and I'm not an expert of 3D graphics programming, but I do know that selecting the current texture is an operation that is very expensive. I use src to select the sprite I'm interested into blitting. Since I have every single sprite in a different bmp, this would cause hundreds of texture objects to be created.Īnother solution would be to create a single SDL_Surface based on all the bmp files, create a single texture object from it and then blit it with something like this: SDL_RenderCopy(renderer, texture, &src, &dest) SDL_RenderCopy(renderer, texture, NULL, &dest) SDL_Texture *texture = SDL_CreateTextureFromSurface(renderer, surface) Based on the docs, this is what I would do: SDL_Surface *surface = SDL_LoadBMP("image.bmp") I'm using SDL 2 to create a small 2D game.
