forked from inkyblackness/imgui-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFontAtlasWrapper.cpp
30 lines (26 loc) · 1.03 KB
/
FontAtlasWrapper.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "imguiWrappedHeader.h"
#include "FontAtlasWrapper.h"
#include "WrapperConverter.h"
IggFont iggAddFontDefault(IggFontAtlas handle)
{
ImFontAtlas *fontAtlas = reinterpret_cast<ImFontAtlas *>(handle);
ImFont *font = fontAtlas->AddFontDefault();
return static_cast<IggFont>(font);
}
IggFont iggAddFontFromFileTTF(IggFontAtlas handle, char const *filename, float sizePixels)
{
ImFontAtlas *fontAtlas = reinterpret_cast<ImFontAtlas *>(handle);
ImFont *font = fontAtlas->AddFontFromFileTTF(filename, sizePixels);
return static_cast<IggFont>(font);
}
void iggFontAtlasGetTexDataAsAlpha8(IggFontAtlas handle, unsigned char **pixels,
int *width, int *height, int *bytesPerPixel)
{
ImFontAtlas *fontAtlas = reinterpret_cast<ImFontAtlas *>(handle);
fontAtlas->GetTexDataAsAlpha8(pixels, width, height, bytesPerPixel);
}
void iggFontAtlasSetTextureID(IggFontAtlas handle, IggTextureID id)
{
ImFontAtlas *fontAtlas = reinterpret_cast<ImFontAtlas *>(handle);
fontAtlas->SetTexID(id);
}