]> git.jsancho.org Git - guile-irrlicht.git/commitdiff
Set material for video driver
authorJavier Sancho <jsf@jsancho.org>
Tue, 4 Feb 2020 17:08:06 +0000 (18:08 +0100)
committerJavier Sancho <jsf@jsancho.org>
Tue, 4 Feb 2020 17:08:06 +0000 (18:08 +0100)
irrlicht/bindings/video.scm
irrlicht/scene.scm
irrlicht/video.scm

index 8740d209673a541d6bf3251a46071eb9799c3983..d3f8b48118fe9788bb82ba231ec0d59d3afad599 100644 (file)
 (define-foreign get-video-driver-name
   '* "irr_video_getName" (list '*))
 
+(define-foreign set-material
+  void "irr_video_setMaterial" (list '* '*))
+
 ;; s3dvertex struct
 (define-wrapped-pointer-type s3dvertex-type
   s3dvertex?
index cd8e4d45a134c6c9df35c34ac4b41c9ab5e6e1bd..3beff2806652fd37602e1bf16370eb03cd93bae9 100644 (file)
            (ffi-core:aabbox3df->pointer (get-bounding-box))))
         (c-get-material
          (lambda (i)
-           (ffi-core:material->pointer (get-material i)))))
+           (ffi-video:smaterial->pointer (get-material i)))))
     (ffi-scene:add-custom-scene-node
      scene-manager
      parent
index a394c01b667de8580b8dd1877f599b8fd385a9eb..1df01fe47a04d9bd251f77455fafaa90d808893c 100644 (file)
@@ -29,6 +29,7 @@
             get-fps
             get-texture
             get-video-driver-name
+            set-material!
             make-s3dvertex
             vertex-position
             make-material))
   (pointer->string
    (ffi-video:get-video-driver-name driver)))
 
+(define (set-material! driver material)
+  (ffi-video:set-material
+   driver
+   (ffi-video:smaterial->pointer material)))
+
 ;; s3d vertices
 (define (make-s3dvertex position normal color t-coords)
   (ffi-video:pointer->s3dvertex