]> git.jsancho.org Git - guile-irrlicht.git/blobdiff - irrlicht/base.scm
GOOPS and POC with create-device
[guile-irrlicht.git] / irrlicht / base.scm
diff --git a/irrlicht/base.scm b/irrlicht/base.scm
new file mode 100644 (file)
index 0000000..bb04442
--- /dev/null
@@ -0,0 +1,35 @@
+;;; guile-irrlicht --- FFI bindings for Irrlicht Engine
+;;; Copyright (C) 2020 Javier Sancho <jsf@jsancho.org>
+;;;
+;;; This file is part of guile-irrlicht.
+;;;
+;;; Guile-irrlicht is free software; you can redistribute it and/or modify
+;;; it under the terms of the GNU Lesser General Public License as
+;;; published by the Free Software Foundation; either version 3 of the
+;;; License, or (at your option) any later version.
+;;;
+;;; Guile-irrlicht 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 Lesser General Public
+;;; License along with guile-irrlicht.  If not, see
+;;; <http://www.gnu.org/licenses/>.
+
+
+(define-module (irrlicht base)
+  #:use-module (oop goops)
+  #:use-module (system foreign)
+  #:export (<irrlicht-base>
+            wrapped-obj))
+
+(define-class <irrlicht-base> ()
+  (irr-ptr #:init-value %null-pointer #:accessor irrlicht-pointer #:init-keyword #:ptr)
+  (irr-class #:init-value "irrlicht-base" #:getter irrlicht-class)
+  (wrapped-obj #:accessor wrapped-obj #:allocation #:virtual
+               #:slot-ref (lambda (obj)
+                            (cons (slot-ref obj 'irr-class)
+                                  (slot-ref obj 'irr-ptr)))
+               #:slot-set! (lambda (obj wrapped)
+                             (slot-set! obj 'irr-ptr (cdr wrapped)))))