MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/FleX / getBakedQuad

Function getBakedQuad

demo/d3d11/imguiGraph.cpp:289–307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

287}
288
289static void getBakedQuad(stbtt_bakedchar *chardata, int pw, int ph, int char_index,
290 float *xpos, float *ypos, stbtt_aligned_quad *q)
291{
292 stbtt_bakedchar *b = chardata + char_index;
293 int round_x = STBTT_ifloor(*xpos + b->xoff);
294 int round_y = STBTT_ifloor(*ypos - b->yoff);
295
296 q->x0 = (float)round_x;
297 q->y0 = (float)round_y;
298 q->x1 = (float)round_x + b->x1 - b->x0;
299 q->y1 = (float)round_y - b->y1 + b->y0;
300
301 q->s0 = b->x0 / (float)pw;
302 q->t0 = b->y0 / (float)pw;
303 q->s1 = b->x1 / (float)ph;
304 q->t1 = b->y1 / (float)ph;
305
306 *xpos += b->xadvance;
307}
308
309static const float g_tabStops[4] = { 150, 210, 270, 330 };
310

Callers 1

drawTextFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected