]> git.jsancho.org Git - guile-irrlicht.git/commitdiff
make-material
authorJavier Sancho <jsf@jsancho.org>
Sat, 16 May 2020 06:29:27 +0000 (08:29 +0200)
committerJavier Sancho <jsf@jsancho.org>
Sat, 16 May 2020 06:29:27 +0000 (08:29 +0200)
irrlicht.scm
irrlicht/video.scm
src/material.cpp

index 7d730c9ac77a40b45e69a8e45d82fb12b7f4790d..74a02d3c2245e5b5ae21d51a47d544d478404417 100644 (file)
@@ -51,6 +51,7 @@
                is-empty?
                is-window-active?
                make-box3d
+               make-material
                make-vertex3d
                run
                set-material-flag!
index 596c7742542beca7bbab2c74b50b5677293a1fb6..9acfa1853c7cc3272286e5ee5d7ebcfb78f7f1a0 100644 (file)
       (S3DVertex_make position normal color tcoords))))
 
 (export <vertex3d> make-vertex3d)
+
+
+;; SMaterial
+(define-class <material> (<irrlicht-base>)
+  (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 <material>
+      #: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 <material> make-material)
index 7c2eb0e6569370363d79dcd473d98b43e167fe5a..821f8d4602ebe0640a2637af69ea99aa799dd000 100644 (file)
@@ -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