initial release of new RasterFont without color support

this new design will once create a texture for all chars.
while rendering a string, a list of polygons (position on screen + texture)
for this string is generated on the fly and print at once by glDrawArrays.
atm, there is no support for colors, so everything will display white.

Signed-off-by: Ryan Houdek <Sonicadvance1@gmail.com>
This commit is contained in:
degasus 2012-12-11 12:37:08 +01:00 committed by Ryan Houdek
parent c207422987
commit 75dd48247f
4 changed files with 120 additions and 105 deletions

View file

@ -101,12 +101,11 @@ void SWRenderer::RenderText(const char* pstr, int left, int top, u32 color)
{
int nBackbufferWidth = (int)OpenGL_GetBackbufferWidth();
int nBackbufferHeight = (int)OpenGL_GetBackbufferHeight();
glColor4f(((color>>16) & 0xff)/255.0f, ((color>> 8) & 0xff)/255.0f,
((color>> 0) & 0xff)/255.0f, ((color>>24) & 0xFF)/255.0f);
s_pfont->printMultilineText(pstr,
left * 2.0f / (float)nBackbufferWidth - 1,
1 - top * 2.0f / (float)nBackbufferHeight,
0, nBackbufferWidth, nBackbufferHeight);
0, nBackbufferWidth, nBackbufferHeight, color);
}
void SWRenderer::DrawDebugText()