]> git.jsancho.org Git - guile-assimp.git/blob - src/low-level/material.scm
A lot of functionality added
[guile-assimp.git] / src / low-level / material.scm
1 ;;; guile-assimp, foreign interface to libassimp
2 ;;; Copyright (C) 2014 by Javier Sancho Fernandez <jsf at jsancho dot org>
3 ;;;
4 ;;; This program is free software: you can redistribute it and/or modify
5 ;;; it under the terms of the GNU General Public License as published by
6 ;;; the Free Software Foundation, either version 3 of the License, or
7 ;;; (at your option) any later version.
8 ;;;
9 ;;; This program is distributed in the hope that it will be useful,
10 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 ;;; GNU General Public License for more details.
13 ;;;
14 ;;; You should have received a copy of the GNU General Public License
15 ;;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
17
18 (define-module (assimp low-level material)
19   #:use-module (assimp low-level)
20   #:use-module (assimp low-level types)
21   #:use-module (system foreign)
22   #:export (parse-aiMaterial
23             parse-aiMaterialProperty
24             ai-material-key
25             aiGetMaterialColor
26             aiGetMaterialFloatArray
27             aiGetMaterialIntegerArray))
28
29
30 (define-struct-parser parse-aiMaterialProperty
31   (mKey aiString-type)
32   (mSemantic unsigned-int)
33   (mIndex unsigned-int)
34   (mDataLength unsigned-int)
35   (mType unsigned-int)
36   (mData '*))
37
38 (define-struct-parser parse-aiMaterial
39   (mProperties '*)
40   (mNumProperties unsigned-int)
41   (mNumAllocated unsigned-int))
42
43
44 (define-enumeration
45   ai-material-key
46   (name '("?mat.name" 0 0))
47   (twosided '("$mat.twosided" 0 0))
48   (shading-model '("$mat.shadingm" 0 0))
49   (enable-wireframe '("$mat.wireframe" 0 0))
50   (blend-func '("$mat.blend" 0 0))
51   (opacity '("$mat.opacity" 0 0))
52   (bumpscaling '("$mat.bumpscaling" 0 0))
53   (shininess '("$mat.shininess" 0 0))
54   (reflectivity '("$mat.reflectivity" 0 0))
55   (shininess-strength '("$mat.shinpercent" 0 0))
56   (refracti '("$mat.refracti" 0 0))
57   (color-diffuse '("$clr.diffuse" 0 0))
58   (color-ambient '("$clr.ambient" 0 0))
59   (color-specular '("$clr.specular" 0 0))
60   (color-emissive '("$clr.emissive" 0 0))
61   (color-transparent '("$clr.transparent" 0 0))
62   (color-reflective '("$clr.reflective" 0 0))
63   (global-background-image '("?bg.global" 0 0)))
64
65
66 (define-assimp-function (aiGetMaterialColor '* '* unsigned-int unsigned-int '*) -> int)
67 (define-assimp-function (aiGetMaterialFloatArray '* '* unsigned-int unsigned-int '* '*) -> int)
68 (define-assimp-function (aiGetMaterialIntegerArray '* '* unsigned-int unsigned-int '* '*) -> int)