Recast Navigation
Navigation-mesh Toolset for Games
imguiRenderGL.cpp File Reference
#include <cmath>
#include <cstdio>
#include "imgui.h"
#include "SDL.h"
#include "SDL_opengl.h"
#include "stb_truetype.h"

Macros

#define STBTT_malloc(x, y)   imguimalloc(x,y)
 
#define STBTT_free(x, y)   imguifree(x,y)
 
#define STB_TRUETYPE_IMPLEMENTATION
 

Functions

void imguifree (void *ptr, void *userptr)
 
void * imguimalloc (size_t size, void *userptr)
 
unsigned int RGBA (unsigned char r, unsigned char g, unsigned char b, unsigned char a)
 
static void drawPolygon (const float *coords, unsigned numCoords, float r, unsigned int col)
 
static void drawRect (float x, float y, float w, float h, float fth, unsigned int col)
 
static void drawRoundedRect (float x, float y, float w, float h, float r, float fth, unsigned int col)
 
static void drawLine (float x0, float y0, float x1, float y1, float r, float fth, unsigned int col)
 
bool imguiRenderGLInit (const char *fontpath)
 
void imguiRenderGLDestroy ()
 
static void getBakedQuad (stbtt_bakedchar *chardata, int pw, int ph, int char_index, float *xpos, float *ypos, stbtt_aligned_quad *q)
 
static float getTextLength (stbtt_bakedchar *chardata, const char *text)
 
static void drawText (float x, float y, const char *text, int align, unsigned int col)
 
void imguiRenderGLDraw ()
 

Variables

static const float PI = 3.14159265f
 
static const unsigned TEMP_COORD_COUNT = 100
 
static float g_tempCoords [TEMP_COORD_COUNT *2]
 
static float g_tempNormals [TEMP_COORD_COUNT *2]
 
static const int CIRCLE_VERTS = 8*4
 
static float g_circleVerts [CIRCLE_VERTS *2]
 
static stbtt_bakedchar g_cdata [96]
 
static GLuint g_ftex = 0
 
static const float g_tabStops [4] = {150, 210, 270, 330}
 

Macro Definition Documentation

◆ STB_TRUETYPE_IMPLEMENTATION

#define STB_TRUETYPE_IMPLEMENTATION

◆ STBTT_free

#define STBTT_free (   x,
 
)    imguifree(x,y)

◆ STBTT_malloc

#define STBTT_malloc (   x,
 
)    imguimalloc(x,y)

Function Documentation

◆ drawLine()

static void drawLine ( float  x0,
float  y0,
float  x1,
float  y1,
float  r,
float  fth,
unsigned int  col 
)
static

◆ drawPolygon()

static void drawPolygon ( const float *  coords,
unsigned  numCoords,
float  r,
unsigned int  col 
)
static

◆ drawRect()

static void drawRect ( float  x,
float  y,
float  w,
float  h,
float  fth,
unsigned int  col 
)
static

◆ drawRoundedRect()

static void drawRoundedRect ( float  x,
float  y,
float  w,
float  h,
float  r,
float  fth,
unsigned int  col 
)
static

◆ drawText()

static void drawText ( float  x,
float  y,
const char *  text,
int  align,
unsigned int  col 
)
static

◆ getBakedQuad()

static void getBakedQuad ( stbtt_bakedchar *  chardata,
int  pw,
int  ph,
int  char_index,
float *  xpos,
float *  ypos,
stbtt_aligned_quad *  q 
)
static

◆ getTextLength()

static float getTextLength ( stbtt_bakedchar *  chardata,
const char *  text 
)
static

◆ imguifree()

void imguifree ( void *  ptr,
void *  userptr 
)

◆ imguimalloc()

void * imguimalloc ( size_t  size,
void *  userptr 
)

◆ imguiRenderGLDestroy()

void imguiRenderGLDestroy ( )

◆ imguiRenderGLDraw()

void imguiRenderGLDraw ( )

◆ imguiRenderGLInit()

bool imguiRenderGLInit ( const char *  fontpath)

◆ RGBA()

unsigned int RGBA ( unsigned char  r,
unsigned char  g,
unsigned char  b,
unsigned char  a 
)
inline

Variable Documentation

◆ CIRCLE_VERTS

const int CIRCLE_VERTS = 8*4
static

◆ g_cdata

stbtt_bakedchar g_cdata[96]
static

◆ g_circleVerts

float g_circleVerts[CIRCLE_VERTS *2]
static

◆ g_ftex

GLuint g_ftex = 0
static

◆ g_tabStops

const float g_tabStops[4] = {150, 210, 270, 330}
static

◆ g_tempCoords

float g_tempCoords[TEMP_COORD_COUNT *2]
static

◆ g_tempNormals

float g_tempNormals[TEMP_COORD_COUNT *2]
static

◆ PI

const float PI = 3.14159265f
static

◆ TEMP_COORD_COUNT

const unsigned TEMP_COORD_COUNT = 100
static