mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-06 03:51:54 +00:00
Add a function that clears the window with a specified color.
This commit is contained in:
parent
bccfa89910
commit
f3258c7504
@ -83,6 +83,15 @@ void twindow::clear()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void twindow::clear(Uint8 r, Uint8 g, Uint8 b, Uint8 a)
|
||||||
|
{
|
||||||
|
SDL_SetRenderDrawColor(*this, r, g, b, a);
|
||||||
|
if(SDL_RenderClear(*this) != 0) {
|
||||||
|
throw texception("Failed to clear the SDL_Renderer object.",
|
||||||
|
true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void twindow::render()
|
void twindow::render()
|
||||||
{
|
{
|
||||||
SDL_RenderPresent(*this);
|
SDL_RenderPresent(*this);
|
||||||
|
@ -101,6 +101,15 @@ public:
|
|||||||
/** Clears the contents of the window. */
|
/** Clears the contents of the window. */
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clears the contents of the window with a given color.
|
||||||
|
*
|
||||||
|
* @param r Red value of the color.
|
||||||
|
* @param g Green value of the color.
|
||||||
|
* @param b Blue value of the color.
|
||||||
|
*/
|
||||||
|
void clear(Uint8 r, Uint8 g, Uint8 b, Uint8 a = 0);
|
||||||
|
|
||||||
/** Renders the contents of the window. */
|
/** Renders the contents of the window. */
|
||||||
void render();
|
void render();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user