-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimgui_variant.h
More file actions
39 lines (33 loc) · 1.01 KB
/
Copy pathvimgui_variant.h
File metadata and controls
39 lines (33 loc) · 1.01 KB
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
31
32
33
34
35
36
37
38
39
#ifndef VIMGUI_VARIANT_H
#define VIMGUI_VARIANT_H
#include "cimgui.h"
static inline bool vimgui_configure_docking(bool enabled) {
ImGuiIO *io = igGetIO_Nil();
if (enabled) {
io->ConfigFlags |= ImGuiConfigFlags_DockingEnable;
} else {
io->ConfigFlags &= ~ImGuiConfigFlags_DockingEnable;
}
return true;
}
static inline bool vimgui_configure_platform_viewports(bool enabled) {
ImGuiIO *io = igGetIO_Nil();
if (enabled) {
io->ConfigFlags |= ImGuiConfigFlags_ViewportsEnable;
} else {
io->ConfigFlags &= ~ImGuiConfigFlags_ViewportsEnable;
}
return true;
}
static inline bool vimgui_create_main_dockspace(void) {
igDockSpaceOverViewport(0, NULL, ImGuiDockNodeFlags_None, NULL);
return true;
}
static inline void vimgui_render_platform_viewports(void) {
ImGuiIO *io = igGetIO_Nil();
if ((io->ConfigFlags & ImGuiConfigFlags_ViewportsEnable) != 0) {
igUpdatePlatformWindows();
igRenderPlatformWindowsDefault(NULL, NULL);
}
}
#endif