X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=irrlicht%2Fvideo.scm;h=9acfa1853c7cc3272286e5ee5d7ebcfb78f7f1a0;hb=627c8d0c947391cb025671d281bc91370e55bb03;hp=d3b6f8accfe9af0d7497970ec33a84889f7df71d;hpb=f842432ad7cfd7f530188e2a4848aea3da03719e;p=guile-irrlicht.git diff --git a/irrlicht/video.scm b/irrlicht/video.scm index d3b6f8a..9acfa18 100644 --- a/irrlicht/video.scm +++ b/irrlicht/video.scm @@ -20,11 +20,120 @@ (define-module (irrlicht video) #:use-module (oop goops) + #:use-module (ice-9 optargs) #:use-module (irrlicht base) #:use-module (irrlicht foreign)) +;; ITexture +(define-class () + (irr-class #:init-value "ITexture")) + +(export ) + + ;; IVideoDriver -(define-class ()) +(define-class () + (irr-class #:init-value "IVideoDriver")) + +(define-method (begin-scene (video-driver ) . rest) + (let-keywords rest #f + ((back-buffer #t) + (z-buffer #t) + (color '(255 0 0 0)) + video-data + source-rect) + ((get-irrlicht-proc "beginScene" video-driver) + video-driver + back-buffer + z-buffer + color + video-data + source-rect))) + +(define-method (end-scene (video-driver )) + ((get-irrlicht-proc "endScene" video-driver) + video-driver)) + +(define-method (get-fps (video-driver )) + (let ((getFPS (get-irrlicht-proc "getFPS" video-driver))) + (getFPS video-driver))) + +(define-method (get-name (video-driver )) + (let ((getName (get-irrlicht-proc "getName" video-driver))) + (getName video-driver))) + +(define-method (get-texture (video-driver ) filename) + (make + #:irr-pointer + ((get-irrlicht-proc "getTexture" video-driver) + video-driver + filename))) + +(export begin-scene end-scene get-fps get-name get-texture) + + +;; S3DVertex +(define-class () + (irr-class #:init-value "S3DVertex")) + +(define (make-vertex3d position normal color tcoords) + (let ((S3DVertex_make (get-irrlicht-proc "S3DVertex_make"))) + (make + #:irr-pointer + (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 ) +(export make-material)