Public Member Functions | |
Window (unsigned width, unsigned height, bool fullscreen, double updateInterval=16.666666) | |
Constructs a Window. | |
virtual | ~Window () |
std::wstring | caption () const |
void | setCaption (const std::wstring &caption) |
double | updateInterval () const |
void | show () |
Enters a modal loop where the Window is visible on screen and receives calls to draw, update etc. | |
void | close () |
Closes the window if it is currently shown. | |
virtual void | update () |
Called every updateInterval milliseconds while the window is being shown. | |
virtual void | draw () |
Called after every update and when the OS wants the window to repaint itself. | |
virtual bool | needsRedraw () const |
Gives the game a chance to say no to being redrawn. | |
virtual void | buttonDown (Gosu::Button) |
Called before update when the user pressed a button while the window had the focus. | |
virtual void | buttonUp (Gosu::Button) |
Same as buttonDown. Called then the user released a button. | |
const Graphics & | graphics () const |
Graphics & | graphics () |
const Input & | input () const |
Input & | input () |
GOSU_DEPRECATED const Audio & | audio () const |
GOSU_DEPRECATED Audio & | audio () |
Manages initialization of all of Gosu's core components and provides timing functionality. Note that you should really only use on instance of this class at the same time. This may or may not change later.
Definition at line 27 of file Window.hpp.
Gosu::Window::Window | ( | unsigned | width, | |
unsigned | height, | |||
bool | fullscreen, | |||
double | updateInterval = 16.666666 | |||
) |
Constructs a Window.
updateInterval | Interval in milliseconds between two calls to the update member function. |
virtual Gosu::Window::~Window | ( | ) | [virtual] |
GOSU_DEPRECATED Audio& Gosu::Window::audio | ( | ) |
GOSU_DEPRECATED const Audio& Gosu::Window::audio | ( | ) | const |
virtual void Gosu::Window::buttonDown | ( | Gosu::Button | ) | [virtual] |
Called before update when the user pressed a button while the window had the focus.
Definition at line 65 of file Window.hpp.
virtual void Gosu::Window::buttonUp | ( | Gosu::Button | ) | [virtual] |
Same as buttonDown. Called then the user released a button.
Definition at line 67 of file Window.hpp.
std::wstring Gosu::Window::caption | ( | ) | const |
void Gosu::Window::close | ( | ) |
Closes the window if it is currently shown.
virtual void Gosu::Window::draw | ( | ) | [virtual] |
Called after every update and when the OS wants the window to repaint itself.
Your application's rendering code goes here.
Definition at line 55 of file Window.hpp.
Graphics& Gosu::Window::graphics | ( | ) |
const Graphics& Gosu::Window::graphics | ( | ) | const |
Input& Gosu::Window::input | ( | ) |
const Input& Gosu::Window::input | ( | ) | const |
virtual bool Gosu::Window::needsRedraw | ( | ) | const [virtual] |
Gives the game a chance to say no to being redrawn.
This is not a definitive answer. The operating system can still cause redraws for one reason or another. By default, the window is redrawn all the time.
Definition at line 61 of file Window.hpp.
void Gosu::Window::setCaption | ( | const std::wstring & | caption | ) |
void Gosu::Window::show | ( | ) |
Enters a modal loop where the Window is visible on screen and receives calls to draw, update etc.
virtual void Gosu::Window::update | ( | ) | [virtual] |
Called every updateInterval milliseconds while the window is being shown.
Your application's main game logic goes here.
Definition at line 52 of file Window.hpp.
double Gosu::Window::updateInterval | ( | ) | const |