Gosu::Window Class Reference

Convenient all-in-one class that serves as the foundation of a standard Gosu application. More...

List of all members.

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 Graphicsgraphics () const
Graphicsgraphics ()
const Audioaudio () const
Audioaudio ()
const Inputinput () const
Inputinput ()
SharedContext createSharedContext ()


Detailed Description

Convenient all-in-one class that serves as the foundation of a standard Gosu application.

Manages initialization of all of Gosu's core components and provides timing functionality.


Constructor & Destructor Documentation

Gosu::Window::Window ( unsigned  width,
unsigned  height,
bool  fullscreen,
double  updateInterval = 16.666666 
)

Constructs a Window.

Parameters:
updateInterval Interval in milliseconds between two calls to the update member function.


Member Function Documentation

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.


The documentation for this class was generated from the following file:

Generated on Sat Feb 7 22:34:53 2009 for Gosu by  doxygen 1.5.5