- SCM
- make_material (SCM rest)
- {
- SCM material_type = scm_from_utf8_symbol ("solid");
- SCM ambient_color = scm_list_4 (scm_from_uint32 (255), scm_from_uint32 (255),
- scm_from_uint32 (255), scm_from_uint32 (255));
- SCM diffuse_color = scm_list_4 (scm_from_uint32 (255), scm_from_uint32 (255),
- scm_from_uint32 (255), scm_from_uint32 (255));
- SCM emissive_color = scm_list_4 (scm_from_uint32 (255), scm_from_uint32 (255),
- scm_from_uint32 (255), scm_from_uint32 (255));
- SCM specular_color = scm_list_4 (scm_from_uint32 (255), scm_from_uint32 (255),
- scm_from_uint32 (255), scm_from_uint32 (255));
- SCM shininess = scm_from_double (0.0f);
- SCM material_type_param = scm_from_double (0.0f);
- SCM material_type_param_2 = scm_from_double (0.0f);
- SCM thickness = scm_from_double (1.0f);
- SCM z_buffer = scm_from_utf8_symbol ("less-equal");
- SCM anti_aliasing = scm_from_utf8_symbol ("simple");
- SCM color_mask = scm_from_utf8_symbol ("all");
- SCM color_material = scm_from_utf8_symbol ("diffuse");
- SCM blend_operation = scm_from_utf8_symbol ("none");
- SCM polygon_offset_factor = scm_from_uint8 (0);
- SCM polygon_offset_direction = scm_from_utf8_symbol ("front");
- SCM wireframe = scm_from_bool (0);
- SCM point_cloud = scm_from_bool (0);
- SCM gouraud_shading = scm_from_bool (1);
- SCM lighting = scm_from_bool (1);
- SCM z_write_enable = scm_from_bool (1);
- SCM backface_culling = scm_from_bool (1);
- SCM frontface_culling = scm_from_bool (0);
- SCM fog_enable = scm_from_bool (0);
- SCM normalize_normals = scm_from_bool (0);
- SCM use_mip_maps = scm_from_bool (1);
-
- scm_c_bind_keyword_arguments
- ("make-material", rest, (scm_t_keyword_arguments_flags)0,
- scm_from_utf8_keyword ("material-type"), &material_type,
- scm_from_utf8_keyword ("ambient-color"), &ambient_color,
- scm_from_utf8_keyword ("diffuse-color"), &diffuse_color,
- scm_from_utf8_keyword ("emissive-color"), &emissive_color,
- scm_from_utf8_keyword ("specular-color"), &specular_color,
- scm_from_utf8_keyword ("shininess"), &shininess,
- scm_from_utf8_keyword ("material-type-param"), &material_type_param,
- scm_from_utf8_keyword ("material-type-param-2"), &material_type_param_2,
- scm_from_utf8_keyword ("thickness"), &thickness,
- scm_from_utf8_keyword ("z-buffer"), &z_buffer,
- scm_from_utf8_keyword ("anti-aliasing"), &anti_aliasing,
- scm_from_utf8_keyword ("color-mask"), &color_mask,
- scm_from_utf8_keyword ("color-material"), &color_material,
- scm_from_utf8_keyword ("blend-operation"), &blend_operation,
- scm_from_utf8_keyword ("polygon-offset-factor"), &polygon_offset_factor,
- scm_from_utf8_keyword ("polygon-offset-direction"), &polygon_offset_direction,
- scm_from_utf8_keyword ("wireframe"), &wireframe,
- scm_from_utf8_keyword ("point-cloud"), &point_cloud,
- scm_from_utf8_keyword ("gouraud-shading"), &gouraud_shading,
- scm_from_utf8_keyword ("lighting"), &lighting,
- scm_from_utf8_keyword ("z-write-enable"), &z_write_enable,
- scm_from_utf8_keyword ("backface-culling"), &backface_culling,
- scm_from_utf8_keyword ("frontface-culling"), &frontface_culling,
- scm_from_utf8_keyword ("fog-enable"), &fog_enable,
- scm_from_utf8_keyword ("normalize-normals"), &normalize_normals,
- scm_from_utf8_keyword ("use-mip-maps"), &use_mip_maps,
- SCM_UNDEFINED);
-
- irr::video::SMaterial* material = new irr::video::SMaterial ();
- material->MaterialType = scm_to_material_type(material_type);
- material->AmbientColor = scm_to_color (ambient_color);
- material->DiffuseColor = scm_to_color (diffuse_color);
- material->EmissiveColor = scm_to_color (emissive_color);
- material->SpecularColor = scm_to_color (specular_color);
- material->Shininess = scm_to_double (shininess);
- material->MaterialTypeParam = scm_to_double (material_type_param);
- material->MaterialTypeParam2 = scm_to_double (material_type_param_2);
- material->Thickness = scm_to_double (thickness);
- material->ZBuffer = scm_to_comparison_func (z_buffer);
- material->AntiAliasing = scm_to_anti_aliasing_mode (anti_aliasing);
- material->ColorMask = scm_to_color_plane (color_mask);
- material->ColorMaterial = scm_to_color_material (color_material);
- material->BlendOperation = scm_to_blend_operation (blend_operation);
- material->PolygonOffsetFactor = scm_to_uint8 (polygon_offset_factor);
- material->PolygonOffsetDirection = scm_to_polygon_offset (polygon_offset_direction);
- material->Wireframe = scm_to_bool (wireframe);
- material->PointCloud = scm_to_bool (point_cloud);
- material->GouraudShading = scm_to_bool (gouraud_shading);
- material->Lighting = scm_to_bool (lighting);
- material->ZWriteEnable = scm_to_bool (z_write_enable);
- material->BackfaceCulling = scm_to_bool (backface_culling);
- material->FrontfaceCulling = scm_to_bool (frontface_culling);
- material->FogEnable = scm_to_bool (fog_enable);
- material->NormalizeNormals = scm_to_bool (normalize_normals);
- material->UseMipMaps = scm_to_bool (use_mip_maps);
- return wrap_material (material);
- }
+ video::SMaterial* material = new video::SMaterial ();
+ material->MaterialType = scm_to_material_type(material_type);
+ material->AmbientColor = scm_to_color (ambient_color);
+ material->DiffuseColor = scm_to_color (diffuse_color);
+ material->EmissiveColor = scm_to_color (emissive_color);
+ material->SpecularColor = scm_to_color (specular_color);
+ material->Shininess = scm_to_double (shininess);
+ material->MaterialTypeParam = scm_to_double (material_type_param);
+ material->MaterialTypeParam2 = scm_to_double (material_type_param_2);
+ material->Thickness = scm_to_double (thickness);
+ material->ZBuffer = scm_to_comparison_func (z_buffer);
+ material->AntiAliasing = scm_to_anti_aliasing_mode (anti_aliasing);
+ material->ColorMask = scm_to_color_plane (color_mask);
+ material->ColorMaterial = scm_to_color_material (color_material);
+ material->BlendOperation = scm_to_blend_operation (blend_operation);
+ material->PolygonOffsetFactor = scm_to_uint8 (polygon_offset_factor);
+ material->PolygonOffsetDirection = scm_to_polygon_offset (polygon_offset_direction);
+ material->Wireframe = scm_to_bool (wireframe);
+ material->PointCloud = scm_to_bool (point_cloud);
+ material->GouraudShading = scm_to_bool (gouraud_shading);
+ material->Lighting = scm_to_bool (lighting);
+ material->ZWriteEnable = scm_to_bool (z_write_enable);
+ material->BackfaceCulling = scm_to_bool (backface_culling);
+ material->FrontfaceCulling = scm_to_bool (frontface_culling);
+ material->FogEnable = scm_to_bool (fog_enable);
+ material->NormalizeNormals = scm_to_bool (normalize_normals);
+ material->UseMipMaps = scm_to_bool (use_mip_maps);
+ return scm_from_pointer ((void*) material, NULL);
+}