Hello,
In my app, I scan for each available rendering driver until I find one supporting HW accel.
If none is found, I re-iterate over the list until I succeed in initializing a SW renderer.
Pseudo code :
// Attempt to init an HW renderer
for each driver
if (renderer initialization(driver, SDL_RENDERER_ACCELERATED) succeeds) {
return renderer
}
end
// Attempt to init an SW renderer.
for each driver
if (renderer initialization(driver) succeeds) {
return renderer
}
end
My questions are:
-
Is it a good manner to initialize the video renderer, given that I want to get a HW accelerated one if available, else I initialize a SW one.
Also, is it needed to pass in the SDL_RENDERER_SOFTWARE flag instead of passing no flags at all ? -
Do I have to manage 2 separate codes, one for SW rendering and one for HW rendering, the first one using classical SDL_Surface’s and the other one using SDL_Texure’s ?
-
If answer of 2 is yes, do I have also to manage separate code to blit on the screen, one using the old style SDL_BlitSurface and SDL_UpdateRects / SDL_Flip and the other using SDL_RenderCopy and SDL_RenderPresent ?
Thanks !
Julien CLEMENT
@Julien_Clement1