From 09d84b94c312d54359126d22c45499b67490c949 Mon Sep 17 00:00:00 2001 From: Javier Sancho Date: Fri, 9 Sep 2016 19:08:08 +0200 Subject: [PATCH] Scene type and basic functions --- gacela/scene.scm | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 gacela/scene.scm diff --git a/gacela/scene.scm b/gacela/scene.scm new file mode 100644 index 0000000..0cf05e4 --- /dev/null +++ b/gacela/scene.scm @@ -0,0 +1,45 @@ +;;; Gacela, a GNU Guile extension for fast games development +;;; Copyright (C) 2016 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 . + + +(define-module (gacela scene) + #:use-module (srfi srfi-9) + #:use-module (srfi srfi-9 gnu) + #:export (make-scene + display-scene + run-scene)) + + +;;; Scene Type + +(define-record-type + (make-scene name procedure) + scene? + (name scene-name) + (procedure scene-procedure)) + +(set-record-type-printer! + (lambda (record port) + (format port "#" (scene-name record)))) + + +;;; Scene Procedures + +(define (display-scene scene) + ((scene-procedure scene))) + +(define (run-scene scene) + ((scene-procedure scene))) -- 2.39.2