Hi guys,
I’ve more or less completed the concept phase of my little game and get a proof of concept with SDL2 on the screen. However, I followed different tutorials to get there and the code is not really clean. More important I still got SDL methods mixed, like Surfaces and Textures. I noticed that by my current use I’ll probably get performance problems once I draw a lot mire, so I better sit down on my bum now and get it right.
Currently I have one surface where I blit all the sprites in their right animation phase to. A Google search hinted at using “streaming textures” for things like sprites that change in every frame.
Could someone please confirm or deny that this is the right way to do it and I got it right:
Stop using surfaces alltogether and use textures. By this way I will use hardware acceleration and video ram.
Using textures and SDL_RenderPresent will automatically use double buffering and switch between buffers.
Have one "normal" texture for static elements like playing field and static UI elements
Use streaming textures for changing elements like sprites and changing UI elements like numbers/status
Assemble everything to one big texture with SDL_RenderCopy and then use SDL_RenderPresent
Is this the right way to go?
Thanks and regards