|
Rose
|
Store the current draw color replacing it with a new draw color. More...
#include <GraphicsModel.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 (Context &context, SDL_Color color) | |
| Construct DrawColorGuard with and SDL_Color. More... | |
| DrawColorGuard (Context &context, 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 draw 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 | |
| Context & | mContext |
| 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::gm::DrawColorGuard::DrawColorGuard | ( | Context & | context, |
| SDL_Color | color | ||
| ) |
Construct DrawColorGuard with and SDL_Color.
| renderer | The renderer to set the color on. |
| color | The SDL_Color. |
| rose::gm::DrawColorGuard::DrawColorGuard | ( | Context & | context, |
| 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::gm::DrawColorGuard::setDrawColor | ( | SDL_Color | color | ) |
Set the draw 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. |
1.8.13