1 /* c-irrlicht --- C bindings for Irrlicht Engine
3 Copyright (C) 2019 Javier Sancho <jsf@jsancho.org>
5 This file is part of c-irrlicht.
7 c-irrlicht is free software; you can redistribute it and/or modify
8 it under the terms of the GNU Lesser General Public License as
9 published by the Free Software Foundation; either version 3 of the
10 License, or (at your option) any later version.
12 c-irrlicht is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 General Public License for more details.
17 You should have received a copy of the GNU Lesser General Public
18 License along with guile-irrlicht. If not, see
19 <http://www.gnu.org/licenses/>.
22 #ifndef __C_IRR_S_MATERIAL_H_INCLUDED__
23 #define __C_IRR_S_MATERIAL_H_INCLUDED__
29 #include "EMaterialTypes.h"
32 #include "SMaterialLayer.h"
34 #define MATERIAL_MAX_TEXTURES _IRR_MATERIAL_MAX_TEXTURES_
38 irr_video_EBO_NONE = 0,
40 irr_video_EBO_SUBTRACT,
41 irr_video_EBO_REVSUBTRACT,
44 irr_video_EBO_MIN_FACTOR,
45 irr_video_EBO_MAX_FACTOR,
46 irr_video_EBO_MIN_ALPHA,
47 irr_video_EBO_MAX_ALPHA
48 } irr_video_E_BLEND_OPERATION;
52 irr_video_ECFN_NEVER = 0,
53 irr_video_ECFN_LESSEQUAL = 1,
54 irr_video_ECFN_EQUAL = 2,
56 irr_video_ECFN_NOTEQUAL,
57 irr_video_ECFN_GREATEREQUAL,
58 irr_video_ECFN_GREATER,
60 } irr_video_E_COMPARISON_FUNC;
64 irr_video_ECP_NONE = 0,
65 irr_video_ECP_ALPHA = 1,
66 irr_video_ECP_RED = 2,
67 irr_video_ECP_GREEN = 4,
68 irr_video_ECP_BLUE = 8,
69 irr_video_ECP_RGB = 14,
70 irr_video_ECP_ALL = 15
71 } irr_video_E_COLOR_PLANE;
75 irr_video_EAAM_OFF = 0,
76 irr_video_EAAM_SIMPLE = 1,
77 irr_video_EAAM_QUALITY = 3,
78 irr_video_EAAM_LINE_SMOOTH = 4,
79 irr_video_EAAM_POINT_SMOOTH = 8,
80 irr_video_EAAM_FULL_BASIC = 15,
81 irr_video_EAAM_ALPHA_TO_COVERAGE = 16
82 } irr_video_E_ANTI_ALIASING_MODE;
86 irr_video_ECM_NONE = 0,
87 irr_video_ECM_DIFFUSE,
88 irr_video_ECM_AMBIENT,
89 irr_video_ECM_EMISSIVE,
90 irr_video_ECM_SPECULAR,
91 irr_video_ECM_DIFFUSE_AND_AMBIENT
92 } irr_video_E_COLOR_MATERIAL;
96 irr_video_EPO_BACK = 0,
97 irr_video_EPO_FRONT = 1
98 } irr_video_E_POLYGON_OFFSET;
102 irr_video_SMaterialLayer textureLayer[MATERIAL_MAX_TEXTURES];
103 irr_video_E_MATERIAL_TYPE materialType;
104 irr_video_SColor ambientColor;
105 irr_video_SColor diffuseColor;
106 irr_video_SColor emissiveColor;
107 irr_video_SColor specularColor;
109 float_t materialTypeParam;
110 float_t materialTypeParam2;
113 uint8_t antiAliasing;
115 uint8_t colorMaterial:3;
116 irr_video_E_BLEND_OPERATION blendOperation:4;
117 uint8_t polygonOffsetFactor:3;
118 irr_video_E_POLYGON_OFFSET polygonOffsetDirection:1;
121 bool gouraudShading:1;
124 bool backfaceCulling:1;
125 bool frontfaceCulling:1;
127 bool normalizeNormals:1;
129 } irr_video_SMaterial;
131 #define S_MATERIAL_DEFAULT \
133 .materialType = irr_video_EMT_SOLID, \
134 .ambientColor = {255, 255, 255, 255}, \
135 .diffuseColor = {255, 255, 255, 255}, \
136 .emissiveColor = {0, 0, 0, 0}, \
137 .specularColor = {255, 255, 255, 255}, \
139 .materialTypeParam = 0, \
140 .materialTypeParam2 = 0, \
142 .zBuffer = irr_video_ECFN_LESSEQUAL, \
143 .antiAliasing = irr_video_EAAM_SIMPLE, \
144 .colorMask = irr_video_ECP_ALL, \
145 .colorMaterial = irr_video_ECM_DIFFUSE, \
146 .blendOperation = irr_video_EBO_NONE, \
147 .polygonOffsetFactor = 0, \
148 .polygonOffsetDirection = irr_video_EPO_FRONT, \
149 .wireframe = false, \
150 .pointCloud = false, \
151 .gouraudShading = true, \
153 .zWriteEnable = true, \
154 .backfaceCulling = true, \
155 .frontfaceCulling = false, \
156 .fogEnable = false, \
157 .normalizeNormals = false, \