mirror of
https://github.com/simtactics/niotso.git
synced 2025-07-04 05:37:02 -04:00
Added Graphics::DrawText which can draw text on to an image with alignment. No multi-line support yet.
This commit is contained in:
parent
7d9259b63d
commit
7a5124a687
8 changed files with 145 additions and 35 deletions
|
@ -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);
|
||||
}
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue