Added Graphics::DrawText which can draw text on to an image with alignment. No multi-line support yet.

This commit is contained in:
Fatbag 2012-04-09 23:58:16 -05:00
parent 7d9259b63d
commit 7a5124a687
8 changed files with 145 additions and 35 deletions

View file

@ -27,4 +27,19 @@ namespace Graphics {
int InitGL();
void ResizeViewport(unsigned width, unsigned height);
enum TextAlignment {
ALIGN_LEFT_TOP,
ALIGN_LEFT_CENTER,
ALIGN_CENTER_TOP,
ALIGN_CENTER_CENTER,
ALIGN_RIGHT_TOP,
ALIGN_RIGHT_CENTER
};
//Font.cpp
extern FT_Library FreeTypeLibrary;
extern FT_Face FontFace;
void DrawText(Image_t * Image, const wchar_t * String, int x, int y, unsigned width, unsigned height,
TextAlignment Alignment, int font, COLORREF Color);
}

View file

@ -95,6 +95,7 @@ int InitGL(){
glEnable(GL_DEPTH_TEST);
glEnable(GL_CULL_FACE);
glEnable(GL_RESCALE_NORMAL);
glEnable(GL_TEXTURE_2D);
glDisable(GL_BLEND);
glDepthFunc(GL_LEQUAL);
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);