(define device
(create-device
#:device-type 'software
- #:window-size '(640 480)))
+ #:window-size (make-dimension2d 640 480)))
(when (not device)
(exit #f))
(define device
(create-device
#:device-type driver
- #:window-size '(640 480)))
+ #:window-size (make-dimension2d 640 480)))
(when (not device)
(exit #f))
(let ((public-modules
'((irrlicht aabbox3d)
(irrlicht device)
+ (irrlicht dimension2d)
(irrlicht gui)
(irrlicht io)
(irrlicht scene)
#:use-module (system foreign)
#:use-module (irrlicht util))
+;; rect struct
+(define-public rect
+ (list int32 int32 int32 int32))
+
+;; vector2df struct
+(define-public vector2df
+ (list float float float))
+
+;; vector3df struct
+(define-public vector3df
+ (list float float float))
+
;; aabbox3d f32 struct and functions
(define-public aabbox3d_f32
- (list
- float float float ;minEdge
- float float float ;maxEdge
+ (append
+ vector3df ; min-edge
+ vector3df ; max-edge
))
(define-foreign aabbox3d-add-internal-point
(define-foreign aabbox3d-reset
void "irr_core_aabbox3d_reset" (list '* '*))
-
-;; dimension2d struct
-(define-public dimension2d
- (list uint32 uint32))
-
-;; rect struct
-(define-public rect
- (list int32 int32 int32 int32))
-
-;; vector3df struct
-(define-public vector3df
- (list float float float))
#:use-module (ice-9 match)
#:use-module (system foreign)
#:use-module ((irrlicht bindings) #:prefix ffi:)
- #:use-module ((irrlicht bindings core) #:prefix ffi-core:)
#:use-module ((irrlicht bindings video) #:prefix ffi-video:)
#:use-module (irrlicht util)
#:export (create-device
('direct3d9 ffi-video:EDT_DIRECT3D9)
('opengl ffi-video:EDT_OPENGL)
('count ffi-video:EDT_COUNT)))
- (wsize (make-c-struct ffi-core:dimension2d window-size)))
+ (wsize (foreign-record-pointer window-size)))
(let ((device (ffi:create-device driver wsize bits
(bool->integer fullscreen)
(bool->integer stencilbuffer)
--- /dev/null
+;;; guile-irrlicht --- FFI bindings for Irrlicht Engine
+;;; Copyright (C) 2019 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 dimension2d)
+ #:use-module (system foreign)
+ #:use-module (irrlicht util)
+ #:export (dimension2d
+ make-dimension2d
+ dimension2d?
+ dimension2d-width
+ dimension2d-height))
+
+;; dimension2d struct
+(define-foreign-record-type dimension2d
+ (make-dimension2d width height)
+ dimension2d?
+ (width uint32 dimension2d-width)
+ (height uint32 dimension2d-height))
#:export (bool->integer
integer->bool
define-foreign
- define-foreign-record-type))
+ define-foreign-record-type
+ foreign-record-pointer))
(define (bool->integer var)
(if var 1 0))
(list-set! values setter-id new-value)
(set-foreign-record-pointer! record (make-c-struct types values))
new-value))
- ...
-
- (export name)
- (export make-name)
- (export predicate?)
- (export getter)
- ...
- (export setter)
...))))))