Inherits Polycode::ScreenEntity.
Inherited by Polycode::ScreenLine, and Polycode::ScreenShape.
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. | |
Mesh * | getMesh () 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. |
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.
ScreenMesh::ScreenMesh | ( | int | meshType | ) |
Create an empty screen mesh of specified type.
See Mesh for available mesh types.
Mesh * ScreenMesh::getMesh | ( | ) | const |
Returns the mesh for this screen mesh.
void ScreenMesh::loadTexture | ( | Image * | image | ) |
Loads a texture from an image instance.
image | Image instance. |
void ScreenMesh::loadTexture | ( | const String & | fileName | ) |
Loads a texture from an image file.
fileName | Path to the image file. |
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.
texture | to apply. |
If true, will delete its Mesh upon destruction.
(defaults to true)