1 /* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine
3 Copyright (C) 2020 Javier Sancho <jsf@jsancho.org>
5 This file is part of guile-irrlicht.
7 guile-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 guile-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 #include <irrlicht/irrlicht.h>
29 video::E_MATERIAL_FLAG
30 scm_to_material_flag (SCM material_flag)
32 char* flag = scm_to_utf8_stringn (scm_symbol_to_string (material_flag), NULL);
33 if (!strcmp (flag, "wireframe"))
35 return video::EMF_WIREFRAME;
37 else if (!strcmp (flag, "pointcloud"))
39 return video::EMF_POINTCLOUD;
41 else if (!strcmp (flag, "gouraud-shading"))
43 return video::EMF_GOURAUD_SHADING;
45 else if (!strcmp (flag, "lighting"))
47 return video::EMF_LIGHTING;
49 else if (!strcmp (flag, "zbuffer"))
51 return video::EMF_ZBUFFER;
53 else if (!strcmp (flag, "zwrite-enable"))
55 return video::EMF_ZWRITE_ENABLE;
57 else if (!strcmp (flag, "back-face-culling"))
59 return video::EMF_BACK_FACE_CULLING;
61 else if (!strcmp (flag, "front-face-culling"))
63 return video::EMF_FRONT_FACE_CULLING;
65 else if (!strcmp (flag, "bilinear-filter"))
67 return video::EMF_BILINEAR_FILTER;
69 else if (!strcmp (flag, "trilinear-filter"))
71 return video::EMF_TRILINEAR_FILTER;
73 else if (!strcmp (flag, "anisotropic-filter"))
75 return video::EMF_ANISOTROPIC_FILTER;
77 else if (!strcmp (flag, "fog-enable"))
79 return video::EMF_FOG_ENABLE;
81 else if (!strcmp (flag, "normalize-normals"))
83 return video::EMF_NORMALIZE_NORMALS;
85 else if (!strcmp (flag, "texture-wrap"))
87 return video::EMF_TEXTURE_WRAP;
89 else if (!strcmp (flag, "anti-aliasing"))
91 return video::EMF_ANTI_ALIASING;
93 else if (!strcmp (flag, "color-mask"))
95 return video::EMF_COLOR_MASK;
97 else if (!strcmp (flag, "color-material"))
99 return video::EMF_COLOR_MATERIAL;
101 else if (!strcmp (flag, "use-mip-maps"))
103 return video::EMF_USE_MIP_MAPS;
105 else if (!strcmp (flag, "blend-operation"))
107 return video::EMF_BLEND_OPERATION;
109 else if (!strcmp (flag, "polygon-offset"))
111 return video::EMF_POLYGON_OFFSET;
115 scm_error (scm_arg_type_key, NULL, "Wrong material flag: ~S",
116 scm_list_1 (material_flag), scm_list_1 (material_flag));