ParCompMark::OpenGLRenderingEngine Class Reference
#include <PCMOpenGLRenderingEngine.h>
Collaboration diagram for ParCompMark::OpenGLRenderingEngine:
Detailed Description
Collection of rendering methods implemented using OpenGL API.
Definition at line 69 of file PCMOpenGLRenderingEngine.h.
Methods | |
virtual Renderer * | createCustomRenderer (const char *rendererName) |
Create custom renderer from a renderer plugin. | |
virtual void | resizeRenderers (const u32 width, const u32 height) |
Resize the canvas of all renderers belongs to this rendering engine. | |
virtual s32 | getSortOrderFromRenderers () |
Get alpha sorting order from renderers on this rendering engine. | |
virtual void | setAutoRenderOrder (const Renderer *renderer, const s32 &order) |
Set automatic rendering order for the specified renderer. | |
virtual void | doAutoRendering () |
Automatically call render() methods of the custom renderers placed in the queue. | |
virtual void | perspective (const double fovy, const double zNear, const double zFar) |
Set perspective projection. | |
virtual void | ortho2D (const double left, const double right, const double bottom, const double top) |
Define a 2D orthographic projection. | |
virtual void | viewport (const double left, const double top, const double width, const double height) |
Set viewport with window relative coordinates (0.0 . | |
virtual void | pushModelView () |
Push the modelview matrix on the matrix stack. | |
virtual void | popModelView () |
Pop the modelview matrix from the matrix stack. | |
virtual void | translate (const double x, const double y, const double z) |
Translate the modelview matrix. | |
virtual void | rotate (const double angle, const double x, const double y, const double z) |
Rotate the modelview matrix. | |
virtual void | scale (const double x, const double y, const double z) |
Scale the modelview matrix. | |
virtual void | setCameraPosition (const double eyeX, const double eyeY, const double eyeZ) |
Set camera position. | |
virtual void | setCameraTarget (const double centerX, const double centerY, const double centerZ) |
Set position of camera target. | |
virtual void | setCameraUpVector (const double upX, const double upY, const double upZ) |
Set up vector of the camera. | |
virtual void | setColor (const double red, const double green, const double blue, const double alpha) |
Set drawing color. | |
virtual void | setAmbientMaterial (const double red, const double green, const double blue, const double alpha) |
Set ambient material color. | |
virtual void | setDiffuseMaterial (const double red, const double green, const double blue, const double alpha) |
Set diffuse material color. | |
virtual void | setSpecularMaterial (const double red, const double green, const double blue, const double alpha, const int shininess) |
Set specular material color. | |
virtual void | setDrawStyle (const unsigned drawStyle) |
Set drawing color. | |
virtual void | setBackCulling (const bool isBackCulling) |
Specify whether back-facing facets can be culled. | |
virtual void | setBlending (const bool isOn) |
Turn on/off blending. | |
virtual void | drawTriangle () |
Draw a triangle width (0,1,0), (0,0,0), (1,0,0) vertices. | |
virtual int | generateRandomTriangles (const int dimension, const int count) |
Generate certain number of 2D or 3D triangles with random coordinates. | |
virtual void | renderObject (const u32 handle, const bool useVertexArrays) |
Render the object with the specified handle. | |
virtual void | renderObjectTriangles (const u32 handle, const bool useVertexArrays, const u32 triangleCount) |
Render specified number of triangles from an object with the given handle. | |
virtual void | setAmbientLight (const double red, const double green, const double blue, const double alpha) |
Set global ambient light parameters. | |
virtual void | removeLightSources () |
Remove all light sources. | |
virtual int | addLightSource () |
Add light source. | |
virtual void | setLightSourcePosition (const int light, const double x, const double y, const double z) |
Set position of the specified light source. | |
virtual void | setLightSourceDiffuse (const int light, const double red, const double green, const double blue, const double alpha) |
Set diffuse light parameters for the specified light source. | |
virtual void | setLightSourceSpecular (const int light, const double red, const double green, const double blue, const double alpha) |
Set specular light parameters for the specified light source. | |
virtual u32 | createDisplayList () |
Create a new display list. | |
virtual void | finishDisplayList () |
Finish the active display list. | |
virtual void | executeDisplayList (const u32 displayList) |
Execute the specified display list. | |
virtual void | drawSphere (const double radius, const int slices, const int stacks) |
Draw a sphere. | |
virtual void | drawCylinder (const double baseRadius, const double topRadius, const double height, const int slices, const int stacks) |
Draw a cylinder. | |
virtual void | drawDisk (const double innerRadius, const double outerRadius, const int slices, const int loops) |
Draw a disk. | |
virtual void | drawTeapot (const double size) |
Draw a teapot. | |
virtual void | drawCube (const double size) |
Draw a cube. | |
virtual void | drawTorus (const double innerRadius, const double outerRadius, const int nsides, const int rings) |
Draw a torus. | |
virtual void | drawDodecahedron (const double size) |
Draw a dodecahedron. | |
virtual void | drawOctahedron (const double size) |
Draw an octahedron. | |
virtual void | drawTetrahedron (const double size) |
Draw a tetrahedron. | |
virtual void | drawIcosahedron (const double size) |
Draw an icosahedron. | |
virtual void | _registerRenderer (Renderer *renderer) |
Register the specified renderer. | |
virtual u32 | _registerObject (ObjectData objectData) |
Register the specified object. | |
virtual void | _renderObject (const u32 handle, const bool useVertexArrays, const u32 vertexCount) |
Render specified number of vertices from an object with the given handle. | |
virtual void | _refreshCamera () |
Refresh camera setting in OpenGL. | |
virtual bool | _setGLUDrawStyle (const void *quadratic) |
Map current draw style to draw style of GLU quadratics. | |
virtual void | _reportTriangles (const u32 &triangleCount) |
Report certain number of triangles being rendered to the corresponding render window. | |
Public Types | |
typedef Pointer< OpenGLRenderingEngine, Mutex > | Pointer |
Type for pointer on this class. | |
NONE = 0 | |
The primitive will not be drawn. | |
POINT = 1 | |
Only the vertices will be drawn. | |
WIRE = 2 | |
Only the edges will be drawn. | |
FILL = 3 | |
Filled polygon primitives will be drawn. | |
enum | DrawStyle { NONE = 0, POINT = 1, WIRE = 2, FILL = 3 } |
Drawing styles. More... | |
Public Member Functions | |
Constructors & destructor | |
OpenGLRenderingEngine () | |
Default constructor for Squirrel compatibility. | |
OpenGLRenderingEngine (Process *parent) | |
Create rendering engine for the specified process. | |
virtual | ~OpenGLRenderingEngine () |
The destructor. | |
Getters & setters | |
Process * | getParent () const |
Getter of mParent. | |
const OpenGLRenderingEngine::Camera & | getCamera () const |
Getter of mCamera. | |
const OpenGLRenderingEngine::DrawStyle & | getDrawStyle () const |
Getter of mDrawStyle. | |
Static Public Member Functions | |
Scripting binding | |
static void | squirrelGlue () |
Static glue code method for Squirrel-C++ binding. | |
Class methods | |
static OpenGLRenderingEngine * | create (const char *stringPtr) |
Create (cast) rendering engine from a pointer passed in a string in '0x000000' format. | |
Protected Types | |
typedef ParCompMark::OpenGLRenderingEngine::Camera | Camera |
Camera type. | |
typedef ParCompMark::OpenGLRenderingEngine::ObjectData | ObjectData |
Camera type. | |
typedef ParCompMark::OpenGLRenderingEngine::DisplayList | DisplayList |
OpenGL display list type. | |
Protected Attributes | |
Variables | |
Process * | mParent |
Parent process of the rendering engine. | |
Camera | mCamera |
Camera of this rendering engine. | |
DrawStyle | mDrawStyle |
Drawing style for primitives. | |
std::set< Renderer * > | mRenderers |
Custom renderers used with this rendering engine. | |
std::vector< Renderer * > | mAutoRenderingQueue |
Automatic rendering queue for custom renderers. | |
std::vector< ObjectData > | mObjectData |
Data of objects can be rendered on this rendering engine. | |
std::vector< DisplayList * > | mDisplayLists |
Display lists on this rendering engine. | |
DisplayList * | mCurrentDisplayList |
Pointer to the current display list. | |
u32 | mLightCount |
Number of lights. | |
Classes | |
struct | Camera |
Camera type. More... | |
struct | DisplayList |
OpenGL display list type. More... | |
struct | ObjectData |
Camera type. More... |
Member Typedef Documentation
typedef struct ParCompMark::OpenGLRenderingEngine::Camera ParCompMark::OpenGLRenderingEngine::Camera [protected] |
Camera type.
typedef struct ParCompMark::OpenGLRenderingEngine::DisplayList ParCompMark::OpenGLRenderingEngine::DisplayList [protected] |
OpenGL display list type.
typedef struct ParCompMark::OpenGLRenderingEngine::ObjectData ParCompMark::OpenGLRenderingEngine::ObjectData [protected] |
Camera type.
Member Enumeration Documentation
Drawing styles.
- Enumerator:
-
NONE The primitive will not be drawn. POINT Only the vertices will be drawn. WIRE Only the edges will be drawn. FILL Filled polygon primitives will be drawn.
Definition at line 163 of file PCMOpenGLRenderingEngine.h.
Constructor & Destructor Documentation
ParCompMark::OpenGLRenderingEngine::OpenGLRenderingEngine | ( | ) |
Default constructor for Squirrel compatibility.
Calling this constructor always raises an exception.
Definition at line 58 of file PCMOpenGLRenderingEngine.cpp.
References Except.
ParCompMark::OpenGLRenderingEngine::OpenGLRenderingEngine | ( | Process * | parent | ) |
Create rendering engine for the specified process.
- Parameters:
-
[in] parent Parent process
Definition at line 76 of file PCMOpenGLRenderingEngine.cpp.
References FILL, ParCompMark::Singleton< T >::getInstance(), ParCompMark::Name::getName(), mCurrentDisplayList, mDrawStyle, mLightCount, and ParCompMark::Logger::NOTICE.
Here is the call graph for this function:
ParCompMark::OpenGLRenderingEngine::~OpenGLRenderingEngine | ( | ) | [virtual] |
The destructor.
This class has virtual destructor.
Definition at line 108 of file PCMOpenGLRenderingEngine.cpp.
References ParCompMark::Singleton< T >::getInstance(), ParCompMark::Name::getName(), mDisplayLists, mObjectData, mParent, and ParCompMark::Logger::NOTICE.
Here is the call graph for this function:
Member Function Documentation
void ParCompMark::OpenGLRenderingEngine::_refreshCamera | ( | ) | [protected, virtual] |
Refresh camera setting in OpenGL.
Definition at line 892 of file PCMOpenGLRenderingEngine.cpp.
References mCamera, ParCompMark::OpenGLRenderingEngine::Camera::position, ParCompMark::OpenGLRenderingEngine::Camera::target, and ParCompMark::OpenGLRenderingEngine::Camera::upVector.
Referenced by setCameraPosition(), setCameraTarget(), and setCameraUpVector().
u32 ParCompMark::OpenGLRenderingEngine::_registerObject | ( | ObjectData | objectData | ) | [protected, virtual] |
Register the specified object.
- Parameters:
-
[in] objectData Object to register.
- Returns:
- Handle of the generated triangle set. This handle is needed for rendering.
Definition at line 837 of file PCMOpenGLRenderingEngine.cpp.
References mObjectData.
Referenced by generateRandomTriangles().
void ParCompMark::OpenGLRenderingEngine::_registerRenderer | ( | Renderer * | renderer | ) | [protected, virtual] |
Register the specified renderer.
- Parameters:
-
[in] renderer Register renderer.
Definition at line 828 of file PCMOpenGLRenderingEngine.cpp.
References Assert, and mRenderers.
Referenced by createCustomRenderer().
void ParCompMark::OpenGLRenderingEngine::_renderObject | ( | const u32 | handle, | |
const bool | useVertexArrays, | |||
const u32 | vertexCount | |||
) | [protected, virtual] |
Render specified number of vertices from an object with the given handle.
- Parameters:
-
[in] handle Handle of object to render. [in] useVertexArrays Use vertex arrays for rendering. [in] vertexCount Number of vertices.
Definition at line 846 of file PCMOpenGLRenderingEngine.cpp.
References _reportTriangles(), Assert, and mObjectData.
Referenced by renderObject(), and renderObjectTriangles().
Here is the call graph for this function:
void ParCompMark::OpenGLRenderingEngine::_reportTriangles | ( | const u32 & | triangleCount | ) | [protected, virtual] |
Report certain number of triangles being rendered to the corresponding render window.
This is needed for window statistics.
- Parameters:
-
[in] triangleCount Number of rendered triangles.
Definition at line 924 of file PCMOpenGLRenderingEngine.cpp.
References ParCompMark::Process::getRenderWindow(), mCurrentDisplayList, mParent, and ParCompMark::OpenGLRenderingEngine::DisplayList::triangleCount.
Referenced by _renderObject(), drawCube(), drawDodecahedron(), drawIcosahedron(), drawOctahedron(), drawTetrahedron(), and drawTriangle().
Here is the call graph for this function:
bool ParCompMark::OpenGLRenderingEngine::_setGLUDrawStyle | ( | const void * | quadratic | ) | [protected, virtual] |
Map current draw style to draw style of GLU quadratics.
- Parameters:
-
[in] quadratic Quadratic to set the draw style.
- Returns:
- True if the quadratic has to be rendered, false otherwise
Definition at line 902 of file PCMOpenGLRenderingEngine.cpp.
References FILL, mDrawStyle, POINT, and WIRE.
Referenced by drawCylinder(), drawDisk(), and drawSphere().
int ParCompMark::OpenGLRenderingEngine::addLightSource | ( | ) | [virtual] |
Add light source.
- Returns:
- Handle of the light. This handle is needed for parameter setting.
Definition at line 532 of file PCMOpenGLRenderingEngine.cpp.
References mLightCount, setLightSourceDiffuse(), setLightSourcePosition(), and setLightSourceSpecular().
Referenced by squirrelGlue().
Here is the call graph for this function:
OpenGLRenderingEngine * ParCompMark::OpenGLRenderingEngine::create | ( | const char * | stringPtr | ) | [static] |
Create (cast) rendering engine from a pointer passed in a string in '0x000000' format.
- Parameters:
-
[in] stringPtr A pointer passed in a string in '0x000000' format.
- Returns:
- Cast rendering engine object.
Definition at line 135 of file PCMOpenGLRenderingEngine.cpp.
References ParCompMark::StringConverter::parsePointer().
Referenced by squirrelGlue().
Here is the call graph for this function:
Renderer * ParCompMark::OpenGLRenderingEngine::createCustomRenderer | ( | const char * | rendererName | ) | [virtual] |
Create custom renderer from a renderer plugin.
- Parameters:
-
[in] rendererName Name of the renderer plugin.
- Returns:
- The created renderer.
Definition at line 148 of file PCMOpenGLRenderingEngine.cpp.
References _registerRenderer(), Assert, ParCompMark::Singleton< T >::getInstance(), ParCompMark::Pointer< T, Lock >::getPtr(), ParCompMark::Process::getRenderWindow(), mParent, and ParCompMark::Plugin::RENDERER_PLUGIN.
Referenced by squirrelGlue().
Here is the call graph for this function:
u32 ParCompMark::OpenGLRenderingEngine::createDisplayList | ( | ) | [virtual] |
Create a new display list.
This will be the active list.
- Returns:
- Handle of the generated display list. This handle is needed for executing the generated list.
Definition at line 578 of file PCMOpenGLRenderingEngine.cpp.
References ParCompMark::OpenGLRenderingEngine::DisplayList::handle, mCurrentDisplayList, and mDisplayLists.
Referenced by squirrelGlue().
void ParCompMark::OpenGLRenderingEngine::doAutoRendering | ( | ) | [virtual] |
Automatically call render() methods of the custom renderers placed in the queue.
Definition at line 232 of file PCMOpenGLRenderingEngine.cpp.
References mAutoRenderingQueue.
void ParCompMark::OpenGLRenderingEngine::drawCube | ( | const double | size | ) | [virtual] |
Draw a cube.
- Parameters:
-
[in] size Specifies the size of the cube.
Definition at line 674 of file PCMOpenGLRenderingEngine.cpp.
References _reportTriangles(), Except, FILL, mDrawStyle, and WIRE.
Referenced by squirrelGlue().
Here is the call graph for this function:
void ParCompMark::OpenGLRenderingEngine::drawCylinder | ( | const double | baseRadius, | |
const double | topRadius, | |||
const double | height, | |||
const int | slices, | |||
const int | stacks | |||
) | [virtual] |
Draw a cylinder.
- Parameters:
-
[in] baseRadius Specifies the radius of the cylinder at z = 0. [in] topRadius Specifies the radius of the cylinder at z = height. [in] height Specifies the height of the cylinder. [in] slices Specifies the number of subdivisions around the z axis. [in] stacks Specifies the number of subdivisions along the z axis.
Definition at line 626 of file PCMOpenGLRenderingEngine.cpp.
References _setGLUDrawStyle().
Referenced by squirrelGlue().
Here is the call graph for this function:
void ParCompMark::OpenGLRenderingEngine::drawDisk | ( | const double | innerRadius, | |
const double | outerRadius, | |||
const int | slices, | |||
const int | loops | |||
) | [virtual] |
Draw a disk.
- Parameters:
-
[in] innerRadius Specifies the inner radius of the disk (may be 0). [in] outerRadius Specifies the outer radius of the disk. [in] slices Specifies the number of subdivisions around the z axis. [in] loops Specifies the number of concentric rings about the origin into which the disk is subdivided.
Definition at line 639 of file PCMOpenGLRenderingEngine.cpp.
References _setGLUDrawStyle().
Referenced by squirrelGlue().
Here is the call graph for this function:
void ParCompMark::OpenGLRenderingEngine::drawDodecahedron | ( | const double | size | ) | [virtual] |
Draw a dodecahedron.
- Parameters:
-
[in] size Specifies the size of the dodecahedron.
Definition at line 720 of file PCMOpenGLRenderingEngine.cpp.
References _reportTriangles(), Except, FILL, mDrawStyle, popModelView(), pushModelView(), scale(), and WIRE.
Referenced by squirrelGlue().
Here is the call graph for this function:
void ParCompMark::OpenGLRenderingEngine::drawIcosahedron | ( | const double | size | ) | [virtual] |
Draw an icosahedron.
- Parameters:
-
[in] size Specifies the size of the icosahedron.
Definition at line 802 of file PCMOpenGLRenderingEngine.cpp.
References _reportTriangles(), Except, FILL, mDrawStyle, popModelView(), pushModelView(), scale(), and WIRE.
Referenced by squirrelGlue().
Here is the call graph for this function:
void ParCompMark::OpenGLRenderingEngine::drawOctahedron | ( | const double | size | ) | [virtual] |
Draw an octahedron.
- Parameters:
-
[in] size Specifies the size of the octahedron.
Definition at line 748 of file PCMOpenGLRenderingEngine.cpp.
References _reportTriangles(), Except, FILL, mDrawStyle, popModelView(), pushModelView(), scale(), and WIRE.
Referenced by squirrelGlue().
Here is the call graph for this function:
void ParCompMark::OpenGLRenderingEngine::drawSphere | ( | const double | radius, | |
const int | slices, | |||
const int | stacks | |||
) | [virtual] |
Draw a sphere.
- Parameters:
-
[in] radius Specifies the radius of the sphere. [in] slices Specifies the number of subdivisions around the z axis (similar to lines of longitude). [in] stacks Specifies the number of subdivisions along the z axis (similar to lines of latitude).
Definition at line 614 of file PCMOpenGLRenderingEngine.cpp.
References _setGLUDrawStyle().
Referenced by squirrelGlue().
Here is the call graph for this function:
void ParCompMark::OpenGLRenderingEngine::drawTeapot | ( | const double | size | ) | [virtual] |
Draw a teapot.
- Parameters:
-
[in] size Specifies the size of the teapot.
Definition at line 652 of file PCMOpenGLRenderingEngine.cpp.
References Except, FILL, mDrawStyle, and WIRE.
Referenced by squirrelGlue().
void ParCompMark::OpenGLRenderingEngine::drawTetrahedron | ( | const double | size | ) | [virtual] |
Draw a tetrahedron.
- Parameters:
-
[in] size Specifies the size of the tetrahedron.
Definition at line 774 of file PCMOpenGLRenderingEngine.cpp.
References _reportTriangles(), Except, FILL, mDrawStyle, popModelView(), pushModelView(), scale(), and WIRE.
Referenced by squirrelGlue().
Here is the call graph for this function:
void ParCompMark::OpenGLRenderingEngine::drawTorus | ( | const double | innerRadius, | |
const double | outerRadius, | |||
const int | nsides, | |||
const int | rings | |||
) | [virtual] |
Draw a torus.
- Parameters:
-
[in] innerRadius Specifies the inner radius of the torus. [in] outerRadius Specifies the outer radius of the torus. [in] nsides Number of sides for each radial section. [in] rings Number of radial divisions for the torus.
Definition at line 697 of file PCMOpenGLRenderingEngine.cpp.
References Except, FILL, mDrawStyle, and WIRE.
Referenced by squirrelGlue().
void ParCompMark::OpenGLRenderingEngine::drawTriangle | ( | ) | [virtual] |
Draw a triangle width (0,1,0), (0,0,0), (1,0,0) vertices.
Definition at line 420 of file PCMOpenGLRenderingEngine.cpp.
References _reportTriangles().
Referenced by squirrelGlue().
Here is the call graph for this function:
void ParCompMark::OpenGLRenderingEngine::executeDisplayList | ( | const u32 | displayList | ) | [virtual] |
Execute the specified display list.
- Parameters:
-
[in] displayList Handle of display list to execute.
Definition at line 603 of file PCMOpenGLRenderingEngine.cpp.
References Assert, ParCompMark::Process::getRenderWindow(), mDisplayLists, and mParent.
Referenced by squirrelGlue().
Here is the call graph for this function:
void ParCompMark::OpenGLRenderingEngine::finishDisplayList | ( | ) | [virtual] |
Finish the active display list.
Definition at line 595 of file PCMOpenGLRenderingEngine.cpp.
References mCurrentDisplayList.
Referenced by squirrelGlue().
int ParCompMark::OpenGLRenderingEngine::generateRandomTriangles | ( | const int | dimension, | |
const int | count | |||
) | [virtual] |
Generate certain number of 2D or 3D triangles with random coordinates.
The vertex coordinates are in the [0..1] interval. Use translate(), rotate(), and scale() methods to modify this square (2D) and cube (3D).
- Parameters:
-
[in] dimension 2 or 3 means 2D and 3D triangles. [in] count Triangle count.
- Returns:
- Handle of the generated triangle set. This handle is needed for rendering.
Definition at line 433 of file PCMOpenGLRenderingEngine.cpp.
References _registerObject(), Assert, ParCompMark::Timer::getSystemTime(), ParCompMark::OpenGLRenderingEngine::ObjectData::normals, ParCompMark::OpenGLRenderingEngine::ObjectData::texCoordinates, ParCompMark::OpenGLRenderingEngine::ObjectData::texSize, ParCompMark::OpenGLRenderingEngine::ObjectData::vertexCoordinates, ParCompMark::OpenGLRenderingEngine::ObjectData::vertexCount, and ParCompMark::OpenGLRenderingEngine::ObjectData::vertexSize.
Referenced by squirrelGlue().
Here is the call graph for this function:
const OpenGLRenderingEngine::Camera & ParCompMark::OpenGLRenderingEngine::getCamera | ( | ) | const [inline] |
Getter of mCamera.
Returns value of mCamera.
- Returns:
- The value of mCamera
Definition at line 862 of file PCMOpenGLRenderingEngine.h.
const OpenGLRenderingEngine::DrawStyle & ParCompMark::OpenGLRenderingEngine::getDrawStyle | ( | ) | const [inline] |
Getter of mDrawStyle.
Returns value of mDrawStyle.
- Returns:
- The value of mDrawStyle
Definition at line 869 of file PCMOpenGLRenderingEngine.h.
Process * ParCompMark::OpenGLRenderingEngine::getParent | ( | ) | const [inline] |
Getter of mParent.
Returns value of mParent.
- Returns:
- The value of mParent
Definition at line 855 of file PCMOpenGLRenderingEngine.h.
Referenced by ParCompMark::RendererPlugin::_bufferGetter().
s32 ParCompMark::OpenGLRenderingEngine::getSortOrderFromRenderers | ( | ) | [virtual] |
Get alpha sorting order from renderers on this rendering engine.
If the corresponding renderer plugin has pcmOnResize
function, it will be called otherwise -1 is returned. Note: -1 is also returned when the sorting order can not be specified by the plugin.
- Returns:
- Sort order or -1 if it can not be calculated.
Definition at line 182 of file PCMOpenGLRenderingEngine.cpp.
References Except, and mRenderers.
void ParCompMark::OpenGLRenderingEngine::ortho2D | ( | const double | left, | |
const double | right, | |||
const double | bottom, | |||
const double | top | |||
) | [virtual] |
Define a 2D orthographic projection.
- Parameters:
-
[in] left Specifies the coordinate for the left vertical clipping plane. [in] right Specifies the coordinate for the right vertical clipping plane. [in] bottom Specifies the coordinate for the bottom horizontal clipping plane. [in] top Specifies the coordinate for the top horizontal clipping plane.
Definition at line 251 of file PCMOpenGLRenderingEngine.cpp.
Referenced by squirrelGlue().
void ParCompMark::OpenGLRenderingEngine::perspective | ( | const double | fovy, | |
const double | zNear, | |||
const double | zFar | |||
) | [virtual] |
Set perspective projection.
- Parameters:
-
[in] fovy Specifies the field of view angle, in degrees, in the y direction. [in] zNear Specifies the distance from the viewer to the near clipping plane (always positive). [in] zFar Specifies the distance from the viewer to the far clipping plane (always positive).
Definition at line 240 of file PCMOpenGLRenderingEngine.cpp.
References ParCompMark::Process::getRenderWindow(), and mParent.
Referenced by squirrelGlue().
Here is the call graph for this function:
void ParCompMark::OpenGLRenderingEngine::popModelView | ( | ) | [virtual] |
Pop the modelview matrix from the matrix stack.
Definition at line 282 of file PCMOpenGLRenderingEngine.cpp.
Referenced by drawDodecahedron(), drawIcosahedron(), drawOctahedron(), drawTetrahedron(), and squirrelGlue().
void ParCompMark::OpenGLRenderingEngine::pushModelView | ( | ) | [virtual] |
Push the modelview matrix on the matrix stack.
Definition at line 274 of file PCMOpenGLRenderingEngine.cpp.
Referenced by drawDodecahedron(), drawIcosahedron(), drawOctahedron(), drawTetrahedron(), and squirrelGlue().
void ParCompMark::OpenGLRenderingEngine::removeLightSources | ( | ) | [virtual] |
Remove all light sources.
Definition at line 521 of file PCMOpenGLRenderingEngine.cpp.
References mLightCount.
Referenced by squirrelGlue().
void ParCompMark::OpenGLRenderingEngine::renderObject | ( | const u32 | handle, | |
const bool | useVertexArrays | |||
) | [virtual] |
Render the object with the specified handle.
- Parameters:
-
[in] handle Handle of object to render. [in] useVertexArrays Use vertex arrays for rendering.
Definition at line 493 of file PCMOpenGLRenderingEngine.cpp.
References _renderObject(), mObjectData, and ParCompMark::OpenGLRenderingEngine::ObjectData::vertexCount.
Referenced by squirrelGlue().
Here is the call graph for this function:
void ParCompMark::OpenGLRenderingEngine::renderObjectTriangles | ( | const u32 | handle, | |
const bool | useVertexArrays, | |||
const u32 | triangleCount | |||
) | [virtual] |
Render specified number of triangles from an object with the given handle.
- Parameters:
-
[in] handle Handle of object to render. [in] useVertexArrays Use vertex arrays for rendering. [in] triangleCount Number of triangles.
Definition at line 502 of file PCMOpenGLRenderingEngine.cpp.
References _renderObject().
Referenced by squirrelGlue().
Here is the call graph for this function:
void ParCompMark::OpenGLRenderingEngine::resizeRenderers | ( | const u32 | width, | |
const u32 | height | |||
) | [virtual] |
Resize the canvas of all renderers belongs to this rendering engine.
The pcmOnResize
event handler method of the renderers will be called.
- Parameters:
-
[in] width New canvas width. [in] height New canvas height.
Definition at line 172 of file PCMOpenGLRenderingEngine.cpp.
References mRenderers.
void ParCompMark::OpenGLRenderingEngine::rotate | ( | const double | angle, | |
const double | x, | |||
const double | y, | |||
const double | z | |||
) | [virtual] |
Rotate the modelview matrix.
- Parameters:
-
[in] angle Rotation angle in degrees. [in] x X coordinate of the rotation vector. [in] y Y coordinate of the rotation vector. [in] z Z coordinate of the rotation vector.
Definition at line 298 of file PCMOpenGLRenderingEngine.cpp.
Referenced by squirrelGlue().
void ParCompMark::OpenGLRenderingEngine::scale | ( | const double | x, | |
const double | y, | |||
const double | z | |||
) | [virtual] |
Scale the modelview matrix.
- Parameters:
-
[in] x X coordinate of the scale vector. [in] y Y coordinate of the scale vector. [in] z Z coordinate of the scale vector.
Definition at line 307 of file PCMOpenGLRenderingEngine.cpp.
Referenced by drawDodecahedron(), drawIcosahedron(), drawOctahedron(), drawTetrahedron(), and squirrelGlue().
void ParCompMark::OpenGLRenderingEngine::setAmbientLight | ( | const double | red, | |
const double | green, | |||
const double | blue, | |||
const double | alpha | |||
) | [virtual] |
Set global ambient light parameters.
- Parameters:
-
[in] red Red component. [in] green Green component. [in] blue Blue component. [in] alpha Alpha component.
Definition at line 510 of file PCMOpenGLRenderingEngine.cpp.
Referenced by squirrelGlue().
void ParCompMark::OpenGLRenderingEngine::setAmbientMaterial | ( | const double | red, | |
const double | green, | |||
const double | blue, | |||
const double | alpha | |||
) | [virtual] |
Set ambient material color.
- Parameters:
-
[in] red Red component. [in] green Green component. [in] blue Blue component. [in] alpha Alpha component.
Definition at line 356 of file PCMOpenGLRenderingEngine.cpp.
Referenced by squirrelGlue().
void ParCompMark::OpenGLRenderingEngine::setAutoRenderOrder | ( | const Renderer * | renderer, | |
const s32 & | order | |||
) | [virtual] |
Set automatic rendering order for the specified renderer.
If Renderer::NOAUTORENDERING is specified as order, the renderer will be removed from the queue.
- Parameters:
-
[in] renderer The renderer to place into the queue (or remove). [in] order Order in the rendering queue.
Definition at line 205 of file PCMOpenGLRenderingEngine.cpp.
References Assert, mAutoRenderingQueue, mRenderers, and ParCompMark::Renderer::NOAUTORENDERING.
void ParCompMark::OpenGLRenderingEngine::setBackCulling | ( | const bool | isBackCulling | ) | [virtual] |
Specify whether back-facing facets can be culled.
- Parameters:
-
[in] isBackCulling Back culling is on.
Definition at line 392 of file PCMOpenGLRenderingEngine.cpp.
Referenced by squirrelGlue().
void ParCompMark::OpenGLRenderingEngine::setBlending | ( | const bool | isOn | ) | [virtual] |
Turn on/off blending.
- Parameters:
-
[in] isOn Blending is on.
Definition at line 404 of file PCMOpenGLRenderingEngine.cpp.
Referenced by squirrelGlue().
void ParCompMark::OpenGLRenderingEngine::setCameraPosition | ( | const double | eyeX, | |
const double | eyeY, | |||
const double | eyeZ | |||
) | [virtual] |
Set camera position.
- Parameters:
-
[in] eyeX Specifies the X coordinate of position of the eye point. [in] eyeY Specifies the Y coordinate of position of the eye point. [in] eyeZ Specifies the Z coordinate of position of the eye point.
Definition at line 315 of file PCMOpenGLRenderingEngine.cpp.
References _refreshCamera(), mCamera, and ParCompMark::OpenGLRenderingEngine::Camera::position.
Referenced by squirrelGlue().
Here is the call graph for this function:
void ParCompMark::OpenGLRenderingEngine::setCameraTarget | ( | const double | centerX, | |
const double | centerY, | |||
const double | centerZ | |||
) | [virtual] |
Set position of camera target.
- Parameters:
-
[in] centerX Specifies the X coordinate of position of the reference point. [in] centerY Specifies the Y coordinate of position of the reference point. [in] centerZ Specifies the Z coordinate of position of the reference point.
Definition at line 326 of file PCMOpenGLRenderingEngine.cpp.
References _refreshCamera(), mCamera, and ParCompMark::OpenGLRenderingEngine::Camera::target.
Referenced by squirrelGlue().
Here is the call graph for this function:
void ParCompMark::OpenGLRenderingEngine::setCameraUpVector | ( | const double | upX, | |
const double | upY, | |||
const double | upZ | |||
) | [virtual] |
Set up vector of the camera.
- Parameters:
-
[in] upX Specifies the X coordinate of the direction of the up vector. [in] upY Specifies the Y coordinate of the direction of the up vector. [in] upZ Specifies the Z coordinate of the direction of the up vector.
Definition at line 337 of file PCMOpenGLRenderingEngine.cpp.
References _refreshCamera(), mCamera, and ParCompMark::OpenGLRenderingEngine::Camera::upVector.
Referenced by squirrelGlue().
Here is the call graph for this function:
void ParCompMark::OpenGLRenderingEngine::setColor | ( | const double | red, | |
const double | green, | |||
const double | blue, | |||
const double | alpha | |||
) | [virtual] |
Set drawing color.
- Parameters:
-
[in] red Red component. [in] green Green component. [in] blue Blue component. [in] alpha Alpha component.
Definition at line 348 of file PCMOpenGLRenderingEngine.cpp.
Referenced by squirrelGlue().
void ParCompMark::OpenGLRenderingEngine::setDiffuseMaterial | ( | const double | red, | |
const double | green, | |||
const double | blue, | |||
const double | alpha | |||
) | [virtual] |
Set diffuse material color.
- Parameters:
-
[in] red Red component. [in] green Green component. [in] blue Blue component. [in] alpha Alpha component.
Definition at line 365 of file PCMOpenGLRenderingEngine.cpp.
Referenced by squirrelGlue().
void ParCompMark::OpenGLRenderingEngine::setDrawStyle | ( | const unsigned | drawStyle | ) | [virtual] |
Set drawing color.
- Parameters:
-
[in] drawStyle Draw style code.
Definition at line 385 of file PCMOpenGLRenderingEngine.cpp.
References mDrawStyle.
Referenced by squirrelGlue().
void ParCompMark::OpenGLRenderingEngine::setLightSourceDiffuse | ( | const int | light, | |
const double | red, | |||
const double | green, | |||
const double | blue, | |||
const double | alpha | |||
) | [virtual] |
Set diffuse light parameters for the specified light source.
- Parameters:
-
[in] light Handle of the light. [in] red Red component. [in] green Green component. [in] blue Blue component. [in] alpha Alpha component.
Definition at line 558 of file PCMOpenGLRenderingEngine.cpp.
Referenced by addLightSource(), and squirrelGlue().
void ParCompMark::OpenGLRenderingEngine::setLightSourcePosition | ( | const int | light, | |
const double | x, | |||
const double | y, | |||
const double | z | |||
) | [virtual] |
Set position of the specified light source.
- Parameters:
-
[in] light Handle of the light. [in] x X coordinate. [in] y Y coordinate. [in] z Z coordinate.
Definition at line 548 of file PCMOpenGLRenderingEngine.cpp.
Referenced by addLightSource(), and squirrelGlue().
void ParCompMark::OpenGLRenderingEngine::setLightSourceSpecular | ( | const int | light, | |
const double | red, | |||
const double | green, | |||
const double | blue, | |||
const double | alpha | |||
) | [virtual] |
Set specular light parameters for the specified light source.
- Parameters:
-
[in] light Handle of the light. [in] red Red component. [in] green Green component. [in] blue Blue component. [in] alpha Alpha component.
Definition at line 568 of file PCMOpenGLRenderingEngine.cpp.
Referenced by addLightSource(), and squirrelGlue().
void ParCompMark::OpenGLRenderingEngine::setSpecularMaterial | ( | const double | red, | |
const double | green, | |||
const double | blue, | |||
const double | alpha, | |||
const int | shininess | |||
) | [virtual] |
Set specular material color.
- Parameters:
-
[in] red Red component. [in] green Green component. [in] blue Blue component. [in] alpha Alpha component. [in] shininess Shininess value.
Definition at line 374 of file PCMOpenGLRenderingEngine.cpp.
Referenced by squirrelGlue().
static void ParCompMark::OpenGLRenderingEngine::squirrelGlue | ( | ) | [inline, static] |
Static glue code method for Squirrel-C++ binding.
This method should be call from each Squirrel virtual machines to generate the proper Squirrel glue code. To content of this method is fully autogenerated in the header implementation file, you should not modify it.
Definition at line 93 of file PCMOpenGLRenderingEngine.h.
References addLightSource(), create(), createCustomRenderer(), createDisplayList(), drawCube(), drawCylinder(), drawDisk(), drawDodecahedron(), drawIcosahedron(), drawOctahedron(), drawSphere(), drawTeapot(), drawTetrahedron(), drawTorus(), drawTriangle(), executeDisplayList(), finishDisplayList(), generateRandomTriangles(), ortho2D(), perspective(), popModelView(), pushModelView(), removeLightSources(), renderObject(), renderObjectTriangles(), rotate(), scale(), setAmbientLight(), setAmbientMaterial(), setBackCulling(), setBlending(), setCameraPosition(), setCameraTarget(), setCameraUpVector(), setColor(), setDiffuseMaterial(), setDrawStyle(), setLightSourceDiffuse(), setLightSourcePosition(), setLightSourceSpecular(), setSpecularMaterial(), translate(), and viewport().
Referenced by ParCompMark::squirrelClassBindings().
Here is the call graph for this function:
void ParCompMark::OpenGLRenderingEngine::translate | ( | const double | x, | |
const double | y, | |||
const double | z | |||
) | [virtual] |
Translate the modelview matrix.
- Parameters:
-
[in] x X coordinate of the translation vector. [in] y Y coordinate of the translation vector. [in] z Z coordinate of the translation vector.
Definition at line 290 of file PCMOpenGLRenderingEngine.cpp.
Referenced by squirrelGlue().
void ParCompMark::OpenGLRenderingEngine::viewport | ( | const double | left, | |
const double | top, | |||
const double | width, | |||
const double | height | |||
) | [virtual] |
Set viewport with window relative coordinates (0.0 .
. 1.0).
- Parameters:
-
[in] left Left coordinate of the viewport. [in] top Top coordinate of the viewport. [in] width Width of the viewport. [in] height Height of the viewport.
Definition at line 261 of file PCMOpenGLRenderingEngine.cpp.
References ParCompMark::Process::getRenderWindow(), and mParent.
Referenced by squirrelGlue().
Here is the call graph for this function:
Member Data Documentation
std::vector< Renderer * > ParCompMark::OpenGLRenderingEngine::mAutoRenderingQueue [protected] |
Automatic rendering queue for custom renderers.
- Remarks:
- This is own attribute of this class.
Definition at line 289 of file PCMOpenGLRenderingEngine.h.
Referenced by doAutoRendering(), and setAutoRenderOrder().
Camera ParCompMark::OpenGLRenderingEngine::mCamera [protected] |
Camera of this rendering engine.
- Remarks:
- This is own attribute of this class.
Definition at line 268 of file PCMOpenGLRenderingEngine.h.
Referenced by _refreshCamera(), setCameraPosition(), setCameraTarget(), and setCameraUpVector().
Pointer to the current display list.
- Remarks:
- This attribute references an attribute.
Definition at line 310 of file PCMOpenGLRenderingEngine.h.
Referenced by _reportTriangles(), createDisplayList(), finishDisplayList(), and OpenGLRenderingEngine().
std::vector< DisplayList * > ParCompMark::OpenGLRenderingEngine::mDisplayLists [protected] |
Display lists on this rendering engine.
- Remarks:
- This is own attribute of this class.
Definition at line 303 of file PCMOpenGLRenderingEngine.h.
Referenced by createDisplayList(), executeDisplayList(), and ~OpenGLRenderingEngine().
Drawing style for primitives.
- Remarks:
- This is own attribute of this class.
Definition at line 275 of file PCMOpenGLRenderingEngine.h.
Referenced by _setGLUDrawStyle(), drawCube(), drawDodecahedron(), drawIcosahedron(), drawOctahedron(), drawTeapot(), drawTetrahedron(), drawTorus(), OpenGLRenderingEngine(), and setDrawStyle().
u32 ParCompMark::OpenGLRenderingEngine::mLightCount [protected] |
Number of lights.
- Remarks:
- This attribute references an attribute.
Definition at line 317 of file PCMOpenGLRenderingEngine.h.
Referenced by addLightSource(), OpenGLRenderingEngine(), and removeLightSources().
std::vector< ObjectData > ParCompMark::OpenGLRenderingEngine::mObjectData [protected] |
Data of objects can be rendered on this rendering engine.
- Remarks:
- This is own attribute of this class.
Definition at line 296 of file PCMOpenGLRenderingEngine.h.
Referenced by _registerObject(), _renderObject(), renderObject(), and ~OpenGLRenderingEngine().
Process* ParCompMark::OpenGLRenderingEngine::mParent [protected] |
Parent process of the rendering engine.
- Remarks:
- This attribute references an attribute.
Definition at line 261 of file PCMOpenGLRenderingEngine.h.
Referenced by _reportTriangles(), createCustomRenderer(), executeDisplayList(), perspective(), viewport(), and ~OpenGLRenderingEngine().
std::set< Renderer * > ParCompMark::OpenGLRenderingEngine::mRenderers [protected] |
Custom renderers used with this rendering engine.
- Remarks:
- This is own attribute of this class.
Definition at line 282 of file PCMOpenGLRenderingEngine.h.
Referenced by _registerRenderer(), getSortOrderFromRenderers(), resizeRenderers(), and setAutoRenderOrder().
The documentation for this class was generated from the following files: