public void Fill(float x, float y, float w, float h, Color cl) { _pgm.Use(); _win.Disable <DepthFeature>(); _uColor.Set((float)cl.R / byte.MaxValue, (float)cl.G / byte.MaxValue, (float)cl.B / byte.MaxValue, (float)cl.A / byte.MaxValue); _uTextureEnabled.Set(false); Transform(x, y, w, h); _indices.Draw(GeometricPrimitives.Triangles); _win.Enable <DepthFeature>(); }
private void RenderImDrawData(DrawData *data) { for (int n = 0; n < data->CmdListsCount; n++) { NativeDrawList *cmdList = data->CmdLists[n]; byte * vb = (byte *)cmdList->VtxBuffer.Data; ushort * ib = (ushort *)cmdList->IdxBuffer.Data; UpdateVB(cmdList->VtxBuffer.Size, vb); for (int cmd_i = 0; cmd_i < cmdList->CmdBuffer.Size; cmd_i++) { DrawCmd *pcmd = &(((DrawCmd *)cmdList->CmdBuffer.Data)[cmd_i]); if (pcmd->UserCallback != IntPtr.Zero) { throw new NotImplementedException(); } else { var texid = pcmd->TextureId.ToInt32(); UpdateIB((int)pcmd->ElemCount, ib); _indexBuffer.Draw(_vertexBuffer, 0, (int)pcmd->ElemCount); } ib += pcmd->ElemCount; } } }