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

Detailed Description

Graphics context description interface.

System

virtual iGraphicsContextCreateContextInstance ()=0
 Create an instance of the context. More...
 
virtual iGraphicsGetGraphics () const =0
 Get the context's graphics object. {Property}. More...
 
virtual iGraphicsDriverGetDriver () const =0
 Get the context's driver. {Property}. More...
 
virtual tU32 GetWidth () const =0
 Get the context width. {Property}. More...
 
virtual tU32 GetHeight () const =0
 Get the context height. {Property}. More...
 
virtual tBool ResetAllCaches ()=0
 Reset all caches to zero. More...
 
virtual tBool ChangeWindow (iOSWindow *apWindow)=0
 Change the os window the context renders into. More...
 
virtual iOSWindowGetWindow () const =0
 Get the target OS window if any. {Property}. More...
 

Render targets and main buffers

virtual void ClearBuffers (tClearBuffersFlags clearBuffer, tU32 anColor, tF32 afDepth, tI32 anStencil)=0
 Clear the specified main buffers. More...
 
virtual tBool SetRenderTarget (iTexture *apColor, iTexture *apDepthStencil)=0
 Set the render target to one texture and one depth buffer. More...
 
virtual tBool SetRenderTargets (iTexture *apColor0, iTexture *apColor1, iTexture *apColor2, iTexture *apColor3, iTexture *apDepthStencil)=0
 Set all render targets and the depth buffer. More...
 
virtual iTextureGetRenderTarget (tU32 anIndex) const =0
 Get the render target set on the specified index. More...
 
virtual iTextureGetDepthStencil () const =0
 Get the depth stencil target. More...
 
virtual iTextureGetMainRenderTarget () const =0
 Get the main render target (back buffer). {Property}. More...
 
virtual iTextureGetMainDepthStencil () const =0
 Get the main depth stencil. {Property}. More...
 
virtual tBool Display (tGraphicsDisplayFlags aFlags, const sRecti &aRect)=0
 Display the canvas in its destination window/context. More...
 

Rendering

virtual tBool DrawOperation (iDrawOperation *apDrawOp)=0
 Draw the specified draw operation. More...
 

Rendering capture

virtual iBitmap2DCaptureFrontBuffer () const =0
 Capture the front buffer. More...
 

States

virtual void SetViewport (const sRecti &aVal)=0
 Set the viewport. {Property}. More...
 
virtual sRecti GetViewport () const =0
 Get the viewport. {Property}. More...
 
virtual void SetScissorRect (const sRecti &aVal)=0
 Set the scissor rectangle. {Property}. More...
 
virtual sRecti GetScissorRect () const =0
 Get the scissor rectangle. {Property}. More...
 
virtual tBool SetFixedStates (iFixedStates *apStates)=0
 Set the default fixed pipeline states. {Property}. More...
 
virtual iFixedStatesGetFixedStates () const =0
 Get the default fixed pipeline states. {Property}. More...
 

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 iGraphicsContext* CreateContextInstance ( )
pure virtual

Create an instance of the context.

Remarks
A context instance shares everything with its parent excepted its states and render targets.
virtual iGraphics* GetGraphics ( ) const
pure virtual

Get the context's graphics object. {Property}.

virtual iGraphicsDriver* GetDriver ( ) const
pure virtual

Get the context's driver. {Property}.

virtual tU32 GetWidth ( ) const
pure virtual

Get the context width. {Property}.

virtual tU32 GetHeight ( ) const
pure virtual

Get the context height. {Property}.

virtual tBool ResetAllCaches ( )
pure virtual

Reset all caches to zero.

Remarks
This is to be called after using any Native API used by the renderer. If not called the cached states, textures, shaders, etc... wont be properly syncronised, resulting in unpredicatable behaviours.
virtual tBool ChangeWindow ( iOSWindow apWindow)
pure virtual

Change the os window the context renders into.

virtual iOSWindow* GetWindow ( ) const
pure virtual

Get the target OS window if any. {Property}.

virtual void ClearBuffers ( tClearBuffersFlags  clearBuffer,
tU32  anColor,
tF32  afDepth,
tI32  anStencil 
)
pure virtual

Clear the specified main buffers.

Parameters
clearBufferspecifies the buffers to clear.
anColoris the color to use to clear the color buffer.
afDepthis the value to use to clear the depth buffer.
anStencilis the value to use to clear the stencil buffer.
virtual tBool SetRenderTarget ( iTexture apColor,
iTexture apDepthStencil 
)
pure virtual

Set the render target to one texture and one depth buffer.

Remarks
Passing invalid objects will set the main buffers.
Might be ignored by some contexts
virtual tBool SetRenderTargets ( iTexture apColor0,
iTexture apColor1,
iTexture apColor2,
iTexture apColor3,
iTexture apDepthStencil 
)
pure virtual

Set all render targets and the depth buffer.

Remarks
Might be ignored by some contexts
virtual iTexture* GetRenderTarget ( tU32  anIndex) const
pure virtual

Get the render target set on the specified index.

Remarks
Might be ignored by some contexts {Property}
virtual iTexture* GetDepthStencil ( ) const
pure virtual

Get the depth stencil target.

Remarks
Might be ignored by some contexts {Property}
virtual iTexture* GetMainRenderTarget ( ) const
pure virtual

Get the main render target (back buffer). {Property}.

virtual iTexture* GetMainDepthStencil ( ) const
pure virtual

Get the main depth stencil. {Property}.

virtual tBool Display ( tGraphicsDisplayFlags  aFlags,
const sRecti aRect 
)
pure virtual

Display the canvas in its destination window/context.

Remarks
Should be called once rendering to the context is finished, this will flush and unlock shared resources for drivers that dont fully support multi-threaded rendering. If you do not wish to show the content of the context use eGraphicsDisplayFlags_Skip.
virtual tBool DrawOperation ( iDrawOperation apDrawOp)
pure virtual

Draw the specified draw operation.

virtual iBitmap2D* CaptureFrontBuffer ( ) const
pure virtual

Capture the front buffer.

virtual void SetViewport ( const sRecti aVal)
pure virtual

Set the viewport. {Property}.

virtual sRecti GetViewport ( ) const
pure virtual

Get the viewport. {Property}.

virtual void SetScissorRect ( const sRecti aVal)
pure virtual

Set the scissor rectangle. {Property}.

virtual sRecti GetScissorRect ( ) const
pure virtual

Get the scissor rectangle. {Property}.

virtual tBool SetFixedStates ( iFixedStates apStates)
pure virtual

Set the default fixed pipeline states. {Property}.

virtual iFixedStates* GetFixedStates ( ) const
pure virtual

Get the default fixed pipeline states. {Property}.