Does SDL_RenderCopyEx is GPU optimized?

Hello, I started to add rotation to my engine and wanted to know if use rendercopyex is optimized on GPU ?

I wanted to optimize the thing by creating cached texture of the angle but a friend said it’s probably GPU optimized.

How can I know that ?


Yes. The SDL 2.0 render API will favor hardware acceleration when available (unless it is told not to with the SDL_RENDERER_SOFTWARE flag).

For SDL 2.0.7 at least, there’s the rare case with OpenGL where it will choose a slow software context, but that should only happen if the system doesn’t have the proper driver installed.

At the moment, the only information you get about the backend is its name and some flags about vsync and framebuffers/rendertargets. You have to trust it to do the right thing otherwise.

If you ever find a case where it does the wrong thing, feel free to document it here or on the bugtracker.

1 Like