public override void Draw() { if (m_pVertexBuffer == null) { m_pVertexBuffer = new VertexBuffer(CCDrawManager.graphicsDevice, typeof(VertexPositionColor), 4, BufferUsage.WriteOnly); } if (m_bChanged) { m_pVertexBuffer.SetData(m_pVertices); m_bChanged = false; } CCDrawManager.BindTexture((CCTexture2D)null); CCDrawManager.BlendFunc(m_tBlendFunc); CCDrawManager.DrawQuadsBuffer(m_pVertexBuffer, 0, 1); }
/// <summary> /// draws n quads from an index (offset). /// n + start can't be greater than the capacity of the atlas /// @since v1.0 /// </summary> public void DrawNumberOfQuads(int n, int start) { if (n == 0) { return; } CCDrawManager.BindTexture(Texture); if (Dirty) { CCDrawManager.SetQuadsToBuffer(m_pVertexBuffer, m_pQuads, 0, m_pQuads.count); Dirty = false; } CCDrawManager.DrawQuadsBuffer(m_pVertexBuffer, start, n); }
/// <summary> /// draws n quads from an index (offset). /// n + start can't be greater than the capacity of the atlas /// @since v1.0 /// </summary> public void DrawNumberOfQuads(int n, int start) { if (n == 0) { return; } CCDrawManager.BindTexture(Texture); if (Dirty) { m_pVertexBuffer.UpdateBuffer(); Dirty = false; } CCDrawManager.DrawQuadsBuffer(m_pVertexBuffer, start, n); }
/// <summary> /// draws n quads from an index (offset). /// n + start can't be greater than the capacity of the atlas /// @since v1.0 /// </summary> public void DrawNumberOfQuads(int n, int start) { if (n == 0) { return; } CCDrawManager.BindTexture(Texture); //CCDrawManager.BlendFunc(new ccBlendFunc(ccMacros.CCDefaultSourceBlending, ccMacros.CCDefaultDestinationBlending)); if (Dirty) { CCDrawManager.SetQuadsToBuffer(m_pVertexBuffer, m_pQuads, 0, m_pQuads.count); Dirty = false; } CCDrawManager.DrawQuadsBuffer(m_pVertexBuffer, start, n); }