| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
#ifndef IMGUI_H |
| 20 |
#define IMGUI_H |
| 21 |
|
| 22 |
enum imguiMouseButton |
| 23 |
{ |
| 24 |
IMGUI_MBUT_LEFT = 0x01, |
| 25 |
IMGUI_MBUT_RIGHT = 0x02 |
| 26 |
}; |
| 27 |
|
| 28 |
enum imguiTextAlign |
| 29 |
{ |
| 30 |
IMGUI_ALIGN_LEFT, |
| 31 |
IMGUI_ALIGN_CENTER, |
| 32 |
IMGUI_ALIGN_RIGHT |
| 33 |
}; |
| 34 |
|
| 35 |
inline unsigned int imguiRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a=255) |
| 36 |
{ |
| 37 |
return (r) | (g << 8) | (b << 16) | (a << 24); |
| 38 |
} |
| 39 |
|
| 40 |
void imguiBeginFrame(int mx, int my, unsigned char mbut, int scroll); |
| 41 |
void imguiEndFrame(); |
| 42 |
|
| 43 |
bool imguiBeginScrollArea(const char* name, int x, int y, int w, int h, int* scroll); |
| 44 |
void imguiEndScrollArea(); |
| 45 |
|
| 46 |
void imguiIndent(); |
| 47 |
void imguiUnindent(); |
| 48 |
void imguiSeparator(); |
| 49 |
void imguiSeparatorLine(); |
| 50 |
|
| 51 |
bool imguiButton(const char* text, bool enabled = true); |
| 52 |
bool imguiItem(const char* text, bool enabled = true); |
| 53 |
bool imguiCheck(const char* text, bool checked, bool enabled = true); |
| 54 |
bool imguiCollapse(const char* text, const char* subtext, bool checked, bool enabled = true); |
| 55 |
void imguiLabel(const char* text); |
| 56 |
void imguiValue(const char* text); |
| 57 |
bool imguiSlider(const char* text, float* val, float vmin, float vmax, float vinc, bool enabled = true); |
| 58 |
|
| 59 |
void imguiDrawText(int x, int y, int align, const char* text, unsigned int color); |
| 60 |
void imguiDrawLine(float x0, float y0, float x1, float y1, float r, unsigned int color); |
| 61 |
void imguiDrawRoundedRect(float x, float y, float w, float h, float r, unsigned int color); |
| 62 |
void imguiDrawRect(float x, float y, float w, float h, unsigned int color); |
| 63 |
|
| 64 |
|
| 65 |
enum imguiGfxCmdType |
| 66 |
{ |
| 67 |
IMGUI_GFXCMD_RECT, |
| 68 |
IMGUI_GFXCMD_TRIANGLE, |
| 69 |
IMGUI_GFXCMD_LINE, |
| 70 |
IMGUI_GFXCMD_TEXT, |
| 71 |
IMGUI_GFXCMD_SCISSOR |
| 72 |
}; |
| 73 |
|
| 74 |
struct imguiGfxRect |
| 75 |
{ |
| 76 |
short x,y,w,h,r; |
| 77 |
}; |
| 78 |
|
| 79 |
struct imguiGfxText |
| 80 |
{ |
| 81 |
short x,y,align; |
| 82 |
const char* text; |
| 83 |
}; |
| 84 |
|
| 85 |
struct imguiGfxLine |
| 86 |
{ |
| 87 |
short x0,y0,x1,y1,r; |
| 88 |
}; |
| 89 |
|
| 90 |
struct imguiGfxCmd |
| 91 |
{ |
| 92 |
char type; |
| 93 |
char flags; |
| 94 |
char pad[2]; |
| 95 |
unsigned int col; |
| 96 |
union |
| 97 |
{ |
| 98 |
imguiGfxLine line; |
| 99 |
imguiGfxRect rect; |
| 100 |
imguiGfxText text; |
| 101 |
}; |
| 102 |
}; |
| 103 |
|
| 104 |
const imguiGfxCmd* imguiGetRenderQueue(); |
| 105 |
int imguiGetRenderQueueSize(); |
| 106 |
|
| 107 |
|
| 108 |
#endif |