Debian Codegraph @

RecastDemo/Include/imgui.h

raw symbols SCIP
1 //
2 // Copyright (c) 2009-2010 Mikko Mononen [email protected]
3 //
4 // This software is provided 'as-is', without any express or implied
5 // warranty. In no event will the authors be held liable for any damages
6 // arising from the use of this software.
7 // Permission is granted to anyone to use this software for any purpose,
8 // including commercial applications, and to alter it and redistribute it
9 // freely, subject to the following restrictions:
10 // 1. The origin of this software must not be misrepresented; you must not
11 // claim that you wrote the original software. If you use this software
12 // in a product, an acknowledgment in the product documentation would be
13 // appreciated but is not required.
14 // 2. Altered source versions must be plainly marked as such, and must not be
15 // misrepresented as being the original software.
16 // 3. This notice may not be removed or altered from any source distribution.
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 // Pull render interface.
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 // IMGUI_H