Linderdaum Engine: clGLRenderContext Class Reference
Updated: Sun Feb 5 2012 22:59:50
clGLRenderContext Class Reference

OpenGL rendering context. More...

#include <GLRenderContext.h>

List of all members.

Public Member Functions

 clGLRenderContext ()
virtual ~clGLRenderContext ()
virtual void AfterConstruction ()
virtual bool InitContext (clViewport *Viewport, int BitsPerPixel, int zBufferBits, int StencilBits, int Multisample, bool TakeoverContext)
virtual void EndFrame (bool SwapBuffer)
virtual void CheckError (const std::string &File, const std::string &Line, const std::string &Info) const
 Terminates application if error occured.
virtual Luint GetPixel (const LVector2 &Pnt) const
 Read single pixel from the framebuffer. Internal function for objects picking, do not use heavily.
virtual void SetViewport (int X, int Y, int Width, int Height)
 Resize viewport using specified parameters.
virtual void SetViewportV (const LVector4 &ViewportSize)
 Resize viewport using parameters in Vec4.
virtual void RestoreViewport ()
 Set default values taken from Env.Viewport.
virtual void SetClearColor4v (const LVector4 &Color) const
 Set "background" color.
virtual int GetScreenshotSize () const
 Determine screenshot size in bytes.
virtual void GetScreenshot (void *Ptr) const
 Internal screenshot to raw image.
virtual sVideoSystemInfo GetVideoSystemInfo () const
 Returns information about current renderer vendor, type and version, shading language version.
virtual Lint64 GetTotalVideoMemory () const
 Return total GPU memory.
virtual Lint64 GetFreeVideoMemory () const
 Return currently free GPU memory.
virtual bool GuardExtension (bool Optional, const std::string &ExtName)
 Returns true if ExtName is supported. Terminated the program if Optional is false and ExtName is not supported.
virtual void ClearRenderTarget (bool Color, bool Depth, bool Stencil)
 Clears specified render buffers of currently binded render target.
virtual void SetPolygonFillMode (bool Fill)
 Toggles solid (fill) and wireframe rendering.
virtual void Finish ()
 Wait until all previous rendering operations are finished.
virtual void SetState (clRenderState *State)
 Make the state current.
virtual void UpdateState (clRenderState *State)
virtual iTextureCreateTexture () const
virtual sLGLAPI * GetLGLAPI () const
virtual void SetActiveTextureUnit (int TextureUnit)
virtual void SetActiveVBO (int ArrayBuffer, int ElementBuffer)
virtual void Event_SURFACE_CHANGED (LEvent Event, const LEventArgs &Args)

Private Member Functions

void CheckExtensions ()
void LogExtensions ()
sVideoSystemInfo RecheckVideoSystemInfo () const
void SetupBackfaceCulling (bool BackfaceCulling, bool BackFacing)
void SetupDepthTest (bool DepthTest)
void SetupDepthWrites (bool DepthWrites)
void SetupColorWrites (bool ColorWrites)

Private Attributes

LGL::clGLExtRetriever * FOpenGL
clGLDebuggerFDebugger
clViewportFViewport
GL_CONTEXT_TYPE FRenderContext
int FCurrentViewportWidth
int FCurrentViewportHeight
int FActiveTextureUnit
int FActiveVBO_ArrayBuffer
int FActiveVBO_ElementBuffer
sVideoSystemInfo FCurrentVideoInfo

Detailed Description

OpenGL rendering context.


Constructor & Destructor Documentation

clGLRenderContext::clGLRenderContext ( )
clGLRenderContext::~clGLRenderContext ( ) [virtual]

Member Function Documentation

void clGLRenderContext::AfterConstruction ( ) [virtual]

Reimplemented from iObject.

void clGLRenderContext::CheckError ( const std::string &  File,
const std::string &  Line,
const std::string &  Info 
) const [virtual]

Terminates application if error occured.

Implements iRenderContext.

void clGLRenderContext::CheckExtensions ( ) [private]
void clGLRenderContext::ClearRenderTarget ( bool  Color,
bool  Depth,
bool  Stencil 
) [virtual]

Clears specified render buffers of currently binded render target.

Implements iRenderContext.

iTexture * clGLRenderContext::CreateTexture ( ) const [virtual]

Creates an empty texture to which bitmap could be attached

Reimplemented from iRenderContext.

void clGLRenderContext::EndFrame ( bool  SwapBuffer) [virtual]

Reimplemented from iRenderContext.

void clGLRenderContext::Event_SURFACE_CHANGED ( LEvent  Event,
const LEventArgs Args 
) [virtual]
void clGLRenderContext::Finish ( ) [virtual]

Wait until all previous rendering operations are finished.

Implements iRenderContext.

Lint64 clGLRenderContext::GetFreeVideoMemory ( ) const [virtual]

Return currently free GPU memory.

Implements iRenderContext.

sLGLAPI * clGLRenderContext::GetLGLAPI ( ) const [virtual]
Luint clGLRenderContext::GetPixel ( const LVector2 Pnt) const [virtual]

Read single pixel from the framebuffer. Internal function for objects picking, do not use heavily.

Implements iRenderContext.

void clGLRenderContext::GetScreenshot ( void *  Ptr) const [virtual]

Internal screenshot to raw image.

Implements iRenderContext.

int clGLRenderContext::GetScreenshotSize ( ) const [virtual]

Determine screenshot size in bytes.

Implements iRenderContext.

Lint64 clGLRenderContext::GetTotalVideoMemory ( ) const [virtual]

Return total GPU memory.

Implements iRenderContext.

sVideoSystemInfo clGLRenderContext::GetVideoSystemInfo ( ) const [virtual]

Returns information about current renderer vendor, type and version, shading language version.

Implements iRenderContext.

bool clGLRenderContext::GuardExtension ( bool  Optional,
const std::string &  ExtName 
) [virtual]

Returns true if ExtName is supported. Terminated the program if Optional is false and ExtName is not supported.

Reimplemented from iRenderContext.

bool clGLRenderContext::InitContext ( clViewport Viewport,
int  BitsPerPixel,
int  zBufferBits,
int  StencilBits,
int  Multisample,
bool  TakeoverContext 
) [virtual]

Creates a rendering context with specified params and ataches it to the viewport. Assumed that fullscreennes had been set prior to this call.

Reimplemented from iRenderContext.

void clGLRenderContext::LogExtensions ( ) [private]
sVideoSystemInfo clGLRenderContext::RecheckVideoSystemInfo ( ) const [private]
void clGLRenderContext::RestoreViewport ( ) [virtual]

Set default values taken from Env.Viewport.

Implements iRenderContext.

void clGLRenderContext::SetActiveTextureUnit ( int  TextureUnit) [virtual]
void clGLRenderContext::SetActiveVBO ( int  ArrayBuffer,
int  ElementBuffer 
) [virtual]
void clGLRenderContext::SetClearColor4v ( const LVector4 Color) const [virtual]

Set "background" color.

Implements iRenderContext.

void clGLRenderContext::SetPolygonFillMode ( bool  Fill) [virtual]

Toggles solid (fill) and wireframe rendering.

Implements iRenderContext.

void clGLRenderContext::SetState ( clRenderState State) [virtual]

Make the state current.

Implements iRenderContext.

void clGLRenderContext::SetupBackfaceCulling ( bool  BackfaceCulling,
bool  BackFacing 
) [inline, private]
void clGLRenderContext::SetupColorWrites ( bool  ColorWrites) [inline, private]
void clGLRenderContext::SetupDepthTest ( bool  DepthTest) [inline, private]
void clGLRenderContext::SetupDepthWrites ( bool  DepthWrites) [inline, private]
void clGLRenderContext::SetViewport ( int  X,
int  Y,
int  Width,
int  Height 
) [virtual]

Resize viewport using specified parameters.

Implements iRenderContext.

void clGLRenderContext::SetViewportV ( const LVector4 ViewportSize) [virtual]

Resize viewport using parameters in Vec4.

Implements iRenderContext.

void clGLRenderContext::UpdateState ( clRenderState State) [virtual]

Make the state current at the specified RenderContext. Only state differences with CurrentState are passed to graphical API

Implements iRenderContext.


Member Data Documentation

LGL::clGLExtRetriever* clGLRenderContext::FOpenGL [private]
GL_CONTEXT_TYPE clGLRenderContext::FRenderContext [private]

The documentation for this class was generated from the following files: