PixelLightAPI  .
Public Member Functions | Static Public Member Functions | Public Attributes
PLRenderer::RendererContext Class Reference

Renderer context. More...

#include <RendererContext.h>

Inheritance diagram for PLRenderer::RendererContext:
Inheritance graph
[legend]

List of all members.

Public Member Functions

PLRENDERER_API ~RendererContext ()
 Destructor.
RendererGetRenderer () const
 Returns the used renderer.
PLRENDERER_API TextureManagerGetTextureManager ()
 Returns the texture manager of this renderer context.
PLRENDERER_API EffectManagerGetEffectManager ()
 Returns the effect manager of this renderer context.
PLRENDERER_API MaterialManagerGetMaterialManager ()
 Returns the material manager of this renderer context.
PLRENDERER_API void Update ()
 Updates the render context.

Static Public Member Functions

static PLRENDERER_API
RendererContext
CreateInstance (const PLCore::String &sBackend, PLCore::handle nNativeWindowHandle, Renderer::EMode nMode=Renderer::ModeBoth, PLCore::uint32 nZBufferBits=24, PLCore::uint32 nStencilBits=8, PLCore::uint32 nMultisampleAntialiasingSamples=0, const PLCore::String &sDefaultShaderLanguage="")
 Creates a renderer context instance.

Public Attributes

PLCore::Event EventUpdate

Detailed Description

Renderer context.

Remarks:
The renderer context stores and manages all data related to the renderer like e.g. the used PLRenderer implementation, textures and so on.

Please note that the renderer context is by design window independent, it doesn't even know anything about one or multiple windows (renderer targets). The renderer instance is connected with the renderer context. So, the renderer doesn't depend on an OS window as well, but the internal renderer implementation may need an OS window. If you have an OS main window which is valid as long as the renderer context instance exists, it's highly recommended to tell the renderer context of this main window during creation, else the internal renderer may create it's own invisible dummy window. Most times, there's no problem with an invisible dummy window holding a renderer implementation together. Sadly, there are e.g. some OpenGL ES 2.0 implementations which just fail when using multiple windows (the internal invisible dummy window and the real visible one => two windows).

In a nutshell:

Note:
  • There should be only one renderer context instance per application

Constructor & Destructor Documentation

Destructor.


Member Function Documentation

static PLRENDERER_API RendererContext* PLRenderer::RendererContext::CreateInstance ( const PLCore::String sBackend,
PLCore::handle  nNativeWindowHandle,
Renderer::EMode  nMode = Renderer::ModeBoth,
PLCore::uint32  nZBufferBits = 24,
PLCore::uint32  nStencilBits = 8,
PLCore::uint32  nMultisampleAntialiasingSamples = 0,
const PLCore::String sDefaultShaderLanguage = "" 
) [static]

Creates a renderer context instance.

Parameters:
[in]sBackendName of the renderer backend to use (for example 'PLRendererOpenGL::Renderer')
[in]nNativeWindowHandleHandle of a native OS window which is valid as long as the renderer instance exists, "NULL_HANDLE" if there's no such window (see class remarks for more information)
[in]nModeMode hint the renderer should run in, the renderer is not enforced to use this requested mode
[in]nZBufferBitsZ buffer bits (just a hint, for example 24)
[in]nStencilBitsStencil buffer bits (just a hint, for example 8)
[in]nMultisampleAntialiasingSamplesMultisample antialiasing samples per pixel, <=1 means no antialiasing (just a hint)
[in]sDefaultShaderLanguageThe name of the default shader language of the renderer (for example "GLSL" or "Cg"), if the string is empty, the default is chosen by the renderer implementation, this information is just a hint
Returns:
Creates a renderer context instance, a null pointer on error

Returns the used renderer.

Returns:
Reference to the used renderer

Returns the texture manager of this renderer context.

Returns:
Reference to the texture manager of this renderer context

Returns the effect manager of this renderer context.

Returns:
Reference to the effect manager of this renderer context

Returns the material manager of this renderer context.

Returns:
Reference to the material manager of this renderer context
PLRENDERER_API void PLRenderer::RendererContext::Update ( )

Updates the render context.

Note:
  • Should be called once per frame
  • Updates the effect manager
  • Emits the update event
  • Updates the renderer ("redraw")
  • Collects renderer context profiling information

Member Data Documentation

Update event


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


PixelLight PixelLight 0.9.10-R1
Copyright (C) 2002-2011 by The PixelLight Team
Last modified Fri Dec 23 2011 15:51:24
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported