From: Javier Sancho Date: Tue, 4 Feb 2020 17:08:06 +0000 (+0100) Subject: Set material for video driver X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=cc03ee884302dfeb94b5da68dd2b618c41333d5c;p=guile-irrlicht.git Set material for video driver --- 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