Question Details

No question body available.

Tags

c++ sdl sdl-3

Answers (1)

September 2, 2025 Score: 8 Rep: 125,984 Quality: High Completeness: 80%

Take a look at:

SDLRenderer SDL_CreateRenderer(SDL_Window window, const char name);

Function Parameters

Type Name Description
SDL_Window window the window where rendering is displayed.
const char name the name of the rendering driver to initialize, or NULL to let SDL choose one.

When you give it the name parameter "test", you request a driver named test, which most probably don't exist.

Let SDL3 choose one for you - and check the return values for errors:

SDL_Renderer renderer = SDLCreateRenderer(window, nullptr);
//                           let SDL3 choose driver ^^^^^^^

if (!renderer) { SDLLogError(SDLLOGCATEGORYAPPLICATION, "SDLCreateRenderer: %s", SDLGetError()); return 1; }

You should also call SDLInit(SDLINITVIDEO) at startup.