X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=src%2Fgacela.c;h=e1e05aa2a66d7d9acf5633dc476d7a5d46852de5;hb=46487d7bdbf43bac830d5310ecdb8c07feb9163f;hp=4517f4841c78de8c8173111304f08757b5927800;hpb=6aea83358ce8a171baae97f709dca9f0e0a7f246;p=gacela.git diff --git a/src/gacela.c b/src/gacela.c index 4517f48..e1e05aa 100644 --- a/src/gacela.c +++ b/src/gacela.c @@ -1,13 +1,54 @@ +/* Gacela, a GNU Guile extension for fast games development + Copyright (C) 2009 by Javier Sancho Fernandez + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #include +#include #include "gacela_SDL.h" +#include "gacela_GL.h" +#include "gacela_FTGL.h" static void* register_functions (void* data) { SDL_register_functions (NULL); + GL_register_functions (NULL); + FTGL_register_functions (NULL); return NULL; } +void +load_scheme_file (char *path, char *filename) +{ + char fn[strlen (path) + 1024]; + + strcpy (fn, path); + strcat (fn, "/"); + strcat (fn, filename); + + scm_c_primitive_load (fn); +} + +void +load_scheme_files (char *path) +{ + load_scheme_file (path, "gacela.scm"); + load_scheme_file (path, "gacela_ttf.scm"); +} + int main (int argc, char *argv[]) { @@ -16,5 +57,7 @@ main (int argc, char *argv[]) scm_c_eval_string ("(set-repl-prompt! \"gacela>\")"); scm_c_eval_string ("(use-modules (ice-9 readline))"); scm_c_eval_string ("(activate-readline)"); + scm_c_eval_string ("(use-modules (ice-9 optargs))"); + load_scheme_files (dirname (argv[0])); scm_shell (argc, argv); }