Example #1
0
        private void DrawPending()
        {
            if (PendingIndices.Count == 0)
            {
                return;
            }

            UiShader.Use();
            UiShader.SetMatrix4("u_Projection", Matrix4.CreateOrthographic(Window.Size.X, Window.Size.Y, 0.0001f, 1000.0f));

            var samplerData = PrepareSamplerIndices();

            UiShader.SetInt("u_Textures[0]", samplerData);

            Vao.Bind();
            Vao.UpdateIndices(PendingIndices.ToArray());
            Vao.UpdateVertices(PendingVertices.ToArray());

            Vao.Draw(UiShader, BeginMode.Triangles);
            RenderingApi.ReportDrawCall();

            ClearPendingBuffers();
        }
Example #2
0
 public void Dispose()
 {
     UiShader.Dispose();
     Vao.Dispose();
 }