MCPcopy Create free account
hub / github.com/atraczyk/2d-engine / BitmapCharacter

Method BitmapCharacter

engine/src/text.cpp:86–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84}
85
86void Font::BitmapCharacter(float x, float y, float w, float h, int character)
87{
88 WorldRect dstRect(x, y, w, h);
89 ScreenRect* psrcRect;
90 psrcRect = &atlas->sourceRectangles[character];
91 glBegin(GL_QUADS);
92 {
93 glTexCoord2d(psrcRect->fLeft(), psrcRect->fTop()); glVertex2f(dstRect.iLeft(), dstRect.iBottom());
94 glTexCoord2d(psrcRect->fRight(), psrcRect->fTop()); glVertex2f(dstRect.iRight(), dstRect.iBottom());
95 glTexCoord2d(psrcRect->fRight(), psrcRect->fBottom()); glVertex2f(dstRect.iRight(), dstRect.iTop());
96 glTexCoord2d(psrcRect->fLeft(), psrcRect->fBottom()); glVertex2f(dstRect.iLeft(), dstRect.iTop());
97 }
98 glEnd();
99}
100
101void InitSpacings()
102{

Callers

nothing calls this directly

Calls 8

fLeftMethod · 0.80
fTopMethod · 0.80
iLeftMethod · 0.80
iBottomMethod · 0.80
fRightMethod · 0.80
iRightMethod · 0.80
fBottomMethod · 0.80
iTopMethod · 0.80

Tested by

no test coverage detected