Photon Editor Library 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
ImguiFontLibrary.h
Go to the documentation of this file.
1#pragma once
2
4
5#include <Common/assertion.h>
6
7namespace ph::editor
8{
9
15{
16public:
17 ImFont* defaultFont = nullptr;
18 ImFont* largeFont = nullptr;
19
20public:
21 template<typename UIFunc>
22 void useFont(ImFont* font, UIFunc func);
23};
24
25template<typename UIFunc>
26inline void ImguiFontLibrary::useFont(ImFont* const font, UIFunc func)
27{
28 PH_ASSERT(font);
29
30 ImGui::PushFont(font);
31 func();
32 ImGui::PopFont();
33}
34
35}// end namespace ph::editor
Definition ImguiFontLibrary.h:15
ImFont * largeFont
Definition ImguiFontLibrary.h:18
void useFont(ImFont *font, UIFunc func)
Definition ImguiFontLibrary.h:26
ImFont * defaultFont
Definition ImguiFontLibrary.h:17
Definition ph_editor.h:10