29 virtual vc::Error Initialize() = 0;
30 virtual vc::Error Reset() = 0;
32 inline void DrawCallback() {
if (s_guiDrawCallback) s_guiDrawCallback(); }
33 static inline void SetGUIDrawCallback(GUIDrawCallback guiDrawCallback) { s_guiDrawCallback = guiDrawCallback; }
35 inline void Render() { DrawCallback(); s_gui->_Render(); }
37 static inline GUI * Get() {
return s_gui; }
39 static inline void NewFrame() { s_gui->_NewFrame(); }
40 static inline void Begin(
const char * name,
bool * p_open =
nullptr, GUIWindowFlags flags = 0) { s_gui->_Begin(name, p_open, flags); }
41 static inline void End() { s_gui->_End(); }
42 static inline void Text(
const char* fmt, ...) { va_list args; va_start(args, fmt); s_gui->_Text(fmt, args); va_end(args); }
43 static inline void TextColored(
const vcm::Vec4 & col,
const char* fmt, ...) { va_list args; va_start(args, fmt); s_gui->_TextColored(col, fmt, args); va_end(args); }
44 static inline void LabelText(
const char* label,
const char* fmt, ...) { va_list args; va_start(args, fmt); s_gui->_LabelText(label, fmt, args); va_end(args); }
46 static inline bool SliderFloat(
const char* label,
float* v,
float v_min,
float v_max,
const char* format =
"%.3f",
float power = 1.0f) {
return s_gui->_SliderFloat(label, v, v_min, v_max, format, power); }
47 static inline bool SliderFloat3(
const char* label,
float v[3],
float v_min,
float v_max,
const char* format =
"%.3f",
float power = 1.0f) {
return s_gui->_SliderFloat3(label, v, v_min, v_max, format, power); }
49 static inline void ColorEdit3(
const char* label,
float col[3], GUIColorEditFlags flags = 0) { s_gui->_ColorEdit3(label, col, flags); }
51 static inline bool Button(
const char* label,
const vcm::Vec2 & size = vcm::Vec2(0, 0)) {
return s_gui->_Button(label, size); }
52 static inline bool Checkbox(
const char* label,
bool* v) {
return s_gui->_Checkbox(label, v); }
53 static inline void ProgressBar(
float fraction,
const vcm::Vec2 & size_arg = vcm::Vec2(-1, 0),
const char* overlay =
nullptr) { s_gui->_ProgressBar(fraction, size_arg, overlay); }
55 static inline bool Selectable(
const char* label,
bool selected, GUISelectableFlags flags = 0,
const vcm::Vec2 & size = vcm::Vec2(0, 0)) {
return s_gui->_Selectable(label, selected, flags, size); }
57 static inline bool BeginCombo(
const char* label,
const char* preview_value, GUIComboFlags flags = 0) {
return s_gui->_BeginCombo(label, preview_value, flags); }
58 static inline void EndCombo() { s_gui->_EndCombo(); }
60 static inline void SetItemDefaultFocus() { s_gui->_SetItemDefaultFocus(); }
62 static inline void SameLine(
float offset_from_start_x = 0.0f,
float spacing = -1.0f) { s_gui->_SameLine(offset_from_start_x, spacing); }
65 virtual void _NewFrame() = 0;
66 virtual void _Begin(
const char * name,
bool * p_open, GUIWindowFlags flags) = 0;
67 virtual void _End() = 0;
68 virtual void _Text(
const char* fmt, ...) = 0;
69 virtual void _TextColored(
const vcm::Vec4 & col,
const char* fmt, ...) = 0;
70 virtual void _LabelText(
const char* label,
const char* fmt, ...) = 0;
72 virtual bool _SliderFloat(
const char* label,
float* v,
float v_min,
float v_max,
const char* format,
float power) = 0;
73 virtual bool _SliderFloat3(
const char* label,
float v[3],
float v_min,
float v_max,
const char* format,
float power) = 0;
75 virtual void _ColorEdit3(
const char* label,
float col[3], GUIColorEditFlags flags) = 0;
77 virtual bool _Button(
const char* label,
const vcm::Vec2 & size) = 0;
78 virtual bool _Checkbox(
const char* label,
bool* v) = 0;
79 virtual void _ProgressBar(
float fraction,
const vcm::Vec2 & size_arg,
const char* overlay) = 0;
81 virtual bool _Selectable(
const char* label,
bool selected, GUISelectableFlags flags,
const vcm::Vec2 & size) = 0;
83 virtual bool _BeginCombo(
const char* label,
const char* preview_value, GUIComboFlags flags) = 0;
84 virtual void _EndCombo() = 0;
86 virtual void _SetItemDefaultFocus() = 0;
88 virtual void _SameLine(
float offset_from_start_x,
float spacing) = 0;
90 virtual void _Render() = 0;
99 static GUIDrawCallback s_guiDrawCallback;