Nez.Portable/Graphics/Renderers/Renderer.cs
/// <summary>
/// renders the RenderableComponent flushing the Batcher and resetting current material if necessary
/// </summary>
/// <param name="renderable">Renderable.</param>
/// <param name="cam">Cam.</param>
renders the RenderableComponent flushing the Batcher and resetting current material if necessary
renders the RenderableComponent flushing the Batcher and resetting current material if necessary
[MethodImpl(MethodImplOptions.AggressiveInlining)]
        protected void renderAfterStateCheck(IRenderable renderable, Camera cam)
        {
            if (renderable.material != null && renderable.material != _currentMaterial)
            {
                _currentMaterial = renderable.material;
                if (_currentMaterial.effect != null)
                    _currentMaterial.onPreRender(cam);
                flushBatch(cam);
            }
            else if (renderable.material == null && _currentMaterial != material)
            {
                _currentMaterial = material;
                flushBatch(cam);
            }
            renderable.render(Graphics.instance, cam);
        }
[ MethodImpl ( MethodImplOptions . AggressiveInlining ) ] protected void renderAfterStateCheck ( IRenderable renderable , Camera cam ) { if ( renderable . material != null && renderable . material != _currentMaterial ) { _currentMaterial = renderable . material ; if ( _currentMaterial . effect != null ) _currentMaterial . onPreRender ( cam ) ; flushBatch ( cam ) ; } else if ( renderable . material == null && _currentMaterial != material ) { _currentMaterial = material ; flushBatch ( cam ) ; } renderable . render ( Graphics . instance , cam ) ; }
renders the RenderableComponent flushing the Batcher and resetting current material if necessary
renders the RenderableComponent flushing the Batcher and resetting current material if necessary
// check for Material changes
renderable
IRenderable
None
cam
Camera
None