17 const std::unique_ptr<Impl> pimpl;
30 unsigned width()
const;
34 void resize(
unsigned width,
unsigned height,
bool fullscreen);
107 virtual void drop(
const std::string& filename) {}
124 #ifdef GOSU_IS_IPHONE 125 void* uikit_window()
const;
virtual bool tick()
EXPERIMENTAL - MAY DISAPPEAR WITHOUT WARNING.
double update_interval() const
Convenient all-in-one class that serves as the foundation of a standard Gosu application.
virtual void release_memory()
This function is called when the operating system's memory is low.
virtual bool needs_cursor() const
If this function returns true, the system cursor will be visible while over the window.
virtual void lose_focus()
This function is called when the window loses focus on some platforms.
Window(unsigned width, unsigned height, bool fullscreen=false, double update_interval=16.666666, bool resizable=false)
Constructs a Window.
Struct that saves information about a touch on the surface of a multi-touch device.
const Input & input() const
virtual void drop(const std::string &filename)
Called when a file is dropped onto the window.
unsigned screen_width(Window *window=nullptr)
Returns the width (in pixels) of a screen.
virtual void touch_ended(Touch touch)
virtual void touch_moved(Touch touch)
virtual void button_up(Gosu::Button)
Same as button_down. Called when the user releases a button.
virtual void touch_cancelled(Touch touch)
virtual void button_down(Gosu::Button)
Called before update when the user presses a button while the window has the focus.
const Graphics & graphics() const
void set_update_interval(double update_interval)
virtual void gamepad_connected(int index)
Called when a gamepad is connected.
virtual void close()
Closes the window if it is currently shown.
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.
unsigned available_height(Window *window=nullptr)
Returns the maximum height (in 'points') that is available for a non-fullscreen Window.
Button
List of button IDs that can be used with Gosu::Input.
void set_caption(const std::string &caption)
unsigned available_width(Window *window=nullptr)
Returns the maximum width (in 'points') that is available for a non-fullscreen Window.
void resize(unsigned width, unsigned height, bool fullscreen)
virtual void update()
Called every update_interval milliseconds while the window is being shown.
virtual bool needs_redraw() const
Gives the game a chance to say no to being redrawn.
unsigned screen_height(Window *window=nullptr)
Returns the height (in pixels) of the user's primary screen.
std::string caption() const
virtual void touch_began(Touch touch)
virtual void show()
Enters a modal loop where the Window is visible on screen and receives calls to draw, update etc.
virtual void gamepad_disconnected(int index)
Called when a gamepad is disconnected.