/*
 * gauche-sdl-gfx.c - Gauche SDL_gfx binding
 *
 *  Copyright(C) 2003 by Michael Vess (mvess@michaelvess.com)
 *
 *  Permission to use, copy, modify, distribute this software and
 *  accompanying documentation for any purpose is hereby granted,
 *  provided that existing copyright notices are retained in all
 *  copies and that this notice is included verbatim in all
 *  distributions.
 *  This software is provided as is, without express or implied
 *  warranty.  In no circumstances the author(s) shall be liable
 *  for any damages arising out of the use of this software.
 *
 *  $Id: gauche-sdl-gfx.c,v 1.1 2003/01/22 02:26:12 mikiso Exp $
 */

#include <gauche.h>
#include <gauche/extend.h>
#include "gauche-sdl-gfx.h"


/*****************************************************************************
 * Framerate
 */

/* FPSmanager */

static void sdl_fpsmanager_print(ScmObj obj, ScmPort *out, ScmWriteContext *ctx)
{
   Scm_Printf(out, "#<sdl-fpsmanager framecount:%d rate:%d>",
              SCM_SDL_FPSMANAGER(obj)->framecount,
              SCM_SDL_FPSMANAGER(obj)->rate);
}

SCM_DEFINE_BUILTIN_CLASS(Scm_SdlFPSmanagerClass,
                         sdl_fpsmanager_print, NULL, NULL, NULL,
                         SCM_CLASS_DEFAULT_CPL);


/*****************************************************************************
 * Initialization
 */

extern void Scm_Init_sdl_gfx_lib(ScmModule *mod);

void Scm_Init_gauche_sdl_gfx(void)
{
   ScmModule *mod;
   SCM_INIT_EXTENSION(gauche_sdl_gfx);
   mod = SCM_MODULE(SCM_FIND_MODULE("sdl.gfx", TRUE));
   Scm_InitBuiltinClass(&Scm_SdlFPSmanagerClass, "<sdl-fpsmanager>",
                        NULL, sizeof(Scm_SdlFPSmanagerClass)/sizeof(ScmObj),
                        mod);
   Scm_Init_sdl_gfx_lib(mod);
}


syntax highlighted by Code2HTML, v. 0.9.1