From 09b533e185e5f0f9e05231b36f57873063248dde Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Sun, 8 Jun 2014 13:35:16 -0400 Subject: [PATCH] display multiple lines of text --- ftgl_testing.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ftgl_testing.cc b/ftgl_testing.cc index bfe3bea..c4b2545 100644 --- a/ftgl_testing.cc +++ b/ftgl_testing.cc @@ -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); }