Hi,
I'm trying to draw text using a custom font in OpenGL mode and I can't get it working.
I'm using the MakeFont tool, standard ascii charset, arial font, size 12, color FFFFFF, max pixel per row 0, variable width font or not, 24bit or not, anti aliased or not, saving to PNG
with the following code
I tried every combination of variable width or not, rgba surface or not, color key or not, etc...
All I get is a blackscreen.
In the DrawFont function, when I replace &my;_font by &display-;>fontinternal, it's working. so I tried to save the fontinternal as png/bmp with WritePNG/BMP function to look how the picture was made but it's not working.
so now I'm stuck, can you please help me get this working ? thanks !
I'm trying to draw text using a custom font in OpenGL mode and I can't get it working.
I'm using the MakeFont tool, standard ascii charset, arial font, size 12, color FFFFFF, max pixel per row 0, variable width font or not, 24bit or not, anti aliased or not, saving to PNG
with the following code
- Code:
E2DSurfaceRGBA my_font;
ERESULT ClassMain::OnDisplayInit(ENATIVETYPE instance, ClassEDisplay *display)
{
if (display->CreateSurface(&my;_font, "test.png") != E_OK)
return(E_ERROR);
my_font.SetFontCharacters(32, 127);
my_font.BuildFont(true);
[...]
ERESULT ClassMain::OnNextFrame(ClassEDisplay *display, unsigned long timedelta)
{
display->DrawFont(0, 200, &my;_font, "youpi !");
I tried every combination of variable width or not, rgba surface or not, color key or not, etc...
All I get is a blackscreen.
In the DrawFont function, when I replace &my;_font by &display-;>fontinternal, it's working. so I tried to save the fontinternal as png/bmp with WritePNG/BMP function to look how the picture was made but it's not working.
so now I'm stuck, can you please help me get this working ? thanks !