(clines "#include <FTGL/ftgl.h>")
+(mapcconst int "int" "ft_encoding_unicode")
+(mapcconst int "int" "FTGL_RENDER_ALL")
+
;;; FTGL Functions
(defcfun "int gacela_ftglCreateTextureFont (char *file)" 0
"return ftglCreateTextureFont (file);")
(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"))
;;; You should have received a copy of the GNU General Public License
;;; along with this program. If not, see <http://www.gnu.org/licenses/>.
+(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))
(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)
(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)))
(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)