4 #ifndef GOSU_WINDOW_HPP
5 #define GOSU_WINDOW_HPP
31 const GOSU_UNIQUE_PTR<Impl> pimpl;
32 #if defined(GOSU_CPP11_ENABLED)
43 Window(
unsigned width,
unsigned height,
bool fullscreen,
109 typedef std::tr1::shared_ptr<std::tr1::function<void()> > SharedContext;
110 SharedContext createSharedContext();
113 #ifdef GOSU_IS_IPHONE
114 void* rootViewController()
const;
119 virtual void touchBegan(
Touch touch) {}
120 virtual void touchMoved(Touch touch) {}
121 virtual void touchEnded(Touch touch) {}
131 #ifdef GOSU_IS_IPHONE
Includes all parts of C++03 (TR1) that are relevant for Gosu.
Convenient all-in-one class that serves as the foundation of a standard Gosu application.
virtual void loseFocus()
This function is called when the window loses focus on some platforms.
void close()
Closes the window if it is currently shown.
Contains declarations of all of Gosu's available classes.
void setCaption(const std::wstring &caption)
virtual void buttonUp(Gosu::Button)
Same as buttonDown. Called then the user released a button.
Struct that saves information about a touch on the surface of a multi- touch device.
Window(unsigned width, unsigned height, bool fullscreen, double updateInterval=16.666666)
Constructs a Window.
const Audio & audio() const
const Graphics & graphics() const
virtual void buttonDown(Gosu::Button)
Called before update when the user pressed a button while the window had the focus.
void show()
Enters a modal loop where the Window is visible on screen and receives calls to draw, update etc.
class GOSU_DEPRECATED Audio
const Input & input() const
virtual void releaseMemory()
This function is called when the operating system's memory is low.
Serves as the target of all drawing and provides primitive drawing functionality. ...
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.
std::wstring caption() const
virtual void update()
Called every updateInterval milliseconds while the window is being shown.
void handleMessage()
Blocking function which waits for the next message, processes it, then returns.
double updateInterval() const
virtual bool needsCursor() const
If this function returns true, the system arrow cursor is drawn while over the window.