Oxygine  1
2g game engine
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
oxygine::STDRenderer Class Reference
Inheritance diagram for oxygine::STDRenderer:
oxygine::IElementRenderer oxygine::MaskedRenderer

Public Member Functions

 STDRenderer (IVideoDriver *driver=0)
 
const MatrixgetViewProjection () const
 
IVideoDrivergetDriver ()
 
unsigned int getShaderFlags () const
 
void setDriver (IVideoDriver *)
 
OXYGINE_DEPRECATED void setViewProjTransform (const Matrix &view, const Matrix &proj)
 
void setViewProjTransform (const Matrix &viewProj)
 
void setVertexDeclaration (const VertexDeclaration *decl)
 
void setUberShaderProgram (UberShaderProgram *pr)
 
void setBlendMode (blend_mode blend)
 
void setTexture (const spNativeTexture &base, const spNativeTexture &alpha, bool basePremultiplied=true)
 
void setTexture (const spNativeTexture &base, bool basePremultiplied=true)
 
void setTransform (const Transform &tr)
 
void beginElementRendering (bool basePremultiplied)
 
void beginSDFont (float contrast, float offset, const Color &outlineColor, float outlineOffset)
 
void endSDFont ()
 
void drawElement (const spNativeTexture &texture, unsigned int color, const RectF &src, const RectF &dest) OVERRIDE
 
void draw (const Color &, const RectF &srcRect, const RectF &destRect)
 
void drawBatch ()
 
void begin (STDRenderer *prev)
 
void end ()
 
void initCoordinateSystem (int width, int height, bool flipU=false)
 
void resetSettings ()
 
void cleanup ()
 
virtual void addVertices (const void *data, unsigned int size)
 

Static Public Member Functions

static void setDefaultSettings ()
 
static void initialize ()
 
static void release ()
 
static void reset ()
 
static bool isReady ()
 
static void restore ()
 

Static Public Attributes

static STDRendererinstance
 
static spNativeTexture white
 
static spNativeTexture invisible
 
static UberShaderProgram uberShader
 
static std::vector< unsigned char > uberShaderBody
 
static std::vector< unsigned short > indices16
 
static size_t maxVertices
 

Protected Member Functions

void setShader (ShaderProgram *prog)
 
void _drawBatch ()
 
void _addVertices (const void *data, unsigned int size)
 
void _checkDrawBatch ()
 
virtual void preDrawBatch ()
 
virtual void _cleanup ()
 
virtual void _begin ()
 
virtual void _resetSettings ()
 

Protected Attributes

Transform _transform
 
STDRenderer_previous
 
std::vector< unsigned char > _vertices
 
const VertexDeclaration_vdecl
 
IVideoDriver_driver
 
ShaderProgram_program
 
Matrix _vp
 
spNativeTexture _base
 
spNativeTexture _alpha
 
blend_mode _blend
 
UberShaderProgram_uberShader
 
unsigned int _shaderFlags
 

Member Function Documentation

§ begin()

void oxygine::STDRenderer::begin ( STDRenderer prev)

Begins rendering into RenderTexture or into primary framebuffer if rt is null

§ cleanup()

void oxygine::STDRenderer::cleanup ( )

Cleans existing accumulated batch.

§ drawBatch()

void oxygine::STDRenderer::drawBatch ( )

Draws existing batch immediately.

§ end()

void oxygine::STDRenderer::end ( )

Completes started rendering and restores previous Frame Buffer.

§ initCoordinateSystem()

void oxygine::STDRenderer::initCoordinateSystem ( int  width,
int  height,
bool  flipU = false 
)

initializes View + Projection matrices where TopLeft is (0,0) and RightBottom is (width, height). use flipU = true for render to texture

§ initialize()

static void oxygine::STDRenderer::initialize ( )
static

Initializes internal classes. Called automatically from oxygine::init();

§ isReady()

static bool oxygine::STDRenderer::isReady ( )
static

is Renderer was restored and ready to be used

§ release()

static void oxygine::STDRenderer::release ( )
static

Clears internal data

§ reset()

static void oxygine::STDRenderer::reset ( )
static

for lost context

§ restore()

static void oxygine::STDRenderer::restore ( )
static

restore after lost context

§ setBlendMode()

void oxygine::STDRenderer::setBlendMode ( blend_mode  blend)

Sets blend mode. Default value is blend_premultiplied_alpha

§ setDefaultSettings()

static void oxygine::STDRenderer::setDefaultSettings ( )
static

Sets default rendering OpenGL options for 2D

§ setTexture()

void oxygine::STDRenderer::setTexture ( const spNativeTexture &  base,
const spNativeTexture &  alpha,
bool  basePremultiplied = true 
)

Sets texture. If texture is null White texture would be used.

§ setTransform()

void oxygine::STDRenderer::setTransform ( const Transform &  tr)
inline

Sets World transformation.

Member Data Documentation

§ white

spNativeTexture oxygine::STDRenderer::white
static

White 4x4 Texture


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