Skip to content

Rework pygame._sdl2.video.get_drivers() (3627) #1782

Open
@GalacticEmperor1

Description

@GalacticEmperor1

Issue №3627 opened by Starbuck5 at 2022-12-23 07:42:41

SDL_GetRenderDriverInfo() has been removed, since most of the information it reported were estimates and could not be accurate before creating a renderer. Often times this function was used to figure out the index of a driver, so one would call it in a for-loop, looking for the driver named "opengl" or whatnot. SDL_GetRenderDriver() has been added for this functionality, which returns only the name of the driver.

Additionally, SDL_CreateRenderer()'s second argument is no longer an integer index, but a const char * representing a renderer's name; if you were just using a for-loop to find which index is the "opengl" or whatnot driver, you can just pass that string directly here, now. Passing NULL is the same as passing -1 here in SDL2, to signify you want SDL to decide for you.

https://github.com/libsdl-org/SDL/blob/main/docs/README-migration.md#sdl_renderh

We should change our get_drivers() function to return a list of string renderer names since that will be portable to SDL3?

Do we need to change how renderers are created (from the user's perspective) to accommodate this change?

It seems that we are missing a port of SDL_GetRendererInfo


Comments

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions