]> git.jsancho.org Git - guile-irrlicht.git/blob - irrlicht/io.scm
add-file-archive! get-file-system get-name
[guile-irrlicht.git] / irrlicht / io.scm
1 ;;; guile-irrlicht --- FFI bindings for Irrlicht Engine
2 ;;; Copyright (C) 2020 Javier Sancho <jsf@jsancho.org>
3 ;;;
4 ;;; This file is part of guile-irrlicht.
5 ;;;
6 ;;; Guile-irrlicht is free software; you can redistribute it and/or modify
7 ;;; it under the terms of the GNU Lesser General Public License as
8 ;;; published by the Free Software Foundation; either version 3 of the
9 ;;; License, or (at your option) any later version.
10 ;;;
11 ;;; Guile-irrlicht is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 ;;; General Public License for more details.
15 ;;;
16 ;;; You should have received a copy of the GNU Lesser General Public
17 ;;; License along with guile-irrlicht.  If not, see
18 ;;; <http://www.gnu.org/licenses/>.
19
20
21 (define-module (irrlicht io)
22   #:use-module (oop goops)
23   #:use-module (ice-9 optargs)
24   #:use-module (irrlicht foreign)
25   #:use-module (irrlicht irr))
26
27
28 ;; IAttributeExchangingObject
29 (define-class <attribute-exchanging-object> (<reference-counted>)
30   (irr-class #:init-value "IAttributeExchangingObject" #:getter irr-class))
31
32 (export <attribute-exchanging-object>)
33
34
35 ;;IFileArchive
36 (define-class <file-archive> (<reference-counted>)
37   (irr-class #:init-value "IFileArchive" #:getter irr-class))
38
39 (export <file-archive>)
40
41
42 ;;IFileSystem
43 (define-class <file-system> (<reference-counted>)
44   (irr-class #:init-value "IFileSystem" #:getter irr-class))
45
46 (define-method (add-file-archive! (file-system <file-system>) filename . rest)
47   (let-keywords rest #f
48         ((ignore-case #t)
49          (ignore-paths #t)
50          (archive-type 'unknown)
51          (password "")
52          (ret-archive (make <file-archive>)))
53     (let ((addFileArchive (get-irrlicht-proc "addFileArchive" file-system)))
54       (addFileArchive
55        file-system filename ignore-case ignore-paths archive-type password ret-archive))))
56
57 (export <file-system> add-file-archive!)