Keos::COGLRenderSystem Class Reference

Class for OpenGL renderer system. More...

#include <KeosOGLRenderSystem.h>

Inheritance diagram for Keos::COGLRenderSystem:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 COGLRenderSystem ()
 Constructor.
 ~COGLRenderSystem ()
 Destructor.
const StringGetName (void) const
 See RenderSystem.
IRenderWindowCreateRenderWindow (const String &strName, uint nWidth, uint nHeight, uint nColourDepth, bool bFullScreen)
 See IRenderSystem.
IRenderWindowInitialise (bool bAutoCreateWindow, const String &strWindowTitle="KEOS Render Window")
 See IRenderSystem.
void Reinitialise (void)
 See IRenderSystem.
void Shutdown (void)
 See IRenderSystem.
void InitGL (void)
virtual void BeginScene (void) const
 Start a scene render.
virtual void EndScene (void) const
 End a scene render.
virtual void PrintInfo (void) const
 Print information on the API.
virtual IBufferBase_CreateVB (ulong nSize, ulong nStride, ulong nFlags) const
 See IRenderSystem.
virtual IBufferBase_CreateIB (ulong nSize, ulong nStride, ulong nFlags) const
 See IRenderSystem.
virtual IDeclarationCreateDeclaration (const TDeclarationElement *Elements, size_t nCount) const
 See IRenderSystem.
virtual void _SetVB (uint nStream, const IBufferBase *pBuffer, ulong nStride, ulong nMinVertex, ulong nMaxVertex)
 See IRenderSystem.
virtual void _SetIB (const IBufferBase *pBuffer, ulong nStride)
 See IRenderSystem.
virtual void SetDeclaration (const IDeclaration *Declaration)
 See IRenderSystem.
virtual void DrawPrimitives (TPrimitiveType Type, ulong nFirstVertex, ulong nCount) const
 See IRenderSystem.
virtual void DrawIndexedPrimitives (TPrimitiveType Type, ulong nFirstIndex, ulong nCount) const
 See IRenderSystem.
virtual void PushMatrix (TMatrixType Type)
 See IRenderSystem.
virtual void PopMatrix (TMatrixType Type)
 See IRenderSystem.
virtual void LoadMatrix (TMatrixType Type, const CMatrix4 &Matrix)
 See IRenderSystem.
virtual void LoadMatrixMult (TMatrixType Type, const CMatrix4 &Matrix)
 See IRenderSystem.
virtual void GetMatrix (TMatrixType Type, CMatrix4 &Matrix) const
 See IRenderSystem.
virtual ulong ConvertColor (const CColor &Color) const
 See IRenderSystem.
virtual ITextureBaseCreateTexture (const TVector2I &Size, TPixelFormat Format, ulong nFlags=0) const
 See IRenderSystem.
virtual void SetTexture (uint nUnit, const ITextureBase *pTexture) const
 See IRenderSystem.
virtual void SetupAlphaBlending (TBlend Src, TBlend Dest) const
 See IRenderSystem.
virtual void SetupTextureUnit (uint nUnit, TTextureOp Op, TTextureArg Arg1, TTextureArg Arg2=TXA_DIFFUSE, const CColor &Constant=0x00) const
 See IRenderSystem.
virtual void Enable (TRenderParameter Param, bool bValue) const
 See IRenderSystem.
virtual IShaderBaseCreateShader (CGprogram Program, TShaderType Type) const
 See IRenderSystem.
virtual void SetVertexShader (const IShaderBase *pShader)
 See IRenderSystem.
virtual void SetPixelShader (const IShaderBase *pShader)
 See IRenderSystem.
virtual void SetClearColor (const CColor &Color)
 See IRenderSystem.
virtual void SetLight (uint nIndex, CLight *pLight)
 See IRenderSystem.
virtual void SetFillMode (TFillMode Mode)
 See IRenderSystem.

Static Public Attributes

static PFNGLBINDBUFFERARBPROC glBindBufferARB
static PFNGLDELETEBUFFERSARBPROC glDeleteBuffersARB
static PFNGLGENBUFFERSARBPROC glGenBuffersARB
static PFNGLBUFFERDATAARBPROC glBufferDataARB
static PFNGLBUFFERSUBDATAARBPROC glBufferSubDataARB
static PFNGLGETBUFFERSUBDATAARBPROC glGetBufferSubDataARB
static PFNGLMAPBUFFERARBPROC glMapBufferARB
static PFNGLUNMAPBUFFERARBPROC glUnmapBufferARB
static PFNGLACTIVETEXTUREARBPROC glActiveTextureARB
static PFNGLCLIENTACTIVETEXTUREARBPROC glClientActiveTextureARB
static PFNGLCOMPRESSEDTEXIMAGE2DARBPROC glCompressedTexImage2DARB
static PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC glCompressedTexSubImage2DARB

Detailed Description

Class for OpenGL renderer system.

Definition at line 37 of file KeosOGLRenderSystem.h.


Constructor & Destructor Documentation

Keos::COGLRenderSystem::COGLRenderSystem (  ) 

Constructor.

Definition at line 70 of file KeosOGLRenderSystem.cpp.

Keos::COGLRenderSystem::~COGLRenderSystem (  ) 

Destructor.

Definition at line 76 of file KeosOGLRenderSystem.cpp.

References Shutdown().


Member Function Documentation

const String & Keos::COGLRenderSystem::GetName ( void   )  const [virtual]

See RenderSystem.

Implements Keos::IRenderSystem.

Definition at line 82 of file KeosOGLRenderSystem.cpp.

IRenderWindow * Keos::COGLRenderSystem::CreateRenderWindow ( const String strName,
uint  nWidth,
uint  nHeight,
uint  nColourDepth,
bool  bFullScreen 
) [virtual]

See IRenderSystem.

Implements Keos::IRenderSystem.

Definition at line 124 of file KeosOGLRenderSystem.cpp.

References Keos::IRenderSystem::AttachRenderTarget(), Keos::IRenderWindow::Create(), InitGL(), and Keos::ILogger::Log().

Referenced by Initialise().

IRenderWindow * Keos::COGLRenderSystem::Initialise ( bool  bAutoCreateWindow,
const String strWindowTitle = "KEOS Render Window" 
) [virtual]

See IRenderSystem.

Reimplemented from Keos::IRenderSystem.

Definition at line 89 of file KeosOGLRenderSystem.cpp.

References CreateRenderWindow(), Keos::ILogger::Log(), Keos::IRenderSystem::m_Options, OGL_EXCEPT, Keos::CStringConverter::ParseBool(), and Keos::CStringConverter::ParseUnsignedInt().

Referenced by Reinitialise().

void Keos::COGLRenderSystem::Reinitialise ( void   )  [virtual]

See IRenderSystem.

Implements Keos::IRenderSystem.

Definition at line 181 of file KeosOGLRenderSystem.cpp.

References Initialise(), and Shutdown().

void Keos::COGLRenderSystem::Shutdown ( void   )  [virtual]

See IRenderSystem.

Reimplemented from Keos::IRenderSystem.

Definition at line 188 of file KeosOGLRenderSystem.cpp.

References Keos::IRenderSystem::Shutdown().

Referenced by Reinitialise(), and ~COGLRenderSystem().

void Keos::COGLRenderSystem::InitGL ( void   ) 

Definition at line 144 of file KeosOGLRenderSystem.cpp.

References Keos::CColor::Black, Keos::CAP_FRAGMENT_PROGRAM, Keos::CAP_VERTEX_PROGRAM, Keos::CRenderSystemCapabilities::HasCapability(), Keos::ILogger::Log(), Keos::IRenderSystem::m_pCapabilities, Keos::IRenderSystem::m_PSOptions, Keos::IRenderSystem::m_PSProfile, Keos::IRenderSystem::m_VSOptions, Keos::IRenderSystem::m_VSProfile, and SetClearColor().

Referenced by CreateRenderWindow().

void Keos::COGLRenderSystem::BeginScene ( void   )  const [virtual]

Start a scene render.

Implements Keos::IRenderSystem.

Definition at line 312 of file KeosOGLRenderSystem.cpp.

void Keos::COGLRenderSystem::EndScene ( void   )  const [virtual]

End a scene render.

Implements Keos::IRenderSystem.

Definition at line 318 of file KeosOGLRenderSystem.cpp.

void Keos::COGLRenderSystem::PrintInfo ( void   )  const [virtual]

Print information on the API.

Implements Keos::IRenderSystem.

Definition at line 322 of file KeosOGLRenderSystem.cpp.

IBufferBase * Keos::COGLRenderSystem::_CreateVB ( ulong  nSize,
ulong  nStride,
ulong  nFlags 
) const [virtual]

See IRenderSystem.

Implements Keos::IRenderSystem.

Definition at line 337 of file KeosOGLRenderSystem.cpp.

References Keos::COGLEnum::BufferFlags(), GL_ARRAY_BUFFER_ARB, glBindBufferARB, glBufferDataARB, and glGenBuffersARB.

IBufferBase * Keos::COGLRenderSystem::_CreateIB ( ulong  nSize,
ulong  nStride,
ulong  nFlags 
) const [virtual]

See IRenderSystem.

Implements Keos::IRenderSystem.

Definition at line 352 of file KeosOGLRenderSystem.cpp.

References Keos::COGLEnum::BufferFlags(), GL_ARRAY_BUFFER_ARB, glBindBufferARB, glBufferDataARB, and glGenBuffersARB.

IDeclaration * Keos::COGLRenderSystem::CreateDeclaration ( const TDeclarationElement Elements,
size_t  nCount 
) const [virtual]

See IRenderSystem.

Implements Keos::IRenderSystem.

Definition at line 366 of file KeosOGLRenderSystem.cpp.

References Keos::COGLDeclaration::AddElement().

void Keos::COGLRenderSystem::_SetVB ( uint  nStream,
const IBufferBase pBuffer,
ulong  nStride,
ulong  nMinVertex,
ulong  nMaxVertex 
) [virtual]

See IRenderSystem.

Implements Keos::IRenderSystem.

Definition at line 397 of file KeosOGLRenderSystem.cpp.

References BUFFER_OFFSET, Keos::ELT_USAGE_DIFFUSE, Keos::ELT_USAGE_NORMAL, Keos::ELT_USAGE_POSITION, Keos::ELT_USAGE_TEXCOORD0, Keos::ELT_USAGE_TEXCOORD1, Keos::ELT_USAGE_TEXCOORD2, Keos::ELT_USAGE_TEXCOORD3, Keos::COGLBuffer< Type >::GetBuffer(), Keos::COGLDeclaration::GetStreamElements(), GL_ARRAY_BUFFER_ARB, GL_TEXTURE0_ARB, glActiveTextureARB, glBindBufferARB, and glClientActiveTextureARB.

void Keos::COGLRenderSystem::_SetIB ( const IBufferBase pBuffer,
ulong  nStride 
) [virtual]

See IRenderSystem.

Implements Keos::IRenderSystem.

Definition at line 477 of file KeosOGLRenderSystem.cpp.

References Keos::COGLBuffer< Type >::GetBuffer(), GL_ELEMENT_ARRAY_BUFFER_ARB, and glBindBufferARB.

void Keos::COGLRenderSystem::SetDeclaration ( const IDeclaration Declaration  )  [virtual]

See IRenderSystem.

Implements Keos::IRenderSystem.

Definition at line 490 of file KeosOGLRenderSystem.cpp.

References GL_TEXTURE0_ARB, and glActiveTextureARB.

void Keos::COGLRenderSystem::DrawPrimitives ( TPrimitiveType  Type,
ulong  nFirstVertex,
ulong  nCount 
) const [virtual]

See IRenderSystem.

Implements Keos::IRenderSystem.

Definition at line 508 of file KeosOGLRenderSystem.cpp.

References Keos::PT_LINELIST, Keos::PT_LINESTRIP, Keos::PT_POINTLIST, Keos::PT_TRIANGLEFAN, Keos::PT_TRIANGLELIST, and Keos::PT_TRIANGLESTRIP.

void Keos::COGLRenderSystem::DrawIndexedPrimitives ( TPrimitiveType  Type,
ulong  nFirstIndex,
ulong  nCount 
) const [virtual]

See IRenderSystem.

Implements Keos::IRenderSystem.

Definition at line 535 of file KeosOGLRenderSystem.cpp.

References BUFFER_OFFSET, Keos::PT_LINELIST, Keos::PT_LINESTRIP, Keos::PT_POINTLIST, Keos::PT_TRIANGLEFAN, Keos::PT_TRIANGLELIST, and Keos::PT_TRIANGLESTRIP.

void Keos::COGLRenderSystem::PushMatrix ( TMatrixType  Type  )  [virtual]

See IRenderSystem.

Implements Keos::IRenderSystem.

Definition at line 565 of file KeosOGLRenderSystem.cpp.

References Keos::COGLEnum::Get(), GL_TEXTURE0_ARB, glActiveTextureARB, and Keos::MAT_TEXTURE_0.

void Keos::COGLRenderSystem::PopMatrix ( TMatrixType  Type  )  [virtual]

See IRenderSystem.

Implements Keos::IRenderSystem.

Definition at line 575 of file KeosOGLRenderSystem.cpp.

References Keos::COGLEnum::Get(), GL_TEXTURE0_ARB, glActiveTextureARB, and Keos::MAT_TEXTURE_0.

void Keos::COGLRenderSystem::LoadMatrix ( TMatrixType  Type,
const CMatrix4 Matrix 
) [virtual]

See IRenderSystem.

Implements Keos::IRenderSystem.

Definition at line 585 of file KeosOGLRenderSystem.cpp.

References Keos::COGLEnum::Get(), GL_TEXTURE0_ARB, glActiveTextureARB, and Keos::MAT_TEXTURE_0.

void Keos::COGLRenderSystem::LoadMatrixMult ( TMatrixType  Type,
const CMatrix4 Matrix 
) [virtual]

See IRenderSystem.

Implements Keos::IRenderSystem.

Definition at line 595 of file KeosOGLRenderSystem.cpp.

References Keos::COGLEnum::Get(), GL_TEXTURE0_ARB, glActiveTextureARB, and Keos::MAT_TEXTURE_0.

void Keos::COGLRenderSystem::GetMatrix ( TMatrixType  Type,
CMatrix4 Matrix 
) const [virtual]

See IRenderSystem.

Implements Keos::IRenderSystem.

Definition at line 605 of file KeosOGLRenderSystem.cpp.

References Keos::COGLEnum::GetMatrix(), GL_TEXTURE0_ARB, glActiveTextureARB, and Keos::MAT_TEXTURE_0.

ulong Keos::COGLRenderSystem::ConvertColor ( const CColor Color  )  const [virtual]

See IRenderSystem.

Implements Keos::IRenderSystem.

Definition at line 614 of file KeosOGLRenderSystem.cpp.

References Keos::CColor::ToABGR().

ITextureBase * Keos::COGLRenderSystem::CreateTexture ( const TVector2I Size,
TPixelFormat  Format,
ulong  nFlags = 0 
) const [virtual]

See IRenderSystem.

Bug:
ya pas un prob la

Implements Keos::IRenderSystem.

Definition at line 620 of file KeosOGLRenderSystem.cpp.

References Keos::CAP_HW_MIPMAPPING, Keos::COGLEnum::Get(), Keos::IRenderSystem::GetCapabilities(), Keos::GetNbMipLevels(), GL_GENERATE_MIPMAP_SGIS, GL_TEXTURE_MAX_LEVEL, Keos::TEX_NOMIPMAP, Keos::CVector2< T >::x, and Keos::CVector2< T >::y.

void Keos::COGLRenderSystem::SetTexture ( uint  nUnit,
const ITextureBase pTexture 
) const [virtual]

See IRenderSystem.

Implements Keos::IRenderSystem.

Definition at line 657 of file KeosOGLRenderSystem.cpp.

References Keos::COGLTexture::GetOGLTexture(), GL_TEXTURE0_ARB, and glActiveTextureARB.

void Keos::COGLRenderSystem::SetupAlphaBlending ( TBlend  Src,
TBlend  Dest 
) const [virtual]

See IRenderSystem.

Implements Keos::IRenderSystem.

Definition at line 675 of file KeosOGLRenderSystem.cpp.

References Keos::COGLEnum::Get().

void Keos::COGLRenderSystem::SetupTextureUnit ( uint  nUnit,
TTextureOp  Op,
TTextureArg  Arg1,
TTextureArg  Arg2 = TXA_DIFFUSE,
const CColor Constant = 0x00 
) const [virtual]

See IRenderSystem.

Implements Keos::IRenderSystem.

Definition at line 681 of file KeosOGLRenderSystem.cpp.

References Keos::COGLEnum::Get(), GL_COMBINE_ALPHA_EXT, GL_COMBINE_EXT, GL_COMBINE_RGB_EXT, GL_OPERAND0_ALPHA_EXT, GL_OPERAND0_RGB_EXT, GL_OPERAND1_ALPHA_EXT, GL_OPERAND1_RGB_EXT, GL_SOURCE0_ALPHA_EXT, GL_SOURCE0_RGB_EXT, GL_SOURCE1_ALPHA_EXT, GL_SOURCE1_RGB_EXT, GL_TEXTURE0_ARB, glActiveTextureARB, Keos::CColor::ToFloat(), Keos::TXA_CONSTANT, and Keos::TXO_ALPHA_FIRSTARG.

void Keos::COGLRenderSystem::Enable ( TRenderParameter  Param,
bool  bValue 
) const [virtual]

See IRenderSystem.

Implements Keos::IRenderSystem.

Definition at line 716 of file KeosOGLRenderSystem.cpp.

References Keos::COGLEnum::Get(), and Keos::RENDER_ZWRITE.

IShaderBase * Keos::COGLRenderSystem::CreateShader ( CGprogram  Program,
TShaderType  Type 
) const [virtual]

See IRenderSystem.

Implements Keos::IRenderSystem.

Definition at line 737 of file KeosOGLRenderSystem.cpp.

void Keos::COGLRenderSystem::SetVertexShader ( const IShaderBase pShader  )  [virtual]

See IRenderSystem.

Implements Keos::IRenderSystem.

Definition at line 743 of file KeosOGLRenderSystem.cpp.

References Keos::COGLShader::GetProgram(), Keos::IShaderBase::GetType(), Keos::IRenderSystem::m_VSProfile, OGL_EXCEPT, and Keos::SHADER_VERTEX.

void Keos::COGLRenderSystem::SetPixelShader ( const IShaderBase pShader  )  [virtual]

See IRenderSystem.

Implements Keos::IRenderSystem.

Definition at line 763 of file KeosOGLRenderSystem.cpp.

References Keos::COGLShader::GetProgram(), Keos::IShaderBase::GetType(), Keos::IRenderSystem::m_PSProfile, OGL_EXCEPT, and Keos::SHADER_PIXEL.

void Keos::COGLRenderSystem::SetClearColor ( const CColor Color  )  [virtual]

See IRenderSystem.

Implements Keos::IRenderSystem.

Definition at line 783 of file KeosOGLRenderSystem.cpp.

References Keos::IRenderSystem::m_ClearColor, and Keos::CColor::ToFloat().

Referenced by InitGL().

void Keos::COGLRenderSystem::SetLight ( uint  nIndex,
CLight pLight 
) [virtual]

See IRenderSystem.

Implements Keos::IRenderSystem.

Definition at line 794 of file KeosOGLRenderSystem.cpp.

References Keos::CLight::GetAttenuationConstant(), Keos::CLight::GetAttenuationLinear(), Keos::CLight::GetAttenuationQuadric(), Keos::CLight::GetDiffuseColor(), Keos::CLight::GetDirection(), Keos::CLight::GetPosition(), Keos::CLight::GetSpecularColor(), Keos::CLight::GetSpotFalloff(), Keos::CLight::GetSpotOuterAngle(), Keos::CLight::GetType(), Keos::CLight::LT_DIRECTIONAL, Keos::CLight::LT_POINT, Keos::CLight::LT_SPOT, Keos::CColor::ToFloat(), Keos::CRadian::valueDegrees(), Keos::CVector3< T >::x, Keos::CVector3< T >::y, and Keos::CVector3< T >::z.

void Keos::COGLRenderSystem::SetFillMode ( TFillMode  Mode  )  [virtual]

See IRenderSystem.

Implements Keos::IRenderSystem.

Definition at line 887 of file KeosOGLRenderSystem.cpp.

References Keos::COGLEnum::Get().


Member Data Documentation

PFNGLBINDBUFFERARBPROC Keos::COGLRenderSystem::glBindBufferARB [static]

Definition at line 185 of file KeosOGLRenderSystem.h.

Referenced by _CreateIB(), _CreateVB(), _SetIB(), and _SetVB().

PFNGLDELETEBUFFERSARBPROC Keos::COGLRenderSystem::glDeleteBuffersARB [static]

Definition at line 186 of file KeosOGLRenderSystem.h.

Referenced by Keos::COGLBuffer< Type >::~COGLBuffer().

PFNGLGENBUFFERSARBPROC Keos::COGLRenderSystem::glGenBuffersARB [static]

Definition at line 187 of file KeosOGLRenderSystem.h.

Referenced by _CreateIB(), and _CreateVB().

PFNGLBUFFERDATAARBPROC Keos::COGLRenderSystem::glBufferDataARB [static]

Definition at line 188 of file KeosOGLRenderSystem.h.

Referenced by _CreateIB(), and _CreateVB().

PFNGLBUFFERSUBDATAARBPROC Keos::COGLRenderSystem::glBufferSubDataARB [static]

Definition at line 189 of file KeosOGLRenderSystem.h.

PFNGLGETBUFFERSUBDATAARBPROC Keos::COGLRenderSystem::glGetBufferSubDataARB [static]

Definition at line 190 of file KeosOGLRenderSystem.h.

PFNGLMAPBUFFERARBPROC Keos::COGLRenderSystem::glMapBufferARB [static]

Definition at line 191 of file KeosOGLRenderSystem.h.

PFNGLUNMAPBUFFERARBPROC Keos::COGLRenderSystem::glUnmapBufferARB [static]

Definition at line 192 of file KeosOGLRenderSystem.h.

PFNGLACTIVETEXTUREARBPROC Keos::COGLRenderSystem::glActiveTextureARB [static]

Definition at line 193 of file KeosOGLRenderSystem.h.

Referenced by _SetVB(), GetMatrix(), LoadMatrix(), LoadMatrixMult(), PopMatrix(), PushMatrix(), SetDeclaration(), SetTexture(), and SetupTextureUnit().

PFNGLCLIENTACTIVETEXTUREARBPROC Keos::COGLRenderSystem::glClientActiveTextureARB [static]

Definition at line 194 of file KeosOGLRenderSystem.h.

Referenced by _SetVB().

PFNGLCOMPRESSEDTEXIMAGE2DARBPROC Keos::COGLRenderSystem::glCompressedTexImage2DARB [static]

Definition at line 195 of file KeosOGLRenderSystem.h.

PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC Keos::COGLRenderSystem::glCompressedTexSubImage2DARB [static]

Definition at line 196 of file KeosOGLRenderSystem.h.


The documentation for this class was generated from the following files:
Generated on Fri Mar 9 14:29:33 2007 for Keos by  doxygen 1.5.1-p1