| Summary: | provide access to SDL_Surface of already-created software renderer(s) | ||
|---|---|---|---|
| Product: | SDL | Reporter: | David Ludwig <dll> |
| Component: | render | Assignee: | Sam Lantinga <slouken> |
| Status: | NEW --- | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | dll |
| Version: | HG 2.0 | ||
| Hardware: | All | ||
| OS: | All | ||
| Attachments: | possible implementation, #1 | ||
To note, the use case I am looking into here, involves: 1. an SDL_Renderer being created, with users, potentially, adjusting what type of renderer is used 2. if and when a software renderer is being used, have an app use custom routines to scale images, to the destination surface |
Created attachment 2932 [details] possible implementation, #1 If and when a software SDL_Renderer is created, there does not appear to be any means to get its inner SDL_Surface, once the renderer has been created. An SDL_Surface can be passed into SDL_CreateSoftwareRenderer, and that SDL_Surface may be used later on, however, if one is created through other means, such as a user setting the SDL_RENDER_DRIVER environment variable, there is no public API to retrieve this surface. Proposal: add an API to retrieve the SDL_Surface of an existing software SDL_Renderer. Attached is a potential implementation of such a function. The function itself is: SDL_Surface * SDL_GetSoftwareRendererSurface(SDL_Renderer * renderer); This function will return NULL for non-software renderers, or on error. If the renderer is a software renderer, it'll return its SDL_Surface.