Polycode
Polycode::ScreenMesh Class Reference

2D Mesh. More...

Inherits Polycode::ScreenEntity.

Inherited by Polycode::ScreenLine, and Polycode::ScreenShape.

List of all members.

Public Member Functions

 ScreenMesh (Mesh *mesh)
 Creates the screen mesh from existing Mesh.
 ScreenMesh (const String &fileName)
 Creates the screen mesh and loads a mesh from a file name.
 ScreenMesh (int meshType)
 Create an empty screen mesh of specified type.
void Render ()
 Main render method.
MeshgetMesh () const
 Returns the mesh for this screen mesh.
Texture * getTexture () const
 Returns the texture associated with the mesh.
void loadTexture (const String &fileName)
 Loads a texture from an image file.
void loadTexture (Image *image)
 Loads a texture from an image instance.
void setTexture (Texture *texture)
 Applies a texture.

Public Attributes

bool lineSmooth
 If this is set to true, the lines in wireframe meshes will be anti-aliased if the support is available in the renderer.
bool ownsMesh
 If true, will delete its Mesh upon destruction.

Detailed Description

2D Mesh.

ScreenMesh is the base for most geometry-based screen entities. It's based aroudn a Mesh instance, like its 3D counterpart (SceneMesh), but currently has fewer options.

See also:
Mesh

Constructor & Destructor Documentation

ScreenMesh::ScreenMesh ( int  meshType)

Create an empty screen mesh of specified type.

See Mesh for available mesh types.


Member Function Documentation

Mesh * ScreenMesh::getMesh ( ) const

Returns the mesh for this screen mesh.

Returns:
The mesh.
void ScreenMesh::loadTexture ( const String fileName)

Loads a texture from an image file.

Parameters:
fileNamePath to the image file.
void ScreenMesh::loadTexture ( Image image)

Loads a texture from an image instance.

Parameters:
imageImage instance.
void ScreenMesh::Render ( ) [virtual]

Main render method.

Override this to do your own drawing.

Reimplemented from Polycode::Entity.

Reimplemented in Polycode::ScreenLine, and Polycode::ScreenShape.

void ScreenMesh::setTexture ( Texture *  texture)

Applies a texture.

Parameters:
textureto apply.

Member Data Documentation

If true, will delete its Mesh upon destruction.

(defaults to true)