*/
void SetTextures( TextureSet* textureSet );
+ /**
+ * Returns current texture set object
+ * @return Pointer to the texture set
+ */
+ const TextureSet* GetTextures() const
+ {
+ return mTextureSet;
+ }
/**
* Set the shader for the renderer
* Get the shader used by this renderer
* @return the shader this renderer uses
*/
- Shader& GetShader()
+ const Shader& GetShader() const
{
return *mShader;
}
void SetGeometry( Render::Geometry* geometry );
/**
+ * Get the geometry of this renderer
+ * @return the geometry this renderer uses
+ */
+ const Render::Geometry& GetGeometry() const
+ {
+ return *mGeometry;
+ }
+
+ /**
* Set the depth index
* @param[in] depthIndex the new depth index to use
*/
void SetDepthFunction( DepthFunction::Type depthFunction );
/**
- * Sets the render mode
- * @param[in] mode The render mode
+ * Sets the stencil mode
+ * @param[in] mode The stencil function
*/
- void SetRenderMode( RenderMode::Type mode );
+ void SetStencilMode( StencilMode::Type mode );
/**
* Sets the stencil function
void SetStencilOperationOnZPass( StencilOperation::Type stencilOperationOnZPass );
/**
+ * Sets whether or not to write to the color buffer
+ * @param[in] writeToColorBuffer True to write to the color buffer
+ */
+ void SetWriteToColorBuffer( bool writeToColorBuffer );
+
+ /**
+ * Turns on batching feature for the renderer
+ * @param[in] batchingEnabled if true, enables the batching mode for the renderer
+ */
+ void SetBatchingEnabled( bool batchingEnabled );
+
+ /**
+ * Tests whether batching feature is enabled for this renderer
+ * @return batching state
+ */
+ bool IsBatchingEnabled() const
+ {
+ return mBatchingEnabled;
+ }
+
+ /**
* Prepare the object for rendering.
* This is called by the UpdateManager when an object is due to be rendered in the current frame.
* @param[in] updateBufferIndex The current update buffer index.
BlendMode::Type mBlendMode:2; ///< Local copy of the mode of blending
DepthWriteMode::Type mDepthWriteMode:2; ///< Local copy of the depth write mode
DepthTestMode::Type mDepthTestMode:2; ///< Local copy of the depth test mode
+ bool mWriteToColorBuffer:1; ///< Local copy of the write to color buffer flag
bool mUniformMapChanged[2]; ///< Records if the uniform map has been altered this frame
bool mResourcesReady; ///< Set during the Update algorithm; true if the renderer has resources ready for the current frame.
public:
+ bool mBatchingEnabled : 1; ///< Flag indicating whether the render supports batching
int mDepthIndex; ///< Used only in PrepareRenderInstructions
};
new (slot) LocalType( &renderer, &Renderer::SetDepthFunction, depthFunction );
}
-inline void SetRenderModeMessage( EventThreadServices& eventThreadServices, const Renderer& renderer, RenderMode::Type mode )
+inline void SetStencilModeMessage( EventThreadServices& eventThreadServices, const Renderer& renderer, StencilMode::Type mode )
{
- typedef MessageValue1< Renderer, RenderMode::Type > LocalType;
+ typedef MessageValue1< Renderer, StencilMode::Type > LocalType;
// Reserve some memory inside the message queue
unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
- new (slot) LocalType( &renderer, &Renderer::SetRenderMode, mode );
+ new (slot) LocalType( &renderer, &Renderer::SetStencilMode, mode );
}
inline void SetStencilFunctionMessage( EventThreadServices& eventThreadServices, const Renderer& renderer, StencilFunction::Type stencilFunction )
new (slot) LocalType( &renderer, &Renderer::SetStencilOperationOnZPass, stencilOperation );
}
+inline void SetWriteToColorBufferMessage( EventThreadServices& eventThreadServices, const Renderer& renderer, bool writeToColorBuffer )
+{
+ typedef MessageValue1< Renderer, bool > LocalType;
+
+ // Reserve some memory inside the message queue
+ unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+
+ new (slot) LocalType( &renderer, &Renderer::SetWriteToColorBuffer, writeToColorBuffer );
+}
+
+inline void SetBatchingEnabledMessage( EventThreadServices& eventThreadServices, const Renderer& renderer, bool batchable )
+{
+ typedef MessageValue1< Renderer, bool > LocalType;
+
+ // Reserve some memory inside the message queue
+ unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+
+ new (slot) LocalType( &renderer, &Renderer::SetBatchingEnabled, batchable );
+}
} // namespace SceneGraph
} // namespace Internal