From: jsancho Date: Sun, 27 Sep 2009 18:58:55 +0000 (+0000) Subject: (no commit message) X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=725dbc52d30cf457f98fa4e0e5bf1051da09d1b9;p=gacela.git --- diff --git a/gacela_FTGL.lisp b/gacela_FTGL.lisp index 823be34..7e0b332 100644 --- a/gacela_FTGL.lisp +++ b/gacela_FTGL.lisp @@ -19,6 +19,9 @@ (clines "#include ") +(mapcconst int "int" "ft_encoding_unicode") +(mapcconst int "int" "FTGL_RENDER_ALL") + ;;; FTGL Functions (defcfun "int gacela_ftglCreateTextureFont (char *file)" 0 "return ftglCreateTextureFont (file);") @@ -26,9 +29,13 @@ (defcfun "int gacela_ftglSetFontFaceSize (int font, int size, int res)" 0 "return ftglSetFontFaceSize (font, size, res);") -(defcfun "int gacela_ftglSetFontCharMap(int font, int encoding)" 0 - "return ftglSetFontCharMap(font, encoding);") +(defcfun "int gacela_ftglSetFontCharMap (int font, int encoding)" 0 + "return ftglSetFontCharMap (font, encoding);") + +(defcfun "void gacela_ftglRenderFont (int font, char *string, int mode)" 0 + "ftglRenderFont (font, string, mode);") (defentry ftglCreateTextureFont (string) (int "gacela_ftglCreateTextureFont")) (defentry ftglSetFontFaceSize (int int int) (int "gacela_ftglSetFontFaceSize")) (defentry ftglSetFontCharMap (int int) (int "gacela_ftglSetFontCharMap")) +(defentry ftglRenderFont (int string int) (void "gacela_ftglRenderFont")) diff --git a/gacela_make.lisp b/gacela_make.lisp index 50100f4..99eacf5 100755 --- a/gacela_make.lisp +++ b/gacela_make.lisp @@ -14,6 +14,9 @@ ;;; You should have received a copy of the GNU General Public License ;;; along with this program. If not, see . +(setq compiler::*cc* (concatenate 'string + compiler::*cc* + "-I/usr/include/FTGL -I/usr/include/freetype2")) (defmacro compile-gfile (file-name) `(compile-file ,file-name :system-p t)) @@ -23,17 +26,19 @@ (compile-gfile "gacela_misc.lisp") (compile-gfile "gacela_SDL.lisp") (compile-gfile "gacela_GL.lisp") + (compile-gfile "gacela_FTGL.lisp") (compile-gfile "gacela_draw.lisp") + (compile-gfile "gacela_ttf.lisp") (compile-gfile "gacela_events.lisp") (compile-gfile "gacela_mobs.lisp") (compile-gfile "gacela_widgets.lisp")) (defun link-gacela () (compiler::link - '("gacela.o" "gacela_misc.o" "gacela_SDL.o" "gacela_GL.o" "gacela_draw.o" "gacela_events.o" "gacela_mobs.o" "gacela_widgets.o") + '("gacela.o" "gacela_misc.o" "gacela_SDL.o" "gacela_GL.o" "gacela_FTGL.o" "gacela_draw.o" "gacela_ttf.o" "gacela_events.o" "gacela_mobs.o" "gacela_widgets.o") "gacela" "" - "-lSDL -lSDL_image -lSDL_ttf -lSDL_mixer -lSDL_gfx -lGL -lGLU")) + "-lSDL -lSDL_image -lSDL_ttf -lSDL_mixer -lSDL_gfx -lGL -lGLU -lftgl")) (defun build-gacela () (compile-gacela) diff --git a/gacela_tetris.lisp b/gacela_tetris.lisp index 6b4320f..ef56ed2 100644 --- a/gacela_tetris.lisp +++ b/gacela_tetris.lisp @@ -103,7 +103,8 @@ (next (random-tetramine)) (timer (make-timer)) (grid (make-list 20 :initial-element (make-list 14))) - (background (draw-image-function "fondo_tetris.png"))) + (background (draw-image-function "fondo_tetris.png")) + (font (open-font "lazy.ttf"))) (defun tetramine () (cond ((eq (timer-state timer) 'stopped) (start-timer timer))) @@ -128,12 +129,12 @@ (setq tetramine next x 6 y 0) (setq next (random-tetramine))) (t (incf y) (start-timer timer))))) - (draw-color '(0.8 0.8 0.8)) (funcall background) (translate -288 218) (draw-grid (join-grids tetramine grid x y)) (translate 440 440) - (draw-grid next))) + (draw-grid next) + (render-text "Hola" font))) (let ((frame 0.0) (fps (make-timer)) (update (make-timer))) (start-timer update)