TalanSoft Toolkits  201707
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
List of all members
iPainterRenderContext Struct Referenceabstract
Inheritance diagram for iPainterRenderContext:
iUnknown

Detailed Description

Painter render context interface.

General

virtual iPainterGetPainter () const =0
 Get the parent painter object. {Property}. More...
 
virtual void SetGraphicsContext (iGraphicsContext *apContext)=0
 Set the graphics context object. {Property}. More...
 
virtual iGraphicsContextGetGraphicsContext () const =0
 Get the graphics context object. {Property}. More...
 
virtual iFixedStatesGetFixedStates () const =0
 Get the fixed states of the graphics context object. {Property}. More...
 
virtual sRecti GetViewport () const =0
 Get the graphics context's current viewport. {Property}. More...
 
virtual iCanvasGetCanvas () const =0
 Get the graphics rendering context's canvas. {Property}. More...
 
virtual iPainterStatesGetStates () const =0
 Get the render context's states. {Property}. More...
 
virtual tBool SerializeDataTable (iDataTable *apDT, tSerializeFlags aFlags)=0
 Serialize the states and the render path setup in a datatable. More...
 
virtual void SetRenderPath (iPainterRenderPath *apRenderPath)=0
 Set the render path. {Property}. More...
 
virtual iPainterRenderPathGetRenderPath () const =0
 Get the render path. {Property}. More...
 

Low-level API

virtual ni::tBool BeginPass (tU32 aMaterialAndFlags, tU32 aMaterialNotFlags, tU32 anVertexShader, tU32 anPixelShader, tU32 aUserCacheFlags, iPainterLight *apLight)=0
 Begin a rendering pass, to be called by a render path. More...
 
virtual void EndPass ()=0
 End a rendering pass, to be called by a render path. More...
 
virtual ni::tBool PrepareMaterial (ni::tFVF aFVF, iMaterial *apMat)=0
 Prepare the specified material/FVF for rendering. More...
 
virtual ni::tBool DrawOperation (iDrawOperation *pOp)=0
 Draw a draw operation with the currently prepared material and flags. More...
 
virtual iPainterShaderCacheGetShaderCache () const =0
 Get the shader cache. {Property}. More...
 
virtual ni::tBool UpdateShaderCacheFlags (tFVF aFVF, iMaterial *apMat)=0
 Update the shader cache flags of the render context. More...
 
virtual ni::iPainterShaderGetShader (tU32 anIndex) const =0
 Get a shader from the shader cache. More...
 
virtual tPainterShaderFlags GetUserCacheFlags () const =0
 Get the user cache flags. {Property}. More...
 
virtual ni::tBool TestMaterialFlags (tMaterialFlags aFlags) const =0
 Test the specified material flags. More...
 
virtual ni::tBool TestMaterial (iMaterial *apMat) const =0
 Test the specified material. More...
 
virtual tU32 GetMaterialAndFlags () const =0
 Get the material 'and' flags. {Property}. More...
 
virtual tU32 GetMaterialNotFlags () const =0
 Get the material 'not' flags. {Property}. More...
 
virtual iPainterLightGetLight () const =0
 Get the current light used for the rendering. {Property}. More...
 
virtual tBool GetHasShader () const =0
 Get whether any shader is set. {Property}. More...
 
virtual ni::iPainterShaderGetVertexShader (const tUUID &aCacheFlags, iMaterial *apMat) const =0
 Fetch a vertex shader from the cache. {Property}. More...
 
virtual ni::iPainterShaderGetPixelShader (const tUUID &aCacheFlags, iMaterial *apMat) const =0
 Fetch a pixel shader from the cache. {Property}. More...
 
virtual iMaterialEnablePresetMaterial ()=0
 Enable the preset material. More...
 
virtual ni::tBool EnableSink (iPainterRenderContextSink *apSink)=0
 Enable the render context sink. More...
 
virtual tBool EnableMaterialFading (iMaterial *apMaterial, tF32 afFading, tBool abSmooth)=0
 Enable default material preset fading effect. More...
 
virtual tBool DisableMaterialFading (iMaterial *apMaterial)=0
 Disable default material preset fading effect. More...
 
virtual iMaterialGetPresetMaterial () const =0
 Get the preset material if enabled. {Property}. More...
 
virtual ni::tBool EnableDepthOnly (ni::tBool abUseDefaultVS, ni::tBool abUseDefaultPS)=0
 Enable depth only rendering. More...
 
virtual ni::tBool EnableBlendMode (ni::eBlendMode aBlendMode)=0
 Enable a forced blend mode. More...
 
virtual tBool SetupTargetMaterial (iPainterShader *apShader, iMaterial *apTarget, const iMaterial *apSource, const iMaterial *apPreset, const iFixedStates *apFS)=0
 Setup a target material from a source and preset material. More...
 

High-level API

virtual tBool SetPainterRenderTarget (ePainterRT aRT, tPaintRenderTargetFlags aRenderRTFlags)=0
 Set a painter render target as render target of the specified graphics context. More...
 
virtual tBool SetPainterRenderTargetEx (ePainterRT aRT, tPaintRenderTargetFlags aRenderRTFlags, iTexture *apRT0, iTexture *apRT1, iTexture *apRT2, iTexture *apRT3, iTexture *apDS)=0
 Set render targets as render targets of the specified graphics context. More...
 
virtual tBool GetHasPaintingBegan () const =0
 {Property} More...
 
virtual sVec4f GetLastTime () const =0
 Get the last time used for rendering. Vec4(elapsed time, root timeline time, sin(elapsed time), frame time) {Property}. More...
 
virtual tU32 PaintBegin (iPainterDrawSet *apDrawSet, const sVec4f &avTime)=0
 Paint setup and render the render targets required for post processing. More...
 
virtual tU32 PaintEnd (iPainterDrawSet *apDrawSet)=0
 Paint debug and 2d channels. More...
 
virtual tU32 PaintEditMode (iPainterDrawSet *apDrawSet)=0
 Paint the editmode channel. More...
 
virtual tU32 PaintDebug (iPainterDrawSet *apDrawSet)=0
 Paint the debug channel. More...
 
virtual tU32 PaintBackground (iPainterDrawSet *apDrawSet)=0
 
virtual tU32 PaintBackgroundEx (iPainterDrawSet *apDrawSet, ni::tU32 anVS, ni::tU32 anPS, ni::tU32 anUserCacheFlags, tU32 aMaterialAndFlags, tU32 aMaterialNotFlags, ni::iPainterRenderContextSink *apSink)=0
 
virtual tU32 PaintForegroundEx (iPainterDrawSet *apDrawSet, ni::tU32 anVS, ni::tU32 anPS, ni::tU32 anUserCacheFlags, tU32 aMaterialAndFlags, tU32 aMaterialNotFlags, ni::iPainterRenderContextSink *apSink)=0
 
virtual tU32 PaintForeground (iPainterDrawSet *apDrawSet)=0
 
virtual tU32 PaintBase (iPainterDrawSet *apDrawSet)=0
 
virtual tU32 PaintTranslucent (iPainterDrawSet *apDrawSet)=0
 
virtual tU32 PaintBaseFixed (iPainterDrawSet *apDrawSet)=0
 
virtual tU32 PaintBaseFixedEx (iPainterDrawSet *apDrawSet, ni::tU32 anVS, ni::tU32 anPS, ni::tU32 anUserCacheFlags, tU32 aMaterialAndFlags, tU32 aMaterialNotFlags, ni::iPainterRenderContextSink *apSink)=0
 
virtual tU32 PaintTranslucentFixed (iPainterDrawSet *apDrawSet)=0
 
virtual tU32 PaintTranslucentFixedEx (iPainterDrawSet *apDrawSet, ni::tU32 anVS, ni::tU32 anPS, ni::tU32 anUserCacheFlags, tU32 aMaterialAndFlags, tU32 aMaterialNotFlags, ni::iPainterRenderContextSink *apSink)=0
 
virtual tU32 PaintDepthOnly (iPainterDrawSet *apDrawSet)=0
 
virtual tU32 PaintPrepareLights (iPainterDrawSet *apDrawSet)=0
 
virtual tU32 PaintShadowMaps (iPainterDrawSet *apDrawSet)=0
 
virtual tU32 PaintRenderTargets (iPainterDrawSet *apDrawSet, tU32 anRTToPaintFlags, tClearBuffersFlags aClearFlags, tU32 aClearColor, tF32 aClearDepth, tU32 aClearStencil)=0
 
virtual tU32 PaintRenderTarget (iPainterDrawSet *apDrawSet, ePainterRT aRT, tPaintRenderTargetFlags aFlags, tClearBuffersFlags aClearFlags, tU32 aClearColor, tF32 aClearDepth, tU32 aClearStencil)=0
 
virtual tU32 PaintPostProcess (iPainterDrawSet *apDrawSet, ePainterRenderMode aMode)=0
 Called by the render path and PaintEnd. More...
 
virtual tBool BlitBegin ()=0
 
virtual tBool BlitEnd ()=0
 
virtual tBool BlitMaterial (iMaterial *apMaterial, const sRectf &arectSrc, const sRectf &arectDest, tU32 anVertexColor=0xFFFFFFFF)=0
 
virtual tBool BlitRenderTargetMaterial (iMaterial *apMaterial, const sRectf &arectDest, tU32 anVertexColor=0xFFFFFFFF)=0
 
virtual void SetGraphicsStates (tU32 aStates)=0
 
virtual void UpdateFixedShaderConstants (iDrawOperation *apDrawOp)=0
 

Additional Inherited Members

- Public Member Functions inherited from iUnknown
virtual tBool IsOK () const =0
 Check if the object is valid. More...
 
virtual tI32 AddRef ()=0
 Signal that one more reference of the object has been created. More...
 
virtual tI32 Release ()=0
 Release a reference of the object. More...
 
virtual void DeleteThis ()=0
 Bypass any reference counting and delete this object. More...
 
virtual void Invalidate ()=0
 Invalidate the object. More...
 
virtual iUnknownQueryInterface (const tUUID &aIID)=0
 Query an interface. More...
 
virtual void ListInterfaces (iMutableCollection *apLst, tU32 anFlags) const =0
 Fill a UUID list containing the UUIDs of the implemented interfaces. More...
 
virtual tI32 SetNumRefs (tI32 anNumRefs)=0
 Set the reference counter directly. More...
 
virtual tI32 GetNumRefs () const =0
 Get the number of references to this object. More...
 

Member Function Documentation

virtual iPainter* GetPainter ( ) const
pure virtual

Get the parent painter object. {Property}.

virtual void SetGraphicsContext ( iGraphicsContext apContext)
pure virtual

Set the graphics context object. {Property}.

virtual iGraphicsContext* GetGraphicsContext ( ) const
pure virtual

Get the graphics context object. {Property}.

virtual iFixedStates* GetFixedStates ( ) const
pure virtual

Get the fixed states of the graphics context object. {Property}.

Remarks
This can be used to retrieve the current camera matrices.
virtual sRecti GetViewport ( ) const
pure virtual

Get the graphics context's current viewport. {Property}.

virtual iCanvas* GetCanvas ( ) const
pure virtual

Get the graphics rendering context's canvas. {Property}.

virtual iPainterStates* GetStates ( ) const
pure virtual

Get the render context's states. {Property}.

virtual tBool SerializeDataTable ( iDataTable apDT,
tSerializeFlags  aFlags 
)
pure virtual

Serialize the states and the render path setup in a datatable.

virtual void SetRenderPath ( iPainterRenderPath apRenderPath)
pure virtual

Set the render path. {Property}.

virtual iPainterRenderPath* GetRenderPath ( ) const
pure virtual

Get the render path. {Property}.

virtual ni::tBool BeginPass ( tU32  aMaterialAndFlags,
tU32  aMaterialNotFlags,
tU32  anVertexShader,
tU32  anPixelShader,
tU32  aUserCacheFlags,
iPainterLight apLight 
)
pure virtual

Begin a rendering pass, to be called by a render path.

virtual void EndPass ( )
pure virtual

End a rendering pass, to be called by a render path.

virtual ni::tBool PrepareMaterial ( ni::tFVF  aFVF,
iMaterial apMat 
)
pure virtual

Prepare the specified material/FVF for rendering.

Returns
eFalse if the material shouldn't be drawn.
virtual ni::tBool DrawOperation ( iDrawOperation pOp)
pure virtual

Draw a draw operation with the currently prepared material and flags.

virtual iPainterShaderCache* GetShaderCache ( ) const
pure virtual

Get the shader cache. {Property}.

virtual ni::tBool UpdateShaderCacheFlags ( tFVF  aFVF,
iMaterial apMat 
)
pure virtual

Update the shader cache flags of the render context.

virtual ni::iPainterShader* GetShader ( tU32  anIndex) const
pure virtual

Get a shader from the shader cache.

virtual tPainterShaderFlags GetUserCacheFlags ( ) const
pure virtual

Get the user cache flags. {Property}.

virtual ni::tBool TestMaterialFlags ( tMaterialFlags  aFlags) const
pure virtual

Test the specified material flags.

virtual ni::tBool TestMaterial ( iMaterial apMat) const
pure virtual

Test the specified material.

virtual tU32 GetMaterialAndFlags ( ) const
pure virtual

Get the material 'and' flags. {Property}.

virtual tU32 GetMaterialNotFlags ( ) const
pure virtual

Get the material 'not' flags. {Property}.

virtual iPainterLight* GetLight ( ) const
pure virtual

Get the current light used for the rendering. {Property}.

virtual tBool GetHasShader ( ) const
pure virtual

Get whether any shader is set. {Property}.

virtual ni::iPainterShader* GetVertexShader ( const tUUID aCacheFlags,
iMaterial apMat 
) const
pure virtual

Fetch a vertex shader from the cache. {Property}.

virtual ni::iPainterShader* GetPixelShader ( const tUUID aCacheFlags,
iMaterial apMat 
) const
pure virtual

Fetch a pixel shader from the cache. {Property}.

virtual iMaterial* EnablePresetMaterial ( )
pure virtual

Enable the preset material.

virtual ni::tBool EnableSink ( iPainterRenderContextSink apSink)
pure virtual

Enable the render context sink.

virtual tBool EnableMaterialFading ( iMaterial apMaterial,
tF32  afFading,
tBool  abSmooth 
)
pure virtual

Enable default material preset fading effect.

Remarks
Should be called before PrepareMaterial
virtual tBool DisableMaterialFading ( iMaterial apMaterial)
pure virtual

Disable default material preset fading effect.

virtual iMaterial* GetPresetMaterial ( ) const
pure virtual

Get the preset material if enabled. {Property}.

virtual ni::tBool EnableDepthOnly ( ni::tBool  abUseDefaultVS,
ni::tBool  abUseDefaultPS 
)
pure virtual

Enable depth only rendering.

Remarks
Should be called before PrepareMaterial
virtual ni::tBool EnableBlendMode ( ni::eBlendMode  aBlendMode)
pure virtual

Enable a forced blend mode.

virtual tBool SetupTargetMaterial ( iPainterShader apShader,
iMaterial apTarget,
const iMaterial apSource,
const iMaterial apPreset,
const iFixedStates apFS 
)
pure virtual

Setup a target material from a source and preset material.

virtual tBool SetPainterRenderTarget ( ePainterRT  aRT,
tPaintRenderTargetFlags  aRenderRTFlags 
)
pure virtual

Set a painter render target as render target of the specified graphics context.

virtual tBool SetPainterRenderTargetEx ( ePainterRT  aRT,
tPaintRenderTargetFlags  aRenderRTFlags,
iTexture apRT0,
iTexture apRT1,
iTexture apRT2,
iTexture apRT3,
iTexture apDS 
)
pure virtual

Set render targets as render targets of the specified graphics context.

Remarks
Also setup the viewport of the context to fit the render target.
virtual tBool GetHasPaintingBegan ( ) const
pure virtual

{Property}

virtual sVec4f GetLastTime ( ) const
pure virtual

Get the last time used for rendering. Vec4(elapsed time, root timeline time, sin(elapsed time), frame time) {Property}.

virtual tU32 PaintBegin ( iPainterDrawSet apDrawSet,
const sVec4f avTime 
)
pure virtual

Paint setup and render the render targets required for post processing.

virtual tU32 PaintEnd ( iPainterDrawSet apDrawSet)
pure virtual

Paint debug and 2d channels.

virtual tU32 PaintEditMode ( iPainterDrawSet apDrawSet)
pure virtual

Paint the editmode channel.

virtual tU32 PaintDebug ( iPainterDrawSet apDrawSet)
pure virtual

Paint the debug channel.

virtual tU32 PaintBackground ( iPainterDrawSet apDrawSet)
pure virtual
virtual tU32 PaintBackgroundEx ( iPainterDrawSet apDrawSet,
ni::tU32  anVS,
ni::tU32  anPS,
ni::tU32  anUserCacheFlags,
tU32  aMaterialAndFlags,
tU32  aMaterialNotFlags,
ni::iPainterRenderContextSink apSink 
)
pure virtual
virtual tU32 PaintForegroundEx ( iPainterDrawSet apDrawSet,
ni::tU32  anVS,
ni::tU32  anPS,
ni::tU32  anUserCacheFlags,
tU32  aMaterialAndFlags,
tU32  aMaterialNotFlags,
ni::iPainterRenderContextSink apSink 
)
pure virtual
virtual tU32 PaintForeground ( iPainterDrawSet apDrawSet)
pure virtual
virtual tU32 PaintBase ( iPainterDrawSet apDrawSet)
pure virtual
virtual tU32 PaintTranslucent ( iPainterDrawSet apDrawSet)
pure virtual
virtual tU32 PaintBaseFixed ( iPainterDrawSet apDrawSet)
pure virtual
virtual tU32 PaintBaseFixedEx ( iPainterDrawSet apDrawSet,
ni::tU32  anVS,
ni::tU32  anPS,
ni::tU32  anUserCacheFlags,
tU32  aMaterialAndFlags,
tU32  aMaterialNotFlags,
ni::iPainterRenderContextSink apSink 
)
pure virtual
virtual tU32 PaintTranslucentFixed ( iPainterDrawSet apDrawSet)
pure virtual
virtual tU32 PaintTranslucentFixedEx ( iPainterDrawSet apDrawSet,
ni::tU32  anVS,
ni::tU32  anPS,
ni::tU32  anUserCacheFlags,
tU32  aMaterialAndFlags,
tU32  aMaterialNotFlags,
ni::iPainterRenderContextSink apSink 
)
pure virtual
virtual tU32 PaintDepthOnly ( iPainterDrawSet apDrawSet)
pure virtual
virtual tU32 PaintPrepareLights ( iPainterDrawSet apDrawSet)
pure virtual
virtual tU32 PaintShadowMaps ( iPainterDrawSet apDrawSet)
pure virtual
Remarks
Called by PaintPrepareLights when necessary.
virtual tU32 PaintRenderTargets ( iPainterDrawSet apDrawSet,
tU32  anRTToPaintFlags,
tClearBuffersFlags  aClearFlags,
tU32  aClearColor,
tF32  aClearDepth,
tU32  aClearStencil 
)
pure virtual
virtual tU32 PaintRenderTarget ( iPainterDrawSet apDrawSet,
ePainterRT  aRT,
tPaintRenderTargetFlags  aFlags,
tClearBuffersFlags  aClearFlags,
tU32  aClearColor,
tF32  aClearDepth,
tU32  aClearStencil 
)
pure virtual
virtual tU32 PaintPostProcess ( iPainterDrawSet apDrawSet,
ePainterRenderMode  aMode 
)
pure virtual

Called by the render path and PaintEnd.

virtual tBool BlitBegin ( )
pure virtual
virtual tBool BlitEnd ( )
pure virtual
virtual tBool BlitMaterial ( iMaterial apMaterial,
const sRectf arectSrc,
const sRectf arectDest,
tU32  anVertexColor = 0xFFFFFFFF 
)
pure virtual
virtual tBool BlitRenderTargetMaterial ( iMaterial apMaterial,
const sRectf arectDest,
tU32  anVertexColor = 0xFFFFFFFF 
)
pure virtual
virtual void SetGraphicsStates ( tU32  aStates)
pure virtual
virtual void UpdateFixedShaderConstants ( iDrawOperation apDrawOp)
pure virtual