display multiple lines of text
This commit is contained in:
parent
ee3670777e
commit
09b533e185
@ -8,6 +8,7 @@ using namespace std;
|
||||
|
||||
#define WIDTH 500
|
||||
#define HEIGHT 500
|
||||
#define FONT_SIZE 20
|
||||
|
||||
static FTFont * font;
|
||||
|
||||
@ -27,7 +28,7 @@ void init(void)
|
||||
{
|
||||
cerr << "Could not create font" << endl;
|
||||
}
|
||||
font->FaceSize(16);
|
||||
font->FaceSize(FONT_SIZE);
|
||||
}
|
||||
|
||||
void display(SDL_Window * window)
|
||||
@ -39,7 +40,9 @@ void display(SDL_Window * window)
|
||||
glVertex3f(10.0, 210.0, 0.0);
|
||||
glVertex3f(10.0, 202.0, 0.0);
|
||||
glEnd();
|
||||
font->Render("Hello");
|
||||
font->Render("abcdefghijklmnopqrstuvwxyz", -1, FTPoint(10, HEIGHT - FONT_SIZE, 0));
|
||||
font->Render("ABCDEFGHIJKLMNOPQRSTUVWXYZ", -1, FTPoint(10, HEIGHT - FONT_SIZE * 2, 0));
|
||||
font->Render("0123456789", -1, FTPoint(10, HEIGHT - FONT_SIZE * 3, 0));
|
||||
SDL_GL_SwapWindow(window);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user