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

sp::video::GLBasePipeline Class Reference

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

#include <spOpenGLPipelineBase.hpp>

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

List of all members.

Public Member Functions

virtual ~GLBasePipeline ()
virtual io::stringc getRenderer () const
 Returns the renderer hardware (e.g. "NVIDIA GeForce 8800 GTX").
virtual io::stringc getVersion () const
 Returns the renderer API version (e.g. "OpenGL 3.2" or "Direct3D9.0c").
virtual io::stringc getVendor () const
 Returns the graphics hardware vendor (e.g. "NVIDIA Corporation" or "ATI Technologies Inc.").
virtual io::stringc getShaderVersion () const
 Returns the shader version (e.g. "1.50 NVIDIA via Cg compiler" or "HLSL Shader Model 2").
virtual s32 getMaxAnisotropicFilter () const
 Returns the count of maximal anisotropic texture filter sampling.
virtual bool queryExtensionSupport (const io::stringc &TargetExtension) const
virtual
dim::EMatrixCoordinateSystmes 
getProjectionMatrixType () const
virtual void clearBuffers (const s32 ClearFlags=BUFFER_COLOR|BUFFER_DEPTH)
virtual void setFrontFace (bool isFrontFace)
 Sets triangle rendering to CW (clock-wise -> false) or CCW (counter-clock-wise -> true).
virtual void setClearColor (const color &Color)
virtual void setColorMask (bool isRed, bool isGreen, bool isBlue, bool isAlpha=true)
 Enables or disables the color components which are to be written for rendering operations.
virtual void setDepthMask (bool isDepth)
 Enables or disables the depth component which is to be written for rendering operations.
void setDepthRange (f32 Near, f32 Far)
virtual void createVertexBuffer (void *&BufferID)
 Creates a new hardware vertex buffer.
virtual void createIndexBuffer (void *&BufferID)
 Creates a new hardware index buffer.
virtual void deleteVertexBuffer (void *&BufferID)
 Deletes the specified hardware vertex buffer.
virtual void deleteIndexBuffer (void *&BufferID)
 Deletes the specified hardware index buffer.
virtual void updateVertexBuffer (void *BufferID, const dim::UniversalBuffer &BufferData, const VertexFormat *Format, const EHWBufferUsage Usage)
 Updates the specified hardware vertex buffer by uploading the specified buffer data into VRAM.
virtual void updateIndexBuffer (void *BufferID, const dim::UniversalBuffer &BufferData, const IndexFormat *Format, const EHWBufferUsage Usage)
 Updates the specified hardware index buffer by uploading the specified buffer data into VRAM.
virtual void updateVertexBufferElement (void *BufferID, const dim::UniversalBuffer &BufferData, u32 Index)
 Updates the specified hardware vertex buffer only for the specified element.
virtual void updateIndexBufferElement (void *BufferID, const dim::UniversalBuffer &BufferData, u32 Index)
 Updates the specified hardware index buffer only for the specified element.
virtual void setBlending (const EBlendingTypes SourceBlend, const EBlendingTypes DestBlend)
virtual void setClipping (bool Enable, const dim::point2di &Position, const dim::size2di &Size)
virtual void setViewport (const dim::point2di &Position, const dim::size2di &Size)
virtual void setLineSize (s32 Size=1)
 Sets the size for each line which is to be rendered. By default 1. This is not available when using Direct3D.
virtual TexturecreateTexture (const STextureCreationFlags &CreationFlags)
 Creates a new texture with the specified creation flags.
virtual void setWorldMatrix (const dim::matrix4f &Matrix)
virtual dim::matrix4f getViewMatrix () const

Protected Member Functions

 GLBasePipeline ()
virtual void setInvertScreen (bool Enable)
bool queryGLVersion (s32 Major, s32 Minor) const

Static Protected Member Functions

static GLenum getGlTexDimension (const ETextureDimensions DimType)
static void setGlRenderState (GLenum Mode, bool Enable)
static bool getGlRenderState (GLenum Mode)

Protected Attributes

s32 GLMajorVersion_
s32 GLMinorVersion_
s32 MultiTextureCount_
bool isInvertScreen_

Friends

class GLTextureBase
class GLFramebufferObject
class OpenGLES1Texture
class OpenGLES2Texture

Detailed Description

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


Constructor & Destructor Documentation

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

Member Function Documentation

virtual void sp::video::GLBasePipeline::clearBuffers ( const s32  ClearFlags = BUFFER_COLOR|BUFFER_DEPTH  )  [virtual]

Clears the specified buffers.

Parameters:
ClearFlags,: Specifies which buffers are to be cleared. This can be a combination of the following types: BUFFER_COLOR (Color or pixel buffer), BUFFER_DEPTH (Depth or Z buffer), BUFFER_STENCIL (Stencil or mask buffer). If your 3D scene has a skybox or the background is not visible because of any other reason you can clear only the depth buffer to speed up your application (This is particular reasonable when using the software renderer).

Implements sp::video::RenderSystem.

virtual void sp::video::GLBasePipeline::createIndexBuffer ( void *&  BufferID  )  [virtual]

Creates a new hardware index buffer.

Implements sp::video::RenderSystem.

virtual Texture* sp::video::GLBasePipeline::createTexture ( const STextureCreationFlags CreationFlags  )  [virtual]

Creates a new texture with the specified creation flags.

Implements sp::video::RenderSystem.

virtual void sp::video::GLBasePipeline::createVertexBuffer ( void *&  BufferID  )  [virtual]

Creates a new hardware vertex buffer.

Implements sp::video::RenderSystem.

virtual void sp::video::GLBasePipeline::deleteIndexBuffer ( void *&  BufferID  )  [virtual]

Deletes the specified hardware index buffer.

Implements sp::video::RenderSystem.

virtual void sp::video::GLBasePipeline::deleteVertexBuffer ( void *&  BufferID  )  [virtual]

Deletes the specified hardware vertex buffer.

Implements sp::video::RenderSystem.

static bool sp::video::GLBasePipeline::getGlRenderState ( GLenum  Mode  )  [inline, static, protected]
static GLenum sp::video::GLBasePipeline::getGlTexDimension ( const ETextureDimensions  DimType  )  [static, protected]
virtual s32 sp::video::GLBasePipeline::getMaxAnisotropicFilter (  )  const [virtual]

Returns the count of maximal anisotropic texture filter sampling.

Implements sp::video::RenderSystem.

virtual dim::EMatrixCoordinateSystmes sp::video::GLBasePipeline::getProjectionMatrixType (  )  const [virtual]

Reimplemented from sp::video::RenderSystem.

virtual io::stringc sp::video::GLBasePipeline::getRenderer (  )  const [virtual]

Returns the renderer hardware (e.g. "NVIDIA GeForce 8800 GTX").

Implements sp::video::RenderSystem.

virtual io::stringc sp::video::GLBasePipeline::getShaderVersion (  )  const [virtual]

Returns the shader version (e.g. "1.50 NVIDIA via Cg compiler" or "HLSL Shader Model 2").

Implements sp::video::RenderSystem.

Reimplemented in sp::video::GLProgrammableFunctionPipeline.

virtual io::stringc sp::video::GLBasePipeline::getVendor (  )  const [virtual]

Returns the graphics hardware vendor (e.g. "NVIDIA Corporation" or "ATI Technologies Inc.").

Implements sp::video::RenderSystem.

virtual io::stringc sp::video::GLBasePipeline::getVersion (  )  const [virtual]

Returns the renderer API version (e.g. "OpenGL 3.2" or "Direct3D9.0c").

Implements sp::video::RenderSystem.

Reimplemented in sp::video::OpenGLES1RenderSystem, and sp::video::OpenGLES2RenderSystem.

virtual dim::matrix4f sp::video::GLBasePipeline::getViewMatrix (  )  const [virtual]
Todo:
Conversion between right-handed and left-handed coordinate system.

Reimplemented from sp::video::RenderSystem.

virtual bool sp::video::GLBasePipeline::queryExtensionSupport ( const io::stringc TargetExtension  )  const [virtual]

Returns true if the specified extension is supported by the renderer (actually only used for OpenGL, especially for shader extensions).

Parameters:
TargetExtension,: Extension name (e.g. "GL_ARB_shader_texture_lod" when using "texture2DGradARB" function in GLSL).

Reimplemented from sp::video::RenderSystem.

bool sp::video::GLBasePipeline::queryGLVersion ( s32  Major,
s32  Minor 
) const [inline, protected]
virtual void sp::video::GLBasePipeline::setBlending ( const EBlendingTypes  SourceBlend,
const EBlendingTypes  DestBlend 
) [virtual]

Sets the blending mode. Before you have to enable blending by calling "setRenderState(RENDER_BLEND, true)."

Parameters:
SourceBlend,: Specifies the source pixel blending mode.
TargetBlend,: Specifies the target (or rather destination) pixel blending mode.
Note:
You can download the BlendingChart tool to have a visualization of all blending combinations.

Reimplemented from sp::video::RenderSystem.

virtual void sp::video::GLBasePipeline::setClearColor ( const color Color  )  [virtual]

Sets the color with which the color-buffer is to be cleared.

Note:
This affects every render context. So don't call this every frame when you have several render contexts!
See also:
RenderContext

Reimplemented from sp::video::RenderSystem.

virtual void sp::video::GLBasePipeline::setClipping ( bool  Enable,
const dim::point2di Position,
const dim::size2di Size 
) [virtual]

Sets the clipping mode (or rather scissors).

Parameters:
Enable,: Specifies whether clipping is to be enabled or disabled.
Position,: Specifies the position (in screen space).
Size,: Specifies the size (in screen space).

Reimplemented from sp::video::RenderSystem.

virtual void sp::video::GLBasePipeline::setColorMask ( bool  isRed,
bool  isGreen,
bool  isBlue,
bool  isAlpha = true 
) [virtual]

Enables or disables the color components which are to be written for rendering operations.

Reimplemented from sp::video::RenderSystem.

virtual void sp::video::GLBasePipeline::setDepthMask ( bool  Enable  )  [virtual]

Enables or disables the depth component which is to be written for rendering operations.

Reimplemented from sp::video::RenderSystem.

void sp::video::GLBasePipeline::setDepthRange ( f32  Near,
f32  Far 
) [virtual]

Sets the depth range.

Parameters:
Near,: Specifies the near clipping plane. This must be in the range [0.0 .. 1.0]. By default 0.0.
Far,: Specifies the far clipping plane. This must be in the range [0.0 .. 1.0]. By default 1.0.
Note:
Near and far parameters may also be inverse, i.e. Near > Far is also allowed. When these values are too near you will get z-fighting! So never set these values to the same value.

Reimplemented from sp::video::RenderSystem.

virtual void sp::video::GLBasePipeline::setFrontFace ( bool  isFrontFace  )  [virtual]

Sets triangle rendering to CW (clock-wise -> false) or CCW (counter-clock-wise -> true).

Reimplemented from sp::video::RenderSystem.

static void sp::video::GLBasePipeline::setGlRenderState ( GLenum  Mode,
bool  Enable 
) [inline, static, protected]
virtual void sp::video::GLBasePipeline::setInvertScreen ( bool  Enable  )  [protected, virtual]
virtual void sp::video::GLBasePipeline::setLineSize ( s32  Size = 1  )  [virtual]

Sets the size for each line which is to be rendered. By default 1. This is not available when using Direct3D.

Reimplemented from sp::video::RenderSystem.

virtual void sp::video::GLBasePipeline::setViewport ( const dim::point2di Position,
const dim::size2di Size 
) [virtual]

Sets the viewport. This is actually only used for 3D drawing. For 2D drawing you can use the "setClipping" function.

Parameters:
Position,: Specifies the position (in screen space).
Size,: Specifies the size (in screen space).

Reimplemented from sp::video::RenderSystem.

virtual void sp::video::GLBasePipeline::setWorldMatrix ( const dim::matrix4f Matrix  )  [virtual]

Reimplemented from sp::video::RenderSystem.

virtual void sp::video::GLBasePipeline::updateIndexBuffer ( void *  BufferID,
const dim::UniversalBuffer BufferData,
const IndexFormat Format,
const EHWBufferUsage  Usage 
) [virtual]

Updates the specified hardware index buffer by uploading the specified buffer data into VRAM.

Implements sp::video::RenderSystem.

virtual void sp::video::GLBasePipeline::updateIndexBufferElement ( void *  BufferID,
const dim::UniversalBuffer BufferData,
u32  Index 
) [virtual]

Updates the specified hardware index buffer only for the specified element.

Implements sp::video::RenderSystem.

virtual void sp::video::GLBasePipeline::updateVertexBuffer ( void *  BufferID,
const dim::UniversalBuffer BufferData,
const VertexFormat Format,
const EHWBufferUsage  Usage 
) [virtual]

Updates the specified hardware vertex buffer by uploading the specified buffer data into VRAM.

Implements sp::video::RenderSystem.

virtual void sp::video::GLBasePipeline::updateVertexBufferElement ( void *  BufferID,
const dim::UniversalBuffer BufferData,
u32  Index 
) [virtual]

Updates the specified hardware vertex buffer only for the specified element.

Implements sp::video::RenderSystem.


Friends And Related Function Documentation

friend class GLFramebufferObject [friend]

Reimplemented from sp::video::RenderSystem.

friend class GLTextureBase [friend]

Reimplemented from sp::video::RenderSystem.

friend class OpenGLES1Texture [friend]

Reimplemented from sp::video::RenderSystem.

Reimplemented in sp::video::GLFixedFunctionPipeline.

friend class OpenGLES2Texture [friend]

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