6#ifndef VCL_BGFX_IMGUI_IMGUI_IMPL_BGFX_H
7#define VCL_BGFX_IMGUI_IMGUI_IMPL_BGFX_H
11#include <iconfontheaders/icons_kenney.h>
12#include <iconfontheaders/icons_font_awesome.h>
14#define IMGUI_MBUT_LEFT 0x01
15#define IMGUI_MBUT_RIGHT 0x02
16#define IMGUI_MBUT_MIDDLE 0x04
29namespace bx {
struct AllocatorI; }
31IMGUI_IMPL_API
void ImGui_ImplBgfx_Init();
33IMGUI_IMPL_API
void ImGui_ImplBgfx_Shutdown();
36IMGUI_IMPL_API
void ImGui_ImplBgfx_NewFrame(bgfx::ViewId viewId = 255);
38IMGUI_IMPL_API
void ImGui_ImplBgfx_RenderDrawData(ImDrawData* draw_data);
50#define IMGUI_FLAGS_NONE UINT8_C(0x00)
51#define IMGUI_FLAGS_ALPHA_BLEND UINT8_C(0x01)
54 inline ImTextureID toId(bgfx::TextureHandle _handle, uint8_t _flags, uint8_t _mip)
56 union {
struct { bgfx::TextureHandle handle; uint8_t flags; uint8_t mip; } s; ImTextureID id; } tex;
57 tex.s.handle = _handle;
64 inline void Image(bgfx::TextureHandle _handle
68 ,
const ImVec2& _uv0 = ImVec2(0.0f, 0.0f)
69 ,
const ImVec2& _uv1 = ImVec2(1.0f, 1.0f)
70 ,
const ImVec4& _tintCol = ImVec4(1.0f, 1.0f, 1.0f, 1.0f)
71 ,
const ImVec4& _borderCol = ImVec4(0.0f, 0.0f, 0.0f, 0.0f)
74 Image(toId(_handle, _flags, _mip), _size, _uv0, _uv1, _tintCol, _borderCol);
78 inline void Image(bgfx::TextureHandle _handle
80 ,
const ImVec2& _uv0 = ImVec2(0.0f, 0.0f)
81 ,
const ImVec2& _uv1 = ImVec2(1.0f, 1.0f)
82 ,
const ImVec4& _tintCol = ImVec4(1.0f, 1.0f, 1.0f, 1.0f)
83 ,
const ImVec4& _borderCol = ImVec4(0.0f, 0.0f, 0.0f, 0.0f)
86 Image(_handle, IMGUI_FLAGS_ALPHA_BLEND, 0, _size, _uv0, _uv1, _tintCol, _borderCol);
90 inline bool ImageButton(bgfx::TextureHandle _handle
94 ,
const ImVec2& _uv0 = ImVec2(0.0f, 0.0f)
95 ,
const ImVec2& _uv1 = ImVec2(1.0f, 1.0f)
96 ,
const ImVec4& _bgCol = ImVec4(0.0f, 0.0f, 0.0f, 0.0f)
97 ,
const ImVec4& _tintCol = ImVec4(1.0f, 1.0f, 1.0f, 1.0f)
100 return ImageButton(
"image", toId(_handle, _flags, _mip), _size, _uv0, _uv1, _bgCol, _tintCol);
104 inline bool ImageButton(bgfx::TextureHandle _handle
105 ,
const ImVec2& _size
106 ,
const ImVec2& _uv0 = ImVec2(0.0f, 0.0f)
107 ,
const ImVec2& _uv1 = ImVec2(1.0f, 1.0f)
108 ,
const ImVec4& _bgCol = ImVec4(0.0f, 0.0f, 0.0f, 0.0f)
109 ,
const ImVec4& _tintCol = ImVec4(1.0f, 1.0f, 1.0f, 1.0f)
112 return ImageButton(_handle, IMGUI_FLAGS_ALPHA_BLEND, 0, _size, _uv0, _uv1, _bgCol, _tintCol);
116 inline void NextLine()
118 SetCursorPosY(GetCursorPosY() + GetTextLineHeightWithSpacing() );
122 inline bool MouseOverArea()
125 || ImGui::IsAnyItemActive()
126 || ImGui::IsAnyItemHovered()
127 || ImGui::IsWindowHovered(ImGuiHoveredFlags_AnyWindow)