Recast Navigation
Navigation-mesh Toolset for Games
imgui.h
Go to the documentation of this file.
1 //
2 // Copyright (c) 2009-2010 Mikko Mononen memon@inside.org
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 
23 {
24  IMGUI_MBUT_LEFT = 0x01,
25  IMGUI_MBUT_RIGHT = 0x02
26 };
27 
29 {
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.
66 {
72 };
73 
75 {
76  short x,y,w,h,r;
77 };
78 
80 {
81  short x,y,align;
82  const char* text;
83 };
84 
86 {
87  short x0,y0,x1,y1,r;
88 };
89 
91 {
92  char type;
93  char flags;
94  char pad[2];
95  unsigned int col;
96  union
97  {
101  };
102 };
103 
106 
107 
108 #endif // IMGUI_H
imguiMouseButton
Definition: imgui.h:23
@ IMGUI_MBUT_RIGHT
Definition: imgui.h:25
@ IMGUI_MBUT_LEFT
Definition: imgui.h:24
unsigned int imguiRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a=255)
Definition: imgui.h:35
void imguiUnindent()
Definition: imgui.cpp:634
void imguiDrawRoundedRect(float x, float y, float w, float h, float r, unsigned int color)
Definition: imgui.cpp:671
bool imguiItem(const char *text, bool enabled=true)
Definition: imgui.cpp:449
void imguiLabel(const char *text)
Definition: imgui.cpp:540
imguiTextAlign
Definition: imgui.h:29
@ IMGUI_ALIGN_RIGHT
Definition: imgui.h:32
@ IMGUI_ALIGN_CENTER
Definition: imgui.h:31
@ IMGUI_ALIGN_LEFT
Definition: imgui.h:30
bool imguiCollapse(const char *text, const char *subtext, bool checked, bool enabled=true)
Definition: imgui.cpp:507
void imguiBeginFrame(int mx, int my, unsigned char mbut, int scroll)
Definition: imgui.cpp:265
bool imguiCheck(const char *text, bool checked, bool enabled=true)
Definition: imgui.cpp:474
void imguiDrawRect(float x, float y, float w, float h, unsigned int color)
Definition: imgui.cpp:666
void imguiDrawLine(float x0, float y0, float x1, float y1, float r, unsigned int color)
Definition: imgui.cpp:661
bool imguiButton(const char *text, bool enabled=true)
Definition: imgui.cpp:426
int imguiGetRenderQueueSize()
Definition: imgui.cpp:296
void imguiDrawText(int x, int y, int align, const char *text, unsigned int color)
Definition: imgui.cpp:656
imguiGfxCmdType
Definition: imgui.h:66
@ IMGUI_GFXCMD_TRIANGLE
Definition: imgui.h:68
@ IMGUI_GFXCMD_LINE
Definition: imgui.h:69
@ IMGUI_GFXCMD_RECT
Definition: imgui.h:67
@ IMGUI_GFXCMD_TEXT
Definition: imgui.h:70
@ IMGUI_GFXCMD_SCISSOR
Definition: imgui.h:71
void imguiEndScrollArea()
Definition: imgui.cpp:354
bool imguiBeginScrollArea(const char *name, int x, int y, int w, int h, int *scroll)
Definition: imgui.cpp:323
bool imguiSlider(const char *text, float *val, float vmin, float vmax, float vinc, bool enabled=true)
Definition: imgui.cpp:558
void imguiValue(const char *text)
Definition: imgui.cpp:548
void imguiSeparatorLine()
Definition: imgui.cpp:645
const imguiGfxCmd * imguiGetRenderQueue()
Definition: imgui.cpp:291
void imguiSeparator()
Definition: imgui.cpp:640
void imguiIndent()
Definition: imgui.cpp:628
void imguiEndFrame()
Definition: imgui.cpp:286
Definition: imgui.h:91
char type
Definition: imgui.h:92
unsigned int col
Definition: imgui.h:95
imguiGfxLine line
Definition: imgui.h:98
imguiGfxRect rect
Definition: imgui.h:99
char flags
Definition: imgui.h:93
imguiGfxText text
Definition: imgui.h:100
char pad[2]
Definition: imgui.h:94
Definition: imgui.h:86
short y0
Definition: imgui.h:87
short r
Definition: imgui.h:87
short x0
Definition: imgui.h:87
short y1
Definition: imgui.h:87
short x1
Definition: imgui.h:87
Definition: imgui.h:75
short h
Definition: imgui.h:76
short y
Definition: imgui.h:76
short x
Definition: imgui.h:76
short r
Definition: imgui.h:76
short w
Definition: imgui.h:76
Definition: imgui.h:80
const char * text
Definition: imgui.h:82
short y
Definition: imgui.h:81
short x
Definition: imgui.h:81
short align
Definition: imgui.h:81