From ae964fdd5a11a94d0ae5f9a33d8a08c23fd08825 Mon Sep 17 00:00:00 2001 From: Javier Sancho Date: Thu, 9 Jan 2020 19:09:31 +0100 Subject: [PATCH] Wrapped aabbox3df type --- irrlicht.scm | 3 ++- irrlicht/bindings/core.scm | 16 +++++++++++++--- irrlicht/core.scm | 23 +++++++++++++++++++++++ 3 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 irrlicht/core.scm diff --git a/irrlicht.scm b/irrlicht.scm index f3474c6..5db57e9 100644 --- a/irrlicht.scm +++ b/irrlicht.scm @@ -23,7 +23,8 @@ (eval-when (eval load compile) ;; load public symbols into current module (let ((public-modules - '((irrlicht device) + '((irrlicht core) + (irrlicht device) (irrlicht gui) (irrlicht io) (irrlicht scene) diff --git a/irrlicht/bindings/core.scm b/irrlicht/bindings/core.scm index e0a13af..59b05af 100644 --- a/irrlicht/bindings/core.scm +++ b/irrlicht/bindings/core.scm @@ -51,11 +51,21 @@ (make-c-struct vector3df data)) ;; aabbox3df struct -(define-public aabbox3df +(define-wrapped-pointer-type aabbox3df + aabbox3df? + pointer->aabbox3df aabbox3df->pointer + (lambda (box port) + (format port "#" + (pointer-address (aabbox3df->pointer box))))) + +(export aabbox3df->pointer) + +(define aabbox3df-type (list vector3df vector3df)) -(define-public (aabbox3df->pointer data) - (make-c-struct aabbox3df data)) +(define-public (make-aabbox3df) + (pointer->aabbox3df + (make-c-struct aabbox3df-type '((0 0 0) (0 0 0))))) (define-foreign aabbox3d-add-internal-point void "irr_core_aabbox3d_addInternalPoint" (list '* '*)) diff --git a/irrlicht/core.scm b/irrlicht/core.scm new file mode 100644 index 0000000..1fa5497 --- /dev/null +++ b/irrlicht/core.scm @@ -0,0 +1,23 @@ +;;; guile-irrlicht --- FFI bindings for Irrlicht Engine +;;; Copyright (C) 2019 Javier Sancho +;;; +;;; 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 +;;; . + + +(define-module (irrlicht core) + #:use-module ((irrlicht bindings core) #:prefix ffi-core:) + #:re-export ((ffi-core:make-aabbox3df . make-aabbox3df))) -- 2.39.2