Exemplo n.º 1
0
        public static void FontStash(FontStashAction A = null)
        {
            Nuklear.nk_font_atlas_init(FontAtlas, Allocator);
            Nuklear.nk_font_atlas_begin(FontAtlas);

            A?.Invoke(new IntPtr(FontAtlas));

            int    W, H;
            IntPtr Image     = Nuklear.nk_font_atlas_bake(FontAtlas, &W, &H, nk_font_atlas_format.NK_FONT_ATLAS_RGBA32);
            int    TexHandle = Dev.CreateTextureHandle(W, H, Image);

            Nuklear.nk_font_atlas_end(FontAtlas, Nuklear.nk_handle_id(TexHandle), NullTexture);

            if (FontAtlas->default_font != null)
            {
                Nuklear.nk_style_set_font(Ctx, &FontAtlas->default_font->handle);
            }
        }
Exemplo n.º 2
0
        private void FontStash(FontStashAction stashAction = null)
        {
            Nuklear.nk_font_atlas_init(_fontAtlas, _allocator);
            Nuklear.nk_font_atlas_begin(_fontAtlas);

            stashAction?.Invoke(new IntPtr(_fontAtlas));

            int W, H;
            var Image     = Nuklear.nk_font_atlas_bake(_fontAtlas, &W, &H, nk_font_atlas_format.NK_FONT_ATLAS_RGBA32);
            var TexHandle = Device.CreateTextureHandle(W, H, Image);

            Nuklear.nk_font_atlas_end(_fontAtlas, Nuklear.nk_handle_id(TexHandle), _nullTexture);

            if (_fontAtlas->default_font != null)
            {
                Nuklear.nk_style_set_font(_nuklearContext, &_fontAtlas->default_font->handle);
            }
        }