Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends

sp::video::GLFixedFunctionPipeline Class Reference

OpenGL fixed function render system. This is the parent class of all OpenGL and OpenGL|ES renderers. More...

#include <spOpenGLPipelineFixed.hpp>

Inheritance diagram for sp::video::GLFixedFunctionPipeline:
sp::video::GLBasePipeline sp::video::RenderSystem sp::video::OpenGLES1RenderSystem sp::video::OpenGLRenderSystem

List of all members.

Classes

struct  SClipPlane

Public Member Functions

virtual ~GLFixedFunctionPipeline ()
virtual s32 getMultitexCount () const
 Returns the count of maximal texture layers for the fixed-function-pipeline.
virtual s32 getMaxLightCount () const
 Returns the count of maximal light sources for the fixed-function-pipeline.
virtual void setShadeMode (const EShadeModeTypes ShadeMode)
 Sets the shading mode for primitives (where primitives are points, lines and triangles).
virtual void updateLight (u32 LightID, const scene::ELightModels LightType, bool isVolumetric, const dim::vector3df &Direction, f32 SpotInnerConeAngle, f32 SpotOuterConeAngle, f32 AttenuationConstant, f32 AttenuationLinear, f32 AttenuationQuadratic)
virtual void setupTextureLayer (u8 LayerIndex, const dim::matrix4f &TexMatrix, const ETextureEnvTypes EnvType, const EMappingGenTypes GenType, s32 MappingCoordsFlags)
 Configures the renderer with the specified texture layer states.
virtual void setRenderState (const video::ERenderStates Type, s32 State)
virtual s32 getRenderState (const video::ERenderStates Type) const
 Returns the current render state.
virtual void addDynamicLightSource (u32 LightID, scene::ELightModels Type, video::color &Diffuse, video::color &Ambient, video::color &Specular, f32 AttenuationConstant, f32 AttenuationLinear, f32 AttenuationQuadratic)
virtual void setLightStatus (u32 LightID, bool Enable, bool UseAllRCs=false)
virtual void setLightColor (u32 LightID, const video::color &Diffuse, const video::color &Ambient, const video::color &Specular, bool UseAllRCs=false)
virtual void setFog (const EFogTypes Type)
virtual void setFogColor (const video::color &Color)
 Sets the fog color.
virtual void setFogRange (f32 Range, f32 NearPlane=1.0f, f32 FarPlane=1000.0f, const EFogModes Mode=FOG_PALE)
virtual void setClipPlane (u32 Index, const dim::plane3df &Plane, bool Enable)
virtual void beginDrawing2D ()
virtual void endDrawing2D ()
virtual void beginDrawing3D ()
virtual void setPointSize (s32 Size=1)
 Sets the size for each point which is to be rendered. By default 1.
virtual color getPixelColor (const dim::point2di &Position) const
virtual void draw2DPolygonImage (const ERenderPrimitives Type, Texture *Tex, const scene::SPrimitiveVertex2D *VerticesList, u32 Count)
virtual TexturecreateScreenShot (const dim::point2di &Position=0, dim::size2di Size=0)
virtual void createScreenShot (Texture *Tex, const dim::point2di &Position=0)
 Takes a screenshot of the current frame and stores the data in the specified Texture object.
virtual void updateModelviewMatrix ()
virtual void setProjectionMatrix (const dim::matrix4f &Matrix)
virtual void setViewMatrix (const dim::matrix4f &Matrix)
virtual void setTextureMatrix (const dim::matrix4f &Matrix, u8 TextureLayer=0)

Protected Member Functions

 GLFixedFunctionPipeline ()
void drawTexturedFont (const Font *FontObj, const dim::point2di &Position, const io::stringc &Text, const color &Color)
void setupTextureLayerCoordinate (GLenum RenderState, GLenum Coordinate, bool Enable, s32 GenType)

Protected Attributes

std::vector< SClipPlaneClippingPlanes_
scene::SPrimitiveVertex2D Vertices2D_ [4]
GLboolean isCullFace_
f32 TempColor_ [4]

Static Protected Attributes

static dim::matrix4f ExtTmpMat_

Friends

class OpenGLTexture
class OpenGLES1Texture
class OpenGLES2Texture

Detailed Description

OpenGL fixed function render system. This is the parent class of all OpenGL and OpenGL|ES renderers.


Constructor & Destructor Documentation

virtual sp::video::GLFixedFunctionPipeline::~GLFixedFunctionPipeline (  )  [virtual]
sp::video::GLFixedFunctionPipeline::GLFixedFunctionPipeline (  )  [protected]

Member Function Documentation

virtual void sp::video::GLFixedFunctionPipeline::addDynamicLightSource ( u32  LightID,
scene::ELightModels  Type,
video::color Diffuse,
video::color Ambient,
video::color Specular,
f32  AttenuationConstant,
f32  AttenuationLinear,
f32  AttenuationQuadratic 
) [virtual]

Reimplemented from sp::video::RenderSystem.

virtual void sp::video::GLFixedFunctionPipeline::beginDrawing2D (  )  [virtual]

Configures the renderer to draw further in 2D.

Note:
Since version 3.2 this is no longer required to be called before drawing in 2D. The engine itself changes the mode from 2D to 3D and vice versa if necessary.
See also:
setRenderMode

Reimplemented from sp::video::RenderSystem.

virtual void sp::video::GLFixedFunctionPipeline::beginDrawing3D (  )  [virtual]

Configures the renderer to draw further in 3D. This only needs to be called before drawing in 3D (draw3DLine etc.) but not to render 3D geometry using "SceneGraph::renderScene.

Reimplemented from sp::video::RenderSystem.

virtual Texture* sp::video::GLFixedFunctionPipeline::createScreenShot ( const dim::point2di Position = 0,
dim::size2di  Size = 0 
) [virtual]

Takes a screenshot of the current frame.

Parameters:
Position,: Specifies the 2D position (in screen space) of the screenshot.
Size,: Specifies the size (in screen space) of the screenshot.
Returns:
Pointer to the new Texture object.
Note:
This is a time consuming pixel reading operation. The best way to make a 'screenshot' of the current frame is to render into a render target and than get the image buffer from the video RAM (VRAM).

Reimplemented from sp::video::RenderSystem.

virtual void sp::video::GLFixedFunctionPipeline::createScreenShot ( Texture Tex,
const dim::point2di Position = 0 
) [virtual]

Takes a screenshot of the current frame and stores the data in the specified Texture object.

Reimplemented from sp::video::RenderSystem.

virtual void sp::video::GLFixedFunctionPipeline::draw2DPolygonImage ( const ERenderPrimitives  Type,
Texture Tex,
const scene::SPrimitiveVertex2D VerticesList,
u32  Count 
) [virtual]

Reimplemented from sp::video::RenderSystem.

void sp::video::GLFixedFunctionPipeline::drawTexturedFont ( const Font FontObj,
const dim::point2di Position,
const io::stringc Text,
const color Color 
) [protected, virtual]

Reimplemented from sp::video::RenderSystem.

virtual void sp::video::GLFixedFunctionPipeline::endDrawing2D (  )  [virtual]

Reimplemented from sp::video::RenderSystem.

virtual s32 sp::video::GLFixedFunctionPipeline::getMaxLightCount (  )  const [virtual]

Returns the count of maximal light sources for the fixed-function-pipeline.

Implements sp::video::RenderSystem.

virtual s32 sp::video::GLFixedFunctionPipeline::getMultitexCount (  )  const [virtual]

Returns the count of maximal texture layers for the fixed-function-pipeline.

Implements sp::video::RenderSystem.

virtual color sp::video::GLFixedFunctionPipeline::getPixelColor ( const dim::point2di Position  )  const [virtual]
Returns:
Color of the pixel buffer (color buffer) at the specified position in screen space.

Reimplemented from sp::video::RenderSystem.

virtual s32 sp::video::GLFixedFunctionPipeline::getRenderState ( const video::ERenderStates  Type  )  const [virtual]

Returns the current render state.

Implements sp::video::RenderSystem.

virtual void sp::video::GLFixedFunctionPipeline::setClipPlane ( u32  Index,
const dim::plane3df Plane,
bool  Enable 
) [virtual]

Sets and enables or disables a clipping plane. These clipping-planes are additional clipping planes to the normal 6 view-frustum-clipping-planes. Normally 8 of those planes should be available.

Parameters:
Index,: Index number of the clipping plane.
Plane,: Plane which holds the plane equation.
Enable,: Specifies if the plane is shall be enabled or disabled. If false "Plane" can just be "dim::plane3df()".

Reimplemented from sp::video::RenderSystem.

virtual void sp::video::GLFixedFunctionPipeline::setFog ( const EFogTypes  Type  )  [virtual]

Sets the fog's type if used.

Parameters:
Type,: Type of the fog. If fog shall be disabled use (video::FOG_NONE).

Reimplemented from sp::video::RenderSystem.

virtual void sp::video::GLFixedFunctionPipeline::setFogColor ( const video::color Color  )  [virtual]

Sets the fog color.

Reimplemented from sp::video::RenderSystem.

virtual void sp::video::GLFixedFunctionPipeline::setFogRange ( f32  Range,
f32  NearPlane = 1.0f,
f32  FarPlane = 1000.0f,
const EFogModes  Mode = FOG_PALE 
) [virtual]

Reimplemented from sp::video::RenderSystem.

virtual void sp::video::GLFixedFunctionPipeline::setLightColor ( u32  LightID,
const video::color Diffuse,
const video::color Ambient,
const video::color Specular,
bool  UseAllRCs = false 
) [virtual]

Sets the light color for the specified fixed-function light source.

Parameters:
[in] LightID Specifies the light's ID number (beginning with 0).
[in] Diffuse Specifies the diffuse light color. By default (200, 200, 200, 255).
[in] Ambient Specifies the ambient light color. By default (255, 255, 255, 255).
[in] Specular Specifies the specular light color. By default (0, 0, 0, 255).
[in] UseAllRCs Specifies whether all render-contexts are to be used or only the active one. By default only the active render context is affected.

Reimplemented from sp::video::RenderSystem.

virtual void sp::video::GLFixedFunctionPipeline::setLightStatus ( u32  LightID,
bool  Enable,
bool  UseAllRCs = false 
) [virtual]

Enabled or disables the specified fixed-function light source.

Parameters:
[in] LightID Specifies the light's ID number (beginning with 0).
[in] Enable Specifies whether the light source is to be enabled or disabled.
[in] UseAllRCs Specifies whether all render-contexts are to be used or only the active one. By default only the active render context is affected.

Reimplemented from sp::video::RenderSystem.

virtual void sp::video::GLFixedFunctionPipeline::setPointSize ( s32  Size = 1  )  [virtual]

Sets the size for each point which is to be rendered. By default 1.

Reimplemented from sp::video::RenderSystem.

virtual void sp::video::GLFixedFunctionPipeline::setProjectionMatrix ( const dim::matrix4f Matrix  )  [virtual]

Reimplemented from sp::video::RenderSystem.

virtual void sp::video::GLFixedFunctionPipeline::setRenderState ( const video::ERenderStates  Type,
s32  State 
) [virtual]

Sets the render state manual. Can be used do enabled or disable effects directly.

Parameters:
[in] Type Specifies the render state which is to be changed (lighting, blending, fog effect etc.).
[in] State Specifies the new state (commonly TRUE/ FALSE or rather 1/ 0).
Note:
Since version 3.2 the engine itself changes the internal render mode. Thus when drawing a 2D primitive (such as a 2D image) and the render mode will be changed all your previously changed render states will be overwritten. Therefore you have to provide the next render mode, e.g. when you are drawing in 2D and you want to change a special render state do it this way:
        // Provide the next render mode
        spRenderer->setRenderMode(video::RENDERMODE_DRAWING_2D);
        
        // Store the previous render state
        const s32 PrevRenderState = spRenderer->getRenderState(video::RENDER_BLEND);
        
        // Set an individual render state
        spRenderer->setRenderState(video::RENDERSTATE_BLEND, false);
        
        // Draw the primitive
        spRenderer->draw2DImage(Img, 0);
        
        // Reset the render state
        spRenderer->setRenderState(video::RENDER_BLEND, PrevRenderState);
See also:
setRenderMode
ERenderStates

Implements sp::video::RenderSystem.

virtual void sp::video::GLFixedFunctionPipeline::setShadeMode ( const EShadeModeTypes  ShadeMode  )  [virtual]

Sets the shading mode for primitives (where primitives are points, lines and triangles).

Reimplemented from sp::video::RenderSystem.

virtual void sp::video::GLFixedFunctionPipeline::setTextureMatrix ( const dim::matrix4f Matrix,
u8  TextureLayer = 0 
) [virtual]

Reimplemented from sp::video::RenderSystem.

virtual void sp::video::GLFixedFunctionPipeline::setupTextureLayer ( u8  LayerIndex,
const dim::matrix4f TexMatrix,
const ETextureEnvTypes  EnvType,
const EMappingGenTypes  GenType,
s32  MappingCoordsFlags 
) [virtual]

Configures the renderer with the specified texture layer states.

Reimplemented from sp::video::RenderSystem.

void sp::video::GLFixedFunctionPipeline::setupTextureLayerCoordinate ( GLenum  RenderState,
GLenum  Coordinate,
bool  Enable,
s32  GenType 
) [inline, protected]
virtual void sp::video::GLFixedFunctionPipeline::setViewMatrix ( const dim::matrix4f Matrix  )  [virtual]

Reimplemented from sp::video::RenderSystem.

virtual void sp::video::GLFixedFunctionPipeline::updateLight ( u32  LightID,
const scene::ELightModels  LightType,
bool  isVolumetric,
const dim::vector3df Direction,
f32  SpotInnerConeAngle,
f32  SpotOuterConeAngle,
f32  AttenuationConstant,
f32  AttenuationLinear,
f32  AttenuationQuadratic 
) [virtual]

Updates the light for the renderer

Todo:
Refactor this function!

Reimplemented from sp::video::RenderSystem.

virtual void sp::video::GLFixedFunctionPipeline::updateModelviewMatrix (  )  [virtual]

Friends And Related Function Documentation

friend class OpenGLES1Texture [friend]

Reimplemented from sp::video::GLBasePipeline.

friend class OpenGLES2Texture [friend]

Reimplemented from sp::video::GLBasePipeline.

friend class OpenGLTexture [friend]

Reimplemented from sp::video::RenderSystem.


Member Data Documentation


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines