From: Javier Sancho Date: Thu, 9 Jan 2020 18:15:44 +0000 (+0100) Subject: Wrapped s3dvertex type X-Git-Url: https://git.jsancho.org/?p=guile-irrlicht.git;a=commitdiff_plain;h=0d8955b4f8a481aec28acc91ba964ff66c918e75 Wrapped s3dvertex type --- diff --git a/irrlicht/bindings/video.scm b/irrlicht/bindings/video.scm index 2e60ff3..7816686 100644 --- a/irrlicht/bindings/video.scm +++ b/irrlicht/bindings/video.scm @@ -20,6 +20,7 @@ (define-module (irrlicht bindings video) #:use-module (system foreign) + #:use-module ((irrlicht bindings core) #:prefix ffi-core:) #:use-module (irrlicht util foreign)) ;; E_DRIVER_TYPE enum @@ -76,3 +77,23 @@ (define-foreign get-video-driver-name '* "irr_video_getName" (list '*)) + +;; s3dvertex struct +(define-wrapped-pointer-type s3dvertex + s3dvertex? + pointer->s3dvertex s3dvertex->pointer + (lambda (vertex port) + (format port "#" + (pointer-address (s3dvertex->pointer vertex))))) + +(export s3dvertex->pointer) + +(define s3dvertex-type + (list ffi-core:vector3df + ffi-core:vector3df + scolor + ffi-core:vector2df)) + +(define-public (make-s3dvertex position normal color t-coords) + (pointer->s3dvertex + (make-c-struct s3dvertex-type (list position normal color t-coords)))) diff --git a/irrlicht/video.scm b/irrlicht/video.scm index ed13371..36ea0ec 100644 --- a/irrlicht/video.scm +++ b/irrlicht/video.scm @@ -27,7 +27,8 @@ end-scene get-fps get-texture - get-video-driver-name)) + get-video-driver-name) + #:re-export ((ffi-video:make-s3dvertex . make-s3dvertex))) (define* (begin-scene driver #:key