Public Types | |
typedef boost::shared_ptr < boost::function< void()> > | SharedContext |
Public Member Functions | |
Window (unsigned width, unsigned height, bool fullscreen, double updateInterval=16.666666) | |
std::wstring | caption () const |
void | setCaption (const std::wstring &caption) |
void | show () |
void | close () |
virtual void | update () |
virtual void | draw () |
virtual void | buttonDown (Gosu::Button) |
virtual void | buttonUp (Gosu::Button) |
const Graphics & | graphics () const |
Graphics & | graphics () |
const Audio & | audio () const |
Audio & | audio () |
const Input & | input () const |
Input & | input () |
SharedContext | createSharedContext () |
Manages initialization of all of Gosu's core components and provides timing functionality.
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. |
void Gosu::Window::show | ( | ) |
Starts the main event loop.
void Gosu::Window::close | ( | ) |
Closes the window if it is currently shown.
virtual void Gosu::Window::update | ( | ) | [inline, virtual] |
Called every updateInterval milliseconds while the window is being shown.
Your application's main game logic goes here.
virtual void Gosu::Window::draw | ( | ) | [inline, virtual] |
Called after every update and when the OS wants the window to repaint itself.
Your application's rendering code goes here.
virtual void Gosu::Window::buttonDown | ( | Gosu::Button | ) | [inline, virtual] |
Called before update when the user pressed a button while the window had the focus.
virtual void Gosu::Window::buttonUp | ( | Gosu::Button | ) | [inline, virtual] |
Same as buttonDown. Called then the user released a button.