| Summary: | Create functions to save/restore render state | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Sam Lantinga <slouken> |
| Component: | video | Assignee: | Gabriel Jacobo <gabomdq> |
| Status: | ASSIGNED --- | QA Contact: | Sam Lantinga <slouken> |
| Severity: | enhancement | ||
| Priority: | P2 | CC: | gabomdq |
| Version: | HG 2.1 | ||
| Hardware: | All | ||
| OS: | All | ||
I've done a bit of this here: http://mdqinc.com/blog/2013/01/integrating-librocket-with-sdl-2/ where I do the "resetting" to a known state by drawing a point outside of the screen. I ended up building SDL_RenderGeometry out of that code to be able to integrate with SDL's shader management (there's another wishlist item!), but the idea still holds... Basically I think a solution could be implemented with a SDL_RenderResetState function which can be called before the 2D functions, something like... app specific 3D rendering setup... 3D rendering SDL_RenderResetState() 2D rendering (using SDL_Render* functions) 2D/3D present That seems like a decent approach to me. :) |
It should be possible to use SDL rendering with native OpenGL or Direct3D. This task is to create functions to save and restore render state so 2D rendering can be mixed with 3D rendering. e.g. while (true) { 3D rendering... SDL_RenderSaveState() 2D rendering... SDL_RenderRestoreState() 3D present } We'll also need some test programs for this using the various native 3D APIs.