From cc03ee884302dfeb94b5da68dd2b618c41333d5c Mon Sep 17 00:00:00 2001 From: Javier Sancho Date: Tue, 4 Feb 2020 18:08:06 +0100 Subject: [PATCH] Set material for video driver --- irrlicht/bindings/video.scm | 3 +++ irrlicht/scene.scm | 2 +- irrlicht/video.scm | 6 ++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/irrlicht/bindings/video.scm b/irrlicht/bindings/video.scm index 8740d20..d3f8b48 100644 --- a/irrlicht/bindings/video.scm +++ b/irrlicht/bindings/video.scm @@ -157,6 +157,9 @@ (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? diff --git a/irrlicht/scene.scm b/irrlicht/scene.scm index cd8e4d4..3beff28 100644 --- a/irrlicht/scene.scm +++ b/irrlicht/scene.scm @@ -119,7 +119,7 @@ (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 diff --git a/irrlicht/video.scm b/irrlicht/video.scm index a394c01..1df01fe 100644 --- a/irrlicht/video.scm +++ b/irrlicht/video.scm @@ -29,6 +29,7 @@ get-fps get-texture get-video-driver-name + set-material! make-s3dvertex vertex-position make-material)) @@ -62,6 +63,11 @@ (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 -- 2.39.5