/// <summary> /// Используется для отрисовки вертексного буфера внешнего класса, например TerrainSpriteLayer /// </summary> /// <param name="buffer">.</param> /// <param name="start">.</param> /// <param name="length">.</param> /// <param name="type">.</param> /// <param name="sheet">.</param> /// <param name="blendMode">.</param> public void DrawVertexBuffer(VertexBuffer <Vertex> buffer, int start, int length, PrimitiveType type, Sheet sheet, BlendMode blendMode) { shader.SetTexture("Texture0", sheet.AssignOrGetOrSetDataGLTexture()); renderer.Context.SetBlendMode(blendMode); shader.PrepareRender(); buffer.ActivateVAO(); renderer.DrawBatcForOpenGLVertexBuffer(buffer, start, length, type); buffer.CloseVAO(); renderer.Context.SetBlendMode(BlendMode.None); }
public void DrawVertexBuffer(VertexBuffer <Vertex> buffer, int start, int length, PrimitiveType type, Sheet2D[] sheets, BlendMode blendMode) { if (rendererID == "WorldSpriteRenderer") { } for (var i = 0; i < sheets.Length; i++) { if (sheets[i] == null) { continue; } shader.SetTexture("Texture2D{0}".F(i), sheets[i].AssignOrGetOrSetDataGLTexture()); } renderer.Context.SetBlendMode(blendMode); shader.PrepareRender(); buffer.ActivateVAO(); renderer.DrawBatcForOpenGLVertexBuffer(buffer, start, length, type); buffer.CloseVAO(); renderer.Context.SetBlendMode(BlendMode.None); }
public void RendererOpenVAO() { RendererVertexBuffer.ActivateVAO(); }