From cf82f90d852e7ba0478aaf7480ba5914edc02be5 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sun, 18 Aug 2013 09:05:10 -0400 Subject: Change render-font to draw-font and don't any matrix or color manipulation. --- 2d/font.scm | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to '2d/font.scm') diff --git a/2d/font.scm b/2d/font.scm index 4aef6da..404272b 100644 --- a/2d/font.scm +++ b/2d/font.scm @@ -40,18 +40,17 @@ (size font-size)) (define (load-font filename size) + "Loads a font from a file with a given size in points." (let ((ftgl-font (ftgl-create-texture-font filename))) ;; Hardcoded 72 dpi for now. (ftgl-set-font-face-size ftgl-font size 72) (make-font ftgl-font size))) -(define (render-font font text x y color alignment) - (with-gl-push-matrix - (gl-translate x y 0) - (apply-color color) - (ftgl-render-font (font-ftgl-font font) - text - (ftgl-render-mode all)))) +(define (draw-font font text) + "Renders the string text using the given font." + (ftgl-render-font (font-ftgl-font font) + text + (ftgl-render-mode all))) (export make-font @@ -59,7 +58,7 @@ font-ftgl-font font-size load-font - render-font) + draw-font) ;;; ;;; Textbox -- cgit v1.2.3