public FontManager(Nvg nvg) { _nvg = nvg; for (uint i = 0; i < MAX_FONTIMAGES; i++) { _fontImages[i] = 0; } FonsParams fontParams = new() { width = (int)INIT_FONTIMAGE_SIZE, height = (int)INIT_FONTIMAGE_SIZE, flags = (byte)FonsFlags.ZeroTopleft, renderCreate = null, renderUpdate = null, renderDraw = null, renderDelete = null }; Fontstash = new Fontstash(fontParams); _fontImages[0] = _nvg.renderer.CreateTexture(Texture.Alpha, new Vector2D <uint>((uint)fontParams.width, (uint)fontParams.height), 0, null); if (_fontImages[0] == 0) { _nvg.Dispose(); throw new Exception("Failed to create dummy font atlas!"); } _fontImageIdx = 0; }
private static void Close() { timer.Stop(); demo.Dispose(); nvg.Dispose(); Console.WriteLine("Average Frame Time: " + frameGraph.GraphAverage * 1000.0f + " ms"); Console.WriteLine(" CPU Time: " + cpuGraph.GraphAverage * 1000.0f + " ms"); gl.Dispose(); }
private static void Close() { nvg.Dispose(); gl.Dispose(); }