public override void Visit() { CCDrawManager drawManager = Window.DrawManager; if (drawManager.CurrentRenderTarget == null) { drawManager.Viewport = Viewport.XnaViewport; } base.Visit(); }
protected override void Draw() { base.Draw(); CCDrawManager drawManager = CCDrawManager.SharedDrawManager; if (this.Visible) { InnerScene.Visit(); } }
internal override void Execute(CCDrawManager drawManager) { // drawManager.PushMatrix(); // //var xnaMatrix = ModelViewTransform.XnaMatrix; // //drawManager.MultMatrix(ref xnaMatrix); // drawManager.BlendFunc(BlendType); // drawManager.BindTexture(Texture); // // drawManager.DrawQuad(ref Quads[0]); // // drawManager.PopMatrix(); }
void OnBegin() { CCDrawManager drawManager = CCDrawManager.SharedDrawManager; drawManager.SetRenderTarget(Texture); if (shouldClear) { drawManager.Clear(clearColor); shouldClear = false; } }
internal CCRenderer(CCDrawManager drawManagerIn) { currentBatchedQuads = new CCRawList <CCV3F_C4B_T2F_Quad>(256, true); quadCommands = new CCRawList <CCQuadCommand>(256, true); renderQueue = new CCRawList <CCRenderCommand>(); drawManager = drawManagerIn; viewportGroupStack = new Viewport[MaxStackDepth]; layerGroupViewMatrixStack = new Matrix[MaxStackDepth]; layerGroupProjMatrixStack = new Matrix[MaxStackDepth]; viewportGroupIdStack = new byte[MaxStackDepth]; layerGroupIdStack = new byte[MaxStackDepth]; groupIdStack = new byte[MaxStackDepth]; }
internal override void Execute(CCDrawManager drawManager) { // Set Texture drawManager.BindTexture(Texture); // Set blend mode drawManager.BlendFunc(BlendType); // Draw the Primitives Primitive.Draw(drawManager); drawManager.DrawCount++; // Drawn batches //drawManager.DrawVerticesCount = Primitive.Count; // Drawn Vertices in this batch }
internal CCPrimitiveBatch(CCDrawManager drawManager, int bufferSize = DefaultBufferSize) { DrawManager = drawManager; if (drawManager.XnaGraphicsDevice == null) { throw new ArgumentNullException("graphicsDevice"); } triangleVertices = new CCV3F_C4B[bufferSize - bufferSize % 3]; lineVertices = new CCV3F_C4B[bufferSize - bufferSize % 2]; triangleVerts = new CCRawList <CCV3F_C4B[]>(100, true); lineVerts = new CCRawList <CCV3F_C4B[]>(100, true); }
public override void Blit() { if (dirty) { vertexBuffer.UpdateBuffer(); } base.Blit(); CCDrawManager drawManager = Scene.Window.DrawManager; bool save = drawManager.VertexColorEnabled; drawManager.VertexColorEnabled = false; drawManager.DrawBuffer(vertexBuffer, indexBuffer, 0, Indices.Length / 3); drawManager.VertexColorEnabled = save; }
internal CCPrimitiveBatch(CCDrawManager drawManager, int bufferSize = DefaultBufferSize) { DrawManager = drawManager; if (drawManager.XnaGraphicsDevice == null) { throw new ArgumentNullException("graphicsDevice"); } device = drawManager.XnaGraphicsDevice; triangleVertices = new VertexPositionColor[bufferSize - bufferSize % 3]; lineVertices = new VertexPositionColor[bufferSize - bufferSize % 2]; // set up a new basic effect, and enable vertex colors. basicEffect = new BasicEffect(drawManager.XnaGraphicsDevice); basicEffect.VertexColorEnabled = true; }
internal void RenderCustomCommand(CCDrawManager drawManager) { bool originalDepthTestState = drawManager.DepthTest; drawManager.DepthTest = UsingDepthTest; drawManager.PushMatrix(); drawManager.SetIdentityMatrix(); if (WorldTransform != CCAffineTransform.Identity) { var worldTrans = WorldTransform.XnaMatrix; drawManager.MultMatrix(ref worldTrans); } Action(); drawManager.PopMatrix(); drawManager.DepthTest = originalDepthTestState; }
public void Draw(CCDrawManager drawManager) { // early out if (VertexBuffer == null || VertexBuffer.Count == 0) { return; } if (IndexBuffer != null) { VertexBuffer.UpdateBuffer(); IndexBuffer.UpdateBuffer(); drawManager.DrawBuffer(VertexBuffer, IndexBuffer, 0, IndexBuffer.Count / 3); } else { drawManager.DrawPrimitives(PrimitiveType, VertexBuffer.Data.Elements, 0, VertexBuffer.Count); } }
internal CCGeometryBatch(CCDrawManager drawManager, int bufferSize = DefaultBufferSize) { DrawManager = drawManager; if (drawManager.XnaGraphicsDevice == null) { throw new ArgumentNullException("graphicsDevice"); } device = drawManager.XnaGraphicsDevice; batchItemList = new List <CCGeometryInstance>(bufferSize); freeBatchItemQueue = new Queue <CCGeometryInstance>(bufferSize); EnsureCapacity(bufferSize, bufferSize * 2); // set up a new basic effect, and enable vertex colors. basicEffect = new BasicEffect(drawManager.XnaGraphicsDevice); basicEffect.VertexColorEnabled = true; basicEffect.TextureEnabled = true; AutoClearInstances = true; }
public virtual void Begin() { CCDrawManager drawManager = CCDrawManager.SharedDrawManager; // Save the current matrix drawManager.PushMatrix(); // Matrix projection = Matrix.CreateOrthographicOffCenter( // -1.0f / widthRatio, 1.0f / widthRatio, // -1.0f / heightRatio, 1.0f / heightRatio, // -1, 1 // ); // // drawManager.MultMatrix(ref projection); drawManager.SetRenderTarget(Texture); if (firstUsage) { drawManager.Clear(CCColor4B.Transparent); firstUsage = false; } }
internal void UseMaterial(CCDrawManager drawManager) { drawManager.BlendFunc(BlendType); drawManager.BindTexture(Texture); }
internal CCGrabber(CCDrawManager drawManager) { this.drawManager = drawManager; }
public virtual void Blit() { CCDrawManager drawManager = Scene.Window.DrawManager; drawManager.BindTexture(Texture); }