+++ /dev/null
-;;; guile-irrlicht --- FFI bindings for Irrlicht Engine
-;;; Copyright (C) 2020 Javier Sancho <jsf@jsancho.org>
-;;;
-;;; This file is part of guile-irrlicht.
-;;;
-;;; Guile-irrlicht is free software; you can redistribute it and/or modify
-;;; it under the terms of the GNU Lesser General Public License as
-;;; published by the Free Software Foundation; either version 3 of the
-;;; License, or (at your option) any later version.
-;;;
-;;; Guile-irrlicht is distributed in the hope that it will be useful, but
-;;; WITHOUT ANY WARRANTY; without even the implied warranty of
-;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-;;; General Public License for more details.
-;;;
-;;; You should have received a copy of the GNU Lesser General Public
-;;; License along with guile-irrlicht. If not, see
-;;; <http://www.gnu.org/licenses/>.
-
-
-(define-module (irrlicht video)
- #:use-module (oop goops)
- #:use-module (ice-9 optargs)
- #:use-module (irrlicht base)
- #:use-module (irrlicht foreign))
-
-
-;; ITexture
-(define-class <texture> (<irrlicht-base>)
- (irr-class #:init-value "ITexture"))
-
-(export <texture>)
-
-
-;; 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")))
- (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)
-
-
-;; IVideoDriver
-(define-class <video-driver> (<irrlicht-base>)
- (irr-class #:init-value "IVideoDriver"))
-
-(define-method (begin-scene (video-driver <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 (draw-vertex-primitive-list (video-driver <video-driver>) vertices indices . rest)
- (let-keywords rest #f
- ((v-type 'standard)
- (p-type 'triangles))
- (let ((drawVertexPrimitiveList (get-irrlicht-proc "drawVertexPrimitiveList" video-driver)))
- (drawVertexPrimitiveList video-driver vertices indices v-type p-type))))
-
-(define-method (end-scene (video-driver <video-driver>))
- ((get-irrlicht-proc "endScene" video-driver)
- video-driver))
-
-(define-method (get-fps (video-driver <video-driver>))
- (let ((getFPS (get-irrlicht-proc "getFPS" video-driver)))
- (getFPS video-driver)))
-
-(define-method (get-name (video-driver <video-driver>))
- (let ((getName (get-irrlicht-proc "getName" video-driver)))
- (getName video-driver)))
-
-(define-method (get-texture (video-driver <video-driver>) filename)
- (let ((getTexture (get-irrlicht-proc "getTexture" video-driver)))
- (getTexture video-driver filename)))
-
-(define-method (set-material! (video-driver <video-driver>) (material <material>))
- (let ((setMaterial (get-irrlicht-proc "setMaterial" video-driver)))
- (setMaterial video-driver material)))
-
-(define-method (set-transform! (video-driver <video-driver>) state mat)
- (let ((setTransform (get-irrlicht-proc "setTransform" video-driver)))
- (setTransform video-driver state mat)))
-
-(export <video-driver> begin-scene draw-vertex-primitive-list end-scene get-fps get-name get-texture
- set-material! set-transform!)
-
-
-;; S3DVertex
-(define-class <vertex3d> (<irrlicht-base>)
- (irr-class #:init-value "S3DVertex"))
-
-(define-method (get-position (vertex3d <vertex3d>))
- (let ((S3DVertex_Pos (get-irrlicht-proc "S3DVertex_Pos")))
- (S3DVertex_Pos vertex3d)))
-
-(define (make-vertex3d position normal color tcoords)
- (let ((S3DVertex_make (get-irrlicht-proc "S3DVertex_make")))
- (S3DVertex_make position normal color tcoords)))
-
-(export <vertex3d> get-position make-vertex3d)