Rose
|
Store the current draw color replacing it with a new draw color. More...
#include <Renderer.h>
Public Member Functions | |
DrawColorGuard ()=delete | |
Deleted default constructor. | |
DrawColorGuard (const DrawColorGuard &)=delete | |
Deleted copy constructor. | |
DrawColorGuard (DrawColorGuard &&)=default | |
DrawColorGuard & | operator= (const DrawColorGuard &)=delete |
~DrawColorGuard () noexcept(false) | |
Set the old clip rectangle back on the renderer when destroyed. | |
DrawColorGuard (Renderer &renderer, SDL_Color color) | |
Construct DrawColorGuard with and SDL_Color. More... | |
DrawColorGuard (Renderer &renderer, color::RGBA color) | |
Construct DrawColorGuard with a rose::Color. More... | |
operator bool () const noexcept | |
Test the validity of the DrawColorGuard. More... | |
int | setDrawColor (SDL_Color color) |
Set the drow Color on the renderer without pushing the old color on the stack. More... | |
int | setDrawColor (color::RGBA color) |
Set the draw Color on the renderer without pushing the old color on the stack. More... | |
Protected Attributes | |
Renderer & | mRenderer |
The renderer to which the draw colors are set. | |
SDL_Color | mOldColor {} |
The old draw color. | |
int | mStatus |
The status of the last SDL operation. | |
Store the current draw color replacing it with a new draw color.
When the object is destroyed (by going out of scope) the old draw color is set.
rose::sdl::DrawColorGuard::DrawColorGuard | ( | Renderer & | renderer, |
SDL_Color | color | ||
) |
Construct DrawColorGuard with and SDL_Color.
renderer | The renderer to set the color on. |
color | The SDL_Color. |
rose::sdl::DrawColorGuard::DrawColorGuard | ( | Renderer & | renderer, |
color::RGBA | color | ||
) |
Construct DrawColorGuard with a rose::Color.
renderer | The renderer to set the color on. |
color | The rose::Color. |
|
inlineexplicitnoexcept |
Test the validity of the DrawColorGuard.
int rose::sdl::DrawColorGuard::setDrawColor | ( | SDL_Color | color | ) |
Set the drow Color on the renderer without pushing the old color on the stack.
color | The SDL_Color to set. |
|
inline |
Set the draw Color on the renderer without pushing the old color on the stack.
color | The Color to set. |