Add a clear function to the window.
Also clear the window in the constructor.
This commit is contained in:
parent
6edb01b228
commit
d20c12019b
2 changed files with 13 additions and 0 deletions
|
@ -54,6 +54,8 @@ twindow::twindow(const std::string& title,
|
|||
}
|
||||
|
||||
pixel_format_ = info.texture_formats[0];
|
||||
|
||||
clear();
|
||||
}
|
||||
|
||||
twindow::~twindow()
|
||||
|
@ -73,6 +75,14 @@ void twindow::full_screen()
|
|||
/** @todo Implement. */
|
||||
}
|
||||
|
||||
void twindow::clear()
|
||||
{
|
||||
if(SDL_RenderClear(*this) != 0) {
|
||||
throw texception("Failed to clear the SDL_Renderer object.",
|
||||
true);
|
||||
}
|
||||
}
|
||||
|
||||
void twindow::render()
|
||||
{
|
||||
SDL_RenderPresent(*this);
|
||||
|
|
|
@ -98,6 +98,9 @@ public:
|
|||
*/
|
||||
void full_screen();
|
||||
|
||||
/** Clears the contents of the window. */
|
||||
void clear();
|
||||
|
||||
/** Renders the contents of the window. */
|
||||
void render();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue