Recast Navigation
Navigation-mesh Toolset for Games
imgui.cpp File Reference
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "imgui.h"

Classes

struct  GuiState
 

Functions

static const char * allocText (const char *text)
 
static void resetGfxCmdQueue ()
 
static void addGfxCmdScissor (int x, int y, int w, int h)
 
static void addGfxCmdRect (float x, float y, float w, float h, unsigned int color)
 
static void addGfxCmdLine (float x0, float y0, float x1, float y1, float r, unsigned int color)
 
static void addGfxCmdRoundedRect (float x, float y, float w, float h, float r, unsigned int color)
 
static void addGfxCmdTriangle (int x, int y, int w, int h, int flags, unsigned int color)
 
static void addGfxCmdText (int x, int y, int align, const char *text, unsigned int color)
 
bool anyActive ()
 
bool isActive (unsigned int id)
 
bool isHot (unsigned int id)
 
bool inRect (int x, int y, int w, int h, bool checkScroll=true)
 
void clearInput ()
 
void clearActive ()
 
void setActive (unsigned int id)
 
void setHot (unsigned int id)
 
static bool buttonLogic (unsigned int id, bool over)
 
static void updateInput (int mx, int my, unsigned char mbut, int scroll)
 
void imguiBeginFrame (int mx, int my, unsigned char mbut, int scroll)
 
void imguiEndFrame ()
 
const imguiGfxCmdimguiGetRenderQueue ()
 
int imguiGetRenderQueueSize ()
 
bool imguiBeginScrollArea (const char *name, int x, int y, int w, int h, int *scroll)
 
void imguiEndScrollArea ()
 
bool imguiButton (const char *text, bool enabled)
 
bool imguiItem (const char *text, bool enabled)
 
bool imguiCheck (const char *text, bool checked, bool enabled)
 
bool imguiCollapse (const char *text, const char *subtext, bool checked, bool enabled)
 
void imguiLabel (const char *text)
 
void imguiValue (const char *text)
 
bool imguiSlider (const char *text, float *val, float vmin, float vmax, float vinc, bool enabled)
 
void imguiIndent ()
 
void imguiUnindent ()
 
void imguiSeparator ()
 
void imguiSeparatorLine ()
 
void imguiDrawText (int x, int y, int align, const char *text, unsigned int color)
 
void imguiDrawLine (float x0, float y0, float x1, float y1, float r, unsigned int color)
 
void imguiDrawRect (float x, float y, float w, float h, unsigned int color)
 
void imguiDrawRoundedRect (float x, float y, float w, float h, float r, unsigned int color)
 

Variables

static const unsigned TEXT_POOL_SIZE = 50000
 
static char g_textPool [TEXT_POOL_SIZE]
 
static unsigned g_textPoolSize = 0
 
static const unsigned GFXCMD_QUEUE_SIZE = 5000
 
static imguiGfxCmd g_gfxCmdQueue [GFXCMD_QUEUE_SIZE]
 
static unsigned g_gfxCmdQueueSize = 0
 
static GuiState g_state
 
static const int BUTTON_HEIGHT = 20
 
static const int SLIDER_HEIGHT = 20
 
static const int SLIDER_MARKER_WIDTH = 10
 
static const int CHECK_SIZE = 8
 
static const int DEFAULT_SPACING = 4
 
static const int TEXT_HEIGHT = 8
 
static const int SCROLL_AREA_PADDING = 6
 
static const int INDENT_SIZE = 16
 
static const int AREA_HEADER = 28
 
static int g_scrollTop = 0
 
static int g_scrollBottom = 0
 
static int g_scrollRight = 0
 
static int g_scrollAreaTop = 0
 
static int * g_scrollVal = 0
 
static int g_focusTop = 0
 
static int g_focusBottom = 0
 
static unsigned int g_scrollId = 0
 
static bool g_insideScrollArea = false
 

Function Documentation

◆ addGfxCmdLine()

static void addGfxCmdLine ( float  x0,
float  y0,
float  x1,
float  y1,
float  r,
unsigned int  color 
)
static

◆ addGfxCmdRect()

static void addGfxCmdRect ( float  x,
float  y,
float  w,
float  h,
unsigned int  color 
)
static

◆ addGfxCmdRoundedRect()

static void addGfxCmdRoundedRect ( float  x,
float  y,
float  w,
float  h,
float  r,
unsigned int  color 
)
static

◆ addGfxCmdScissor()

static void addGfxCmdScissor ( int  x,
int  y,
int  w,
int  h 
)
static

◆ addGfxCmdText()

static void addGfxCmdText ( int  x,
int  y,
int  align,
const char *  text,
unsigned int  color 
)
static

◆ addGfxCmdTriangle()

static void addGfxCmdTriangle ( int  x,
int  y,
int  w,
int  h,
int  flags,
unsigned int  color 
)
static

◆ allocText()

static const char* allocText ( const char *  text)
static

◆ anyActive()

bool anyActive ( )
inline

◆ buttonLogic()

static bool buttonLogic ( unsigned int  id,
bool  over 
)
static

◆ clearActive()

void clearActive ( )
inline

◆ clearInput()

void clearInput ( )
inline

◆ imguiBeginFrame()

void imguiBeginFrame ( int  mx,
int  my,
unsigned char  mbut,
int  scroll 
)

◆ imguiBeginScrollArea()

bool imguiBeginScrollArea ( const char *  name,
int  x,
int  y,
int  w,
int  h,
int *  scroll 
)

◆ imguiButton()

bool imguiButton ( const char *  text,
bool  enabled 
)

◆ imguiCheck()

bool imguiCheck ( const char *  text,
bool  checked,
bool  enabled 
)

◆ imguiCollapse()

bool imguiCollapse ( const char *  text,
const char *  subtext,
bool  checked,
bool  enabled 
)

◆ imguiDrawLine()

void imguiDrawLine ( float  x0,
float  y0,
float  x1,
float  y1,
float  r,
unsigned int  color 
)

◆ imguiDrawRect()

void imguiDrawRect ( float  x,
float  y,
float  w,
float  h,
unsigned int  color 
)

◆ imguiDrawRoundedRect()

void imguiDrawRoundedRect ( float  x,
float  y,
float  w,
float  h,
float  r,
unsigned int  color 
)

◆ imguiDrawText()

void imguiDrawText ( int  x,
int  y,
int  align,
const char *  text,
unsigned int  color 
)

◆ imguiEndFrame()

void imguiEndFrame ( )

◆ imguiEndScrollArea()

void imguiEndScrollArea ( )

◆ imguiGetRenderQueue()

const imguiGfxCmd* imguiGetRenderQueue ( )

◆ imguiGetRenderQueueSize()

int imguiGetRenderQueueSize ( )

◆ imguiIndent()

void imguiIndent ( )

◆ imguiItem()

bool imguiItem ( const char *  text,
bool  enabled 
)

◆ imguiLabel()

void imguiLabel ( const char *  text)

◆ imguiSeparator()

void imguiSeparator ( )

◆ imguiSeparatorLine()

void imguiSeparatorLine ( )

◆ imguiSlider()

bool imguiSlider ( const char *  text,
float *  val,
float  vmin,
float  vmax,
float  vinc,
bool  enabled 
)

◆ imguiUnindent()

void imguiUnindent ( )

◆ imguiValue()

void imguiValue ( const char *  text)

◆ inRect()

bool inRect ( int  x,
int  y,
int  w,
int  h,
bool  checkScroll = true 
)
inline

◆ isActive()

bool isActive ( unsigned int  id)
inline

◆ isHot()

bool isHot ( unsigned int  id)
inline

◆ resetGfxCmdQueue()

static void resetGfxCmdQueue ( )
static

◆ setActive()

void setActive ( unsigned int  id)
inline

◆ setHot()

void setHot ( unsigned int  id)
inline

◆ updateInput()

static void updateInput ( int  mx,
int  my,
unsigned char  mbut,
int  scroll 
)
static

Variable Documentation

◆ AREA_HEADER

const int AREA_HEADER = 28
static

◆ BUTTON_HEIGHT

const int BUTTON_HEIGHT = 20
static

◆ CHECK_SIZE

const int CHECK_SIZE = 8
static

◆ DEFAULT_SPACING

const int DEFAULT_SPACING = 4
static

◆ g_focusBottom

int g_focusBottom = 0
static

◆ g_focusTop

int g_focusTop = 0
static

◆ g_gfxCmdQueue

imguiGfxCmd g_gfxCmdQueue[GFXCMD_QUEUE_SIZE]
static

◆ g_gfxCmdQueueSize

unsigned g_gfxCmdQueueSize = 0
static

◆ g_insideScrollArea

bool g_insideScrollArea = false
static

◆ g_scrollAreaTop

int g_scrollAreaTop = 0
static

◆ g_scrollBottom

int g_scrollBottom = 0
static

◆ g_scrollId

unsigned int g_scrollId = 0
static

◆ g_scrollRight

int g_scrollRight = 0
static

◆ g_scrollTop

int g_scrollTop = 0
static

◆ g_scrollVal

int* g_scrollVal = 0
static

◆ g_state

GuiState g_state
static

◆ g_textPool

char g_textPool[TEXT_POOL_SIZE]
static

◆ g_textPoolSize

unsigned g_textPoolSize = 0
static

◆ GFXCMD_QUEUE_SIZE

const unsigned GFXCMD_QUEUE_SIZE = 5000
static

◆ INDENT_SIZE

const int INDENT_SIZE = 16
static

◆ SCROLL_AREA_PADDING

const int SCROLL_AREA_PADDING = 6
static

◆ SLIDER_HEIGHT

const int SLIDER_HEIGHT = 20
static

◆ SLIDER_MARKER_WIDTH

const int SLIDER_MARKER_WIDTH = 10
static

◆ TEXT_HEIGHT

const int TEXT_HEIGHT = 8
static

◆ TEXT_POOL_SIZE

const unsigned TEXT_POOL_SIZE = 50000
static