Create a 2D GPU rendering context for a window, with support for the specified shader format.
Defined in <SDL3/SDL_render.h>
SDL_Renderer * SDL_CreateGPURenderer(SDL_Window *window, SDL_GPUShaderFormat format_flags, SDL_GPUDevice **device);
SDL_Window * | window | the window where rendering is displayed. |
SDL_GPUShaderFormat | format_flags | a bitflag indicating which shader formats the app is able to provide. |
SDL_GPUDevice ** | device | a pointer filled with the associated GPU device, or NULL on error. |
(SDL_Renderer *) Returns a valid rendering context or NULL if there was an error; call SDL_GetError() for more information.
This is a convenience function to create a SDL GPU backed renderer, intended to be used with SDL_GPURenderState. The resulting renderer will support shaders in one of the specified shader formats.
If no available GPU driver supports any of the specified shader formats, this function will fail.
This function should only be called on the main thread.
This function is available since SDL 3.4.0.