+Renderer* Renderer::New( SceneGraph::RenderDataProvider* dataProvider,
+ Render::Geometry* geometry,
+ unsigned int blendingBitmask,
+ const Vector4* blendColor,
+ FaceCullingMode::Type faceCullingMode,
+ bool preMultipliedAlphaEnabled,
+ DepthWriteMode::Type depthWriteMode,
+ DepthTestMode::Type depthTestMode,
+ DepthFunction::Type depthFunction,
+ StencilParameters& stencilParameters,
+ bool writeToColorBuffer )
+{
+ return new Renderer( dataProvider, geometry, blendingBitmask, blendColor,
+ faceCullingMode, preMultipliedAlphaEnabled, depthWriteMode, depthTestMode,
+ depthFunction, stencilParameters, writeToColorBuffer );
+}
+
+Renderer::Renderer( SceneGraph::RenderDataProvider* dataProvider,
+ Render::Geometry* geometry,
+ unsigned int blendingBitmask,
+ const Vector4* blendColor,
+ FaceCullingMode::Type faceCullingMode,
+ bool preMultipliedAlphaEnabled,
+ DepthWriteMode::Type depthWriteMode,
+ DepthTestMode::Type depthTestMode,
+ DepthFunction::Type depthFunction,
+ StencilParameters& stencilParameters,
+ bool writeToColorBuffer )
+: mRenderDataProvider( dataProvider ),
+ mContext( NULL),
+ mTextureCache( NULL ),
+ mUniformNameCache( NULL ),
+ mGeometry( geometry ),
+ mUniformIndexMap(),
+ mAttributesLocation(),
+ mStencilParameters( stencilParameters ),
+ mBlendingOptions(),
+ mIndexedDrawFirstElement( 0 ),
+ mIndexedDrawElementsCount( 0 ),
+ mDepthFunction( depthFunction ),
+ mFaceCullingMode( faceCullingMode ),
+ mDepthWriteMode( depthWriteMode ),
+ mDepthTestMode( depthTestMode ),
+ mWriteToColorBuffer( writeToColorBuffer ),
+ mUpdateAttributesLocation( true ),
+ mPremultipledAlphaEnabled( preMultipliedAlphaEnabled )
+{
+ if( blendingBitmask != 0u )
+ {
+ mBlendingOptions.SetBitmask( blendingBitmask );
+ }
+
+ if( blendColor )
+ {
+ mBlendingOptions.SetBlendColor( *blendColor );
+ }
+}
+