]> git.jsancho.org Git - guile-irrlicht.git/commitdiff
Wrapped s3dvertex type
authorJavier Sancho <jsf@jsancho.org>
Thu, 9 Jan 2020 18:15:44 +0000 (19:15 +0100)
committerJavier Sancho <jsf@jsancho.org>
Thu, 9 Jan 2020 18:15:44 +0000 (19:15 +0100)
irrlicht/bindings/video.scm
irrlicht/video.scm

index 2e60ff35d4a3626c3615e96dd621183907ece359..7816686b02ca761598996e63f7d0e0fdabba9042 100644 (file)
@@ -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
 
 (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 "#<s3dvertex ~x>"
+            (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))))
index ed133715dce43faaace676ee02b24760d392691b..36ea0ec8a4afa77ff73448ff984f81c3d0a0a4a7 100644 (file)
@@ -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