OpenGL render system. This renderer supports OpenGL 1.1 - 4.1. More...
#include <spOpenGLRenderSystem.hpp>
Classes | |
struct | SX11FontPackage |
Public Member Functions | |
OpenGLRenderSystem () | |
~OpenGLRenderSystem () | |
void | setupConfiguration () |
bool | queryVideoSupport (const EVideoFeatureQueries Query) const |
Returns true if the specified feature is supported by the renderer. | |
void | setAntiAlias (bool isAntiAlias) |
Enables or disables anti-aliasing or multi-sampling. | |
void | setDepthClip (bool Enable) |
Enables or disables depth clipping. By default enabled. | |
void | setStencilMask (u32 BitMask) |
Sets the bit-mask for the stencil buffer. This enables or disables individual bits in the stencil buffer to be written. | |
void | setStencilMethod (const ESizeComparisionTypes Method, s32 Reference=0, u32 BitMask=~0) |
void | setStencilOperation (const EStencilOperations FailOp, const EStencilOperations ZFailOp, const EStencilOperations ZPassOp) |
void | setClearStencil (s32 Stencil) |
Sets the stencil clear value. The default value is zero. | |
bool | setupMaterialStates (const MaterialStates *Material, bool Forced=false) |
void | endSceneRendering () |
Ends with scene rendering. Always call this after rendering mesh buffers. | |
void | drawMeshBuffer (const MeshBuffer *MeshBuffer) |
Renders the given hardware mesh buffer. | |
void | drawMeshBufferPlain (const MeshBuffer *MeshBuffer, bool useFirstTextureLayer=false) |
Shader * | createCgShader (ShaderClass *ShaderClassObj, const EShaderTypes Type, const EShaderVersions Version, const std::list< io::stringc > &ShaderBuffer, const io::stringc &EntryPoint="", const c8 **CompilerOptions=0) |
void | draw2DImage (const Texture *Tex, const dim::point2di &Position, const color &Color=color(255)) |
void | draw2DImage (const Texture *Tex, const dim::rect2di &Position, const dim::rect2df &Clipping=dim::rect2df(0.0f, 0.0f, 1.0f, 1.0f), const color &Color=color(255)) |
void | draw2DImage (const Texture *Tex, const dim::point2di &Position, f32 Rotation, f32 Radius, const color &Color=color(255)) |
void | draw2DImage (const Texture *Tex, const dim::point2di &lefttopPosition, const dim::point2di &righttopPosition, const dim::point2di &rightbottomPosition, const dim::point2di &leftbottomPosition, const dim::point2df &lefttopClipping=dim::point2df(0.0f, 0.0f), const dim::point2df &righttopClipping=dim::point2df(1.0f, 0.0f), const dim::point2df &rightbottomClipping=dim::point2df(1.0f, 1.0f), const dim::point2df &leftbottomClipping=dim::point2df(0.0f, 1.0f), const color &lefttopColor=color(255), const color &righttopColor=color(255), const color &rightbottomColor=color(255), const color &leftbottomColor=color(255)) |
Draws an individual positionable 2D image. | |
f32 | getPixelDepth (const dim::point2di &Position) const |
void | draw2DPoint (const dim::point2di &Position, const color &Color=255) |
Draws a 2D point at the specified position in screen space. | |
void | draw2DLine (const dim::point2di &PositionA, const dim::point2di &PositionB, const color &Color=255) |
Draws a 2D line at the specified position (PositionA to PositionB). | |
void | draw2DLine (const dim::point2di &PositionA, const dim::point2di &PositionB, const color &ColorA, const color &ColorB) |
Draws a 2D line with a color change-over (ColorA to ColorB). | |
void | draw2DRectangle (const dim::rect2di &Rect, const color &Color=255, bool isSolid=true) |
void | draw2DRectangle (const dim::rect2di &Rect, const color &lefttopColor, const color &righttopColor, const color &rightbottomColor, const color &leftbottomColor, bool isSolid=true) |
Draws a 2D rectangle or quad with color change-overs. | |
void | draw2DPolygon (const ERenderPrimitives Type, const scene::SPrimitiveVertex2D *VerticesList, u32 Count) |
void | draw3DPoint (const dim::vector3df &Position, const color &Color=255) |
void | draw3DLine (const dim::vector3df &PositionA, const dim::vector3df &PositionB, const color &Color=255) |
void | draw3DLine (const dim::vector3df &PositionA, const dim::vector3df &PositionB, const color &ColorA, const color &ColorB) |
void | draw3DEllipse (const dim::vector3df &Position, const dim::vector3df &Rotation=0.0f, const dim::size2df &Radius=0.5f, const color &Color=255) |
void | draw3DTriangle (Texture *hTexture, const dim::triangle3df &Triangle, const color &Color=255) |
Font * | createBitmapFont (const io::stringc &FontName="", s32 FontSize=0, s32 Flags=0) |
void | draw3DText (Font *FontObj, const dim::matrix4f &Transformation, const io::stringc &Text, const color &Color=color(255)) |
void | setColorMatrix (const dim::matrix4f &Matrix) |
Friends | |
class | OpenGLTexture |
OpenGL render system. This renderer supports OpenGL 1.1 - 4.1.
sp::video::OpenGLRenderSystem::OpenGLRenderSystem | ( | ) |
sp::video::OpenGLRenderSystem::~OpenGLRenderSystem | ( | ) |
Font* sp::video::OpenGLRenderSystem::createBitmapFont | ( | const io::stringc & | FontName = "" , |
|
s32 | FontSize = 0 , |
|||
s32 | Flags = 0 | |||
) | [virtual] |
Reimplemented from sp::video::RenderSystem.
Shader* sp::video::OpenGLRenderSystem::createCgShader | ( | ShaderClass * | ShaderClassObj, | |
const EShaderTypes | Type, | |||
const EShaderVersions | Version, | |||
const std::list< io::stringc > & | ShaderBuffer, | |||
const io::stringc & | EntryPoint = "" , |
|||
const c8 ** | CompilerOptions = 0 | |||
) | [virtual] |
Creates a Cg shader.
CompilerOptions,: | Specifies the compiler options. Invalid options may occur a runtime crash! So be careful with this option. Look at the Cg documentation to see the full list of supported compiler options. The last options in the array must be a null. |
Reimplemented from sp::video::RenderSystem.
void sp::video::OpenGLRenderSystem::draw2DImage | ( | const Texture * | Tex, | |
const dim::point2di & | Position, | |||
f32 | Rotation, | |||
f32 | Radius, | |||
const color & | Color = color(255) | |||
) | [virtual] |
Draws a rotatable 2D image.
Rotation,: | Angle (in degrees) for the centered image rotation. | |
Radius,: | Radius for the square image. |
Reimplemented from sp::video::RenderSystem.
void sp::video::OpenGLRenderSystem::draw2DImage | ( | const Texture * | Tex, | |
const dim::point2di & | lefttopPosition, | |||
const dim::point2di & | righttopPosition, | |||
const dim::point2di & | rightbottomPosition, | |||
const dim::point2di & | leftbottomPosition, | |||
const dim::point2df & | lefttopClipping = dim::point2df(0.0f, 0.0f) , |
|||
const dim::point2df & | righttopClipping = dim::point2df(1.0f, 0.0f) , |
|||
const dim::point2df & | rightbottomClipping = dim::point2df(1.0f, 1.0f) , |
|||
const dim::point2df & | leftbottomClipping = dim::point2df(0.0f, 1.0f) , |
|||
const color & | lefttopColor = color(255) , |
|||
const color & | righttopColor = color(255) , |
|||
const color & | rightbottomColor = color(255) , |
|||
const color & | leftbottomColor = color(255) | |||
) | [virtual] |
Draws an individual positionable 2D image.
Reimplemented from sp::video::RenderSystem.
void sp::video::OpenGLRenderSystem::draw2DImage | ( | const Texture * | Tex, | |
const dim::point2di & | Position, | |||
const color & | Color = color(255) | |||
) | [virtual] |
Draws a normal 2D image using the specified texture.
Tex,: | Texture which is to be used. No settings are needed to be done to draw 2 dimensional with normal Texture objects. | |
Position,: | 2D position in screen space where the image is to be drawn. | |
Color,: | Color which the image shall get. |
Reimplemented from sp::video::RenderSystem.
void sp::video::OpenGLRenderSystem::draw2DImage | ( | const Texture * | Tex, | |
const dim::rect2di & | Position, | |||
const dim::rect2df & | Clipping = dim::rect2df(0.0f, 0.0f, 1.0f, 1.0f) , |
|||
const color & | Color = color(255) | |||
) | [virtual] |
Draws a strechted and mapped 2D image.
Position,: | 2D area in screen space. In this case the two parameters of rect2di ("Right" and "Bottom") specifie the size (width and height). | |
Clipping,: | 2D mapping or clipping area. This specifies the texture coordinates for the quad. |
Reimplemented from sp::video::RenderSystem.
void sp::video::OpenGLRenderSystem::draw2DLine | ( | const dim::point2di & | PositionA, | |
const dim::point2di & | PositionB, | |||
const color & | Color = 255 | |||
) | [virtual] |
Draws a 2D line at the specified position (PositionA to PositionB).
Reimplemented from sp::video::RenderSystem.
void sp::video::OpenGLRenderSystem::draw2DLine | ( | const dim::point2di & | PositionA, | |
const dim::point2di & | PositionB, | |||
const color & | ColorA, | |||
const color & | ColorB | |||
) | [virtual] |
Draws a 2D line with a color change-over (ColorA to ColorB).
Reimplemented from sp::video::RenderSystem.
void sp::video::OpenGLRenderSystem::draw2DPoint | ( | const dim::point2di & | Position, | |
const color & | Color = 255 | |||
) | [virtual] |
Draws a 2D point at the specified position in screen space.
Reimplemented from sp::video::RenderSystem.
void sp::video::OpenGLRenderSystem::draw2DPolygon | ( | const ERenderPrimitives | Type, | |
const scene::SPrimitiveVertex2D * | VerticesList, | |||
u32 | Count | |||
) | [virtual] |
Reimplemented from sp::video::RenderSystem.
void sp::video::OpenGLRenderSystem::draw2DRectangle | ( | const dim::rect2di & | Rect, | |
const color & | Color = 255 , |
|||
bool | isSolid = true | |||
) | [virtual] |
Draws a 2D rectangle or quad.
Rect,: | 2D area in screen space. | |
Color,: | Color which is to be used for the rectangle. | |
isSolid,: | If true the rectangle is filled. Otherwise four lines will be drawn. |
Reimplemented from sp::video::RenderSystem.
void sp::video::OpenGLRenderSystem::draw2DRectangle | ( | const dim::rect2di & | Rect, | |
const color & | lefttopColor, | |||
const color & | righttopColor, | |||
const color & | rightbottomColor, | |||
const color & | leftbottomColor, | |||
bool | isSolid = true | |||
) | [virtual] |
Draws a 2D rectangle or quad with color change-overs.
Reimplemented from sp::video::RenderSystem.
void sp::video::OpenGLRenderSystem::draw3DEllipse | ( | const dim::vector3df & | Position, | |
const dim::vector3df & | Rotation = 0.0f , |
|||
const dim::size2df & | Radius = 0.5f , |
|||
const color & | Color = 255 | |||
) | [virtual] |
Reimplemented from sp::video::RenderSystem.
void sp::video::OpenGLRenderSystem::draw3DLine | ( | const dim::vector3df & | PositionA, | |
const dim::vector3df & | PositionB, | |||
const color & | Color = 255 | |||
) | [virtual] |
Reimplemented from sp::video::RenderSystem.
void sp::video::OpenGLRenderSystem::draw3DLine | ( | const dim::vector3df & | PositionA, | |
const dim::vector3df & | PositionB, | |||
const color & | ColorA, | |||
const color & | ColorB | |||
) | [virtual] |
Reimplemented from sp::video::RenderSystem.
void sp::video::OpenGLRenderSystem::draw3DPoint | ( | const dim::vector3df & | Position, | |
const color & | Color = 255 | |||
) | [virtual] |
Reimplemented from sp::video::RenderSystem.
void sp::video::OpenGLRenderSystem::draw3DText | ( | Font * | FontObj, | |
const dim::matrix4f & | Transformation, | |||
const io::stringc & | Text, | |||
const color & | Color = color(255) | |||
) |
void sp::video::OpenGLRenderSystem::draw3DTriangle | ( | Texture * | hTexture, | |
const dim::triangle3df & | Triangle, | |||
const color & | Color = 255 | |||
) | [virtual] |
Reimplemented from sp::video::RenderSystem.
void sp::video::OpenGLRenderSystem::drawMeshBuffer | ( | const MeshBuffer * | MeshBuffer | ) | [virtual] |
Renders the given hardware mesh buffer.
Implements sp::video::RenderSystem.
void sp::video::OpenGLRenderSystem::drawMeshBufferPlain | ( | const MeshBuffer * | MeshBuffer, | |
bool | useFirstTextureLayer = false | |||
) | [virtual] |
Renders only the plain geometry of the given hardware mesh buffer. No normals for lighting, no tex-coords for texture mapping, no fog-coord etc. This can be used to render fast shadow- or depth maps.
MeshBuffer,: | Specifies the hardware mesh buffer which is to be drawn. | |
useFirstTextureLayer,: | Specifies whether the first texture layer is to be bound or not. This can be used when the mesh buffer has a transparent color texture and you want to perform alpha-testing. |
Reimplemented from sp::video::RenderSystem.
void sp::video::OpenGLRenderSystem::endSceneRendering | ( | ) | [virtual] |
Ends with scene rendering. Always call this after rendering mesh buffers.
Reimplemented from sp::video::RenderSystem.
f32 sp::video::OpenGLRenderSystem::getPixelDepth | ( | const dim::point2di & | Position | ) | const [virtual] |
Reimplemented from sp::video::RenderSystem.
bool sp::video::OpenGLRenderSystem::queryVideoSupport | ( | const EVideoFeatureQueries | Query | ) | const [virtual] |
Returns true if the specified feature is supported by the renderer.
Implements sp::video::RenderSystem.
void sp::video::OpenGLRenderSystem::setAntiAlias | ( | bool | isAntiAlias | ) | [virtual] |
Enables or disables anti-aliasing or multi-sampling.
Reimplemented from sp::video::RenderSystem.
void sp::video::OpenGLRenderSystem::setClearStencil | ( | s32 | Stencil | ) | [virtual] |
Sets the stencil clear value. The default value is zero.
Reimplemented from sp::video::RenderSystem.
void sp::video::OpenGLRenderSystem::setColorMatrix | ( | const dim::matrix4f & | Matrix | ) | [virtual] |
Reimplemented from sp::video::RenderSystem.
void sp::video::OpenGLRenderSystem::setDepthClip | ( | bool | Enable | ) | [virtual] |
Enables or disables depth clipping. By default enabled.
Reimplemented from sp::video::RenderSystem.
void sp::video::OpenGLRenderSystem::setStencilMask | ( | u32 | BitMask | ) | [virtual] |
Sets the bit-mask for the stencil buffer. This enables or disables individual bits in the stencil buffer to be written.
Reimplemented from sp::video::RenderSystem.
void sp::video::OpenGLRenderSystem::setStencilMethod | ( | const ESizeComparisionTypes | Method, | |
s32 | Reference = 0 , |
|||
u32 | BitMask = ~0 | |||
) | [virtual] |
Sets the stencil buffer method.
[in] | Method | Specifies the size comparision type. This is similiar to the "setDepthMethod" function in the "MaterialStates" class. |
[in] | Reference | Specifies the stencil reference value which will be used for the "STENCIL_REPLACE" stencil operation. By default zero. |
[in] | BitMask | Specifies the stencil buffer bit mask. By default 0xFFFFFFFF. |
Reimplemented from sp::video::RenderSystem.
void sp::video::OpenGLRenderSystem::setStencilOperation | ( | const EStencilOperations | FailOp, | |
const EStencilOperations | ZFailOp, | |||
const EStencilOperations | ZPassOp | |||
) | [virtual] |
Sets the stencil buffer operations.
[in] | FailOp | Specifies the operation which is to be executed when the stencil test fails. The default value is STENCIL_KEEP. |
[in] | ZFailOp | Specifies the operation which is to be executed when the stencil test succeeds but the z-buffer test fails. The default value is STENCIL_KEEP. |
[in] | ZPassOp | Specifies the operation which is to be executed when the stencil test and the z-buffer test succeed. The default value is STENCIL_KEEP. |
Reimplemented from sp::video::RenderSystem.
void sp::video::OpenGLRenderSystem::setupConfiguration | ( | ) | [virtual] |
Implements sp::video::RenderSystem.
bool sp::video::OpenGLRenderSystem::setupMaterialStates | ( | const MaterialStates * | Material, | |
bool | Forced = false | |||
) | [virtual] |
Configures the renderer with the specified material states.
[in] | Material | Pointer to the MaterialStates object. |
[in] | Forced | Specifies whether the setup is to be forced or not. If true the material states will be updated guaranteed. Otherwise the render system checks if the material states are different to the previously set states. |
Implements sp::video::RenderSystem.
friend class OpenGLTexture [friend] |
Reimplemented from sp::video::RenderSystem.