]> git.jsancho.org Git - guile-irrlicht.git/commitdiff
get-texture set-material-texture!
authorJavier Sancho <jsf@jsancho.org>
Mon, 11 May 2020 12:04:29 +0000 (14:04 +0200)
committerJavier Sancho <jsf@jsancho.org>
Mon, 11 May 2020 12:04:29 +0000 (14:04 +0200)
irrlicht.scm
irrlicht/scene.scm
irrlicht/video.scm

index 6c0fb98a96fa4af443ade6de9def3b2e7b623982..60a4f354230a9da4b3a74bd157ca825be2e535e0 100644 (file)
   #:use-module (irrlicht device)
   #:use-module (irrlicht gui)
   #:use-module (irrlicht scene)
+  #:use-module (irrlicht video)
   #:re-export (add-animated-mesh-scene-node!
                add-static-text!
                create-device
                get-gui-environment
                get-mesh
                get-scene-manager
+               get-texture
                get-video-driver
                is-empty?
                set-material-flag!
+               set-material-texture!
                set-md2-animation!
                set-window-caption!))
index 9ecb782ddddd3181c8d36a693982e312b718077b..3ca632656c3f37682b2a9c86e071820d334e5013 100644 (file)
@@ -24,7 +24,8 @@
   #:use-module (irrlicht base)
   #:use-module (irrlicht foreign)
   #:use-module (irrlicht io)
-  #:use-module (irrlicht irr))
+  #:use-module (irrlicht irr)
+  #:use-module (irrlicht video))
 
 
 ;; IMesh
    flag
    new-value))
 
-(export <scene-node> set-material-flag!)
+(define-method (set-material-texture! (node <scene-node>) texture-layer (texture <texture>))
+  ((get-irrlicht-proc "setMaterialTexture" node)
+   (irr-pointer node)
+   texture-layer
+   (irr-pointer texture)))
+
+(export <scene-node> set-material-flag! set-material-texture!)
 
 
 ;; ISceneNode
index d3b6f8accfe9af0d7497970ec33a84889f7df71d..f0f56a3871235237718497b5c104d01a5b2248c8 100644 (file)
   #:use-module (irrlicht foreign))
 
 
+;; ITexture
+(define-class <texture> (<irrlicht-base>)
+  (irr-class #:init-value "ITexture" #:getter irr-class))
+
+(export <texture>)
+
+
 ;; IVideoDriver
-(define-class <video-driver> (<irrlicht-base>))
+(define-class <video-driver> (<irrlicht-base>)
+  (irr-class #:init-value "IVideoDriver" #:getter irr-class))
+
+(define-method (get-texture (video-driver <video-driver>) filename)
+  (make <texture>
+    #:irr-pointer
+    ((get-irrlicht-proc "getTexture" video-driver)
+     (irr-pointer video-driver)
+     filename)))
 
-(export <video-driver>)
+(export <video-driver> get-texture)