Flatland

Documentation

SourceForge.net Logo

Demo::App Class Reference

Inheritance diagram for Demo::App:

ComplexApp List of all members.

Detailed Description

Definition at line 254 of file demo.hpp.

Public Member Functions

 App (int width, int height)
void InitGl ()
 OpenGL initialization.
void InitOde ()
 ODE initialization.
virtual void Draw () const
SpaceGetSpace ()
Flatland::WorldGetWorld ()
void Clear () const
void DrawScene () const
void Step (float delta)
 Advances the simulation by the given step size.
void SetTarget (const vec2 &target)
void UpdateCenter ()
void Resize (int width, int height)
vec2 Center () const
void Zoom (float factor)
dJointID Glue (Object *a, Object *b)
dJointID Anchor (Object *a, Object *b, vec2 p, float mu=0, float erp=0.01)
dJointID Anchor (Object *a, vec2 p, float mu=0, float erp=0.01)
dJointID AnchorAxis (Object *a, vec2 axis)

Static Public Member Functions

static Texture LoadTexture (int width, int height, const void *data)
 Creates a texture using the given data and returns its OpenGL handle.
static Texture LoadTexture (const char *filename)
 Creates a texture using a raw image file. Returns the OpenGL handle for the texture.
static int TextureWidth (Texture id)
static int TextureHeight (Texture id)
static void GetImageData (const char *filename, void *data)
 Loads pixel data from a raw image file.
static void GetImageSize (const char *filename, int &width, int &height)
 Returns the size of a raw image file.
static void Blit (Texture id, float left, float top, Color color=Color::White, bool flip=false)
 Draws the given OpenGL texture using a quad.
static AppGetSingleton ()

Protected Attributes

Space space
Flatland::World world
vec2 center
vec2 velocity
vec2 target
float zoom
int width
int height

Static Protected Attributes

static Appsingleton


Member Function Documentation

void App::Resize ( int  width,
int  height 
)

Sets up the viewport like this:

  • top left corner is (0,0)
  • bottom right corner is (+width, +height)

Definition at line 567 of file demo.cpp.


The documentation for this class was generated from the following files:
Generated on Sat Jan 13 17:20:21 2007 for Flatland by doxygen 1.5.1