From 627c8d0c947391cb025671d281bc91370e55bb03 Mon Sep 17 00:00:00 2001 From: Javier Sancho Date: Sat, 16 May 2020 08:29:27 +0200 Subject: [PATCH] make-material --- irrlicht.scm | 1 + irrlicht/video.scm | 53 ++++++++++++++++++++++++++++++++++++++++++++++ src/material.cpp | 4 ++-- 3 files changed, 56 insertions(+), 2 deletions(-) diff --git a/irrlicht.scm b/irrlicht.scm index 7d730c9..74a02d3 100644 --- a/irrlicht.scm +++ b/irrlicht.scm @@ -51,6 +51,7 @@ is-empty? is-window-active? make-box3d + make-material make-vertex3d run set-material-flag! diff --git a/irrlicht/video.scm b/irrlicht/video.scm index 596c774..9acfa18 100644 --- a/irrlicht/video.scm +++ b/irrlicht/video.scm @@ -84,3 +84,56 @@ (S3DVertex_make position normal color tcoords)))) (export make-vertex3d) + + +;; SMaterial +(define-class () + (irr-class #:init-value "SMaterial")) + +(define* (make-material #:key + (material-type 'solid) + (ambient-color '(255 255 255 255)) + (diffuse-color '(255 255 255 255)) + (emissive-color '(0 0 0 0)) + (specular-color '(255 255 255 255)) + (shininess 0) + (material-type-param 0) + (material-type-param-2 0) + (thickness 1) + (z-buffer 'less-equal) + (anti-aliasing 'simple) + (color-mask 'all) + (color-material 'diffuse) + (blend-operation 'none) + (polygon-offset-factor 0) + (polygon-offset-direction 'front) + (wireframe #f) + (point-cloud #f) + (gouraud-shading #t) + (lighting #t) + (z-write-enable #t) + (backface-culling #t) + (frontface-culling #f) + (fog-enable #f) + (normalize-normals #f) + (use-mip-maps #t)) + (let ((SMaterial_make (get-irrlicht-proc "SMaterial_make"))) + (make + #:irr-pointer + (SMaterial_make #:material-type material-type #:ambient-color ambient-color + #:diffuse-color diffuse-color #:emissive-color emissive-color + #:specular-color specular-color #:shininess shininess + #:material-type-param material-type-param + #:material-type-param-2 material-type-param-2 + #:thickness thickness #:z-buffer z-buffer #:anti-aliasing anti-aliasing + #:color-mask color-mask #:color-material color-material + #:blend-operation blend-operation + #:polygon-offset-factor polygon-offset-factor + #:polygon-offset-direction polygon-offset-direction + #:wireframe wireframe #:point-cloud point-cloud + #:gouraud-shading gouraud-shading #:lighting lighting + #:z-write-enable z-write-enable #:backface-culling backface-culling + #:frontface-culling frontface-culling #:fog-enable fog-enable + #:normalize-normals normalize-normals #:use-mip-maps use-mip-maps)))) + +(export make-material) diff --git a/src/material.cpp b/src/material.cpp index 7c2eb0e..821f8d4 100644 --- a/src/material.cpp +++ b/src/material.cpp @@ -30,7 +30,7 @@ using namespace irr; SCM -video_SMaterial_make (SCM rest) +SMaterial_make (SCM rest) { SCM material_type; SCM ambient_color; @@ -122,7 +122,7 @@ video_SMaterial_make (SCM rest) void init_material (void) { - DEFINE_GSUBR ("video_SMaterial_make", 0, 0, 1, video_SMaterial_make); + DEFINE_GSUBR ("SMaterial_make", 0, 0, 1, SMaterial_make); } video::E_ANTI_ALIASING_MODE -- 2.39.2