+}
+
+
+video::E_ANTI_ALIASING_MODE
+scm_to_anti_aliasing_mode (SCM anti_aliasing_mode)
+{
+ char* mode = scm_to_utf8_stringn (scm_symbol_to_string (anti_aliasing_mode), NULL);
+ if (!strcmp (mode, "off"))
+ {
+ return video::EAAM_OFF;
+ }
+ else if (!strcmp (mode, "simple"))
+ {
+ return video::EAAM_SIMPLE;
+ }
+ else if (!strcmp (mode, "quality"))
+ {
+ return video::EAAM_QUALITY;
+ }
+ else if (!strcmp (mode, "line-smooth"))
+ {
+ return video::EAAM_LINE_SMOOTH;
+ }
+ else if (!strcmp (mode, "point-smooth"))
+ {
+ return video::EAAM_POINT_SMOOTH;
+ }
+ else if (!strcmp (mode, "full-basic"))
+ {
+ return video::EAAM_FULL_BASIC;
+ }
+ else if (!strcmp (mode, "alpha-to-coverage"))
+ {
+ return video::EAAM_ALPHA_TO_COVERAGE;
+ }
+ else
+ {
+ scm_error (scm_arg_type_key, NULL, "Wrong anti aliasing mode: ~S",
+ scm_list_1 (anti_aliasing_mode), scm_list_1 (anti_aliasing_mode));
+ }
+}
+
+
+video::E_BLEND_OPERATION
+scm_to_blend_operation (SCM blend_operation)
+{
+ char* operation = scm_to_utf8_stringn (scm_symbol_to_string (blend_operation), NULL);
+ if (!strcmp (operation, "none"))
+ {
+ return video::EBO_NONE;
+ }
+ else if (!strcmp (operation, "add"))
+ {
+ return video::EBO_ADD;
+ }
+ else if (!strcmp (operation, "subtract"))
+ {
+ return video::EBO_SUBTRACT;
+ }
+ else if (!strcmp (operation, "rev-subtract"))
+ {
+ return video::EBO_REVSUBTRACT;
+ }
+ else if (!strcmp (operation, "min"))
+ {
+ return video::EBO_MIN;
+ }
+ else if (!strcmp (operation, "max"))
+ {
+ return video::EBO_MAX;
+ }
+ else if (!strcmp (operation, "min-factor"))
+ {
+ return video::EBO_MIN_FACTOR;
+ }
+ else if (!strcmp (operation, "max-factor"))
+ {
+ return video::EBO_MAX_FACTOR;
+ }
+ else if (!strcmp (operation, "min-alpha"))
+ {
+ return video::EBO_MIN_ALPHA;
+ }
+ else if (!strcmp (operation, "max-alpha"))
+ {
+ return video::EBO_MAX_ALPHA;
+ }
+ else
+ {
+ scm_error (scm_arg_type_key, NULL, "Wrong blend operation: ~S",
+ scm_list_1 (blend_operation), scm_list_1 (blend_operation));
+ }
+}
+
+
+video::E_COLOR_MATERIAL
+scm_to_color_material (SCM color_material)
+{
+ char* material = scm_to_utf8_stringn (scm_symbol_to_string (color_material), NULL);
+ if (!strcmp (material, "none"))
+ {
+ return video::ECM_NONE;
+ }
+ else if (!strcmp (material, "diffuse"))
+ {
+ return video::ECM_DIFFUSE;
+ }
+ else if (!strcmp (material, "ambient"))
+ {
+ return video::ECM_AMBIENT;
+ }
+ else if (!strcmp (material, "emissive"))
+ {
+ return video::ECM_EMISSIVE;
+ }
+ else if (!strcmp (material, "specular"))
+ {
+ return video::ECM_SPECULAR;
+ }
+ else if (!strcmp (material, "diffuse-and-ambient"))
+ {
+ return video::ECM_DIFFUSE_AND_AMBIENT;
+ }
+ else
+ {
+ scm_error (scm_arg_type_key, NULL, "Wrong color material: ~S",
+ scm_list_1 (color_material), scm_list_1 (color_material));
+ }
+}
+
+
+video::E_COLOR_PLANE
+scm_to_color_plane (SCM color_plane)
+{
+ char* plane = scm_to_utf8_stringn (scm_symbol_to_string (color_plane), NULL);
+ if (!strcmp (plane, "none"))
+ {
+ return video::ECP_NONE;
+ }
+ else if (!strcmp (plane, "alpha"))
+ {
+ return video::ECP_ALPHA;
+ }
+ else if (!strcmp (plane, "red"))
+ {
+ return video::ECP_RED;
+ }
+ else if (!strcmp (plane, "green"))
+ {
+ return video::ECP_GREEN;
+ }
+ else if (!strcmp (plane, "blue"))
+ {
+ return video::ECP_BLUE;
+ }
+ else if (!strcmp (plane, "rgb"))
+ {
+ return video::ECP_RGB;
+ }
+ else if (!strcmp (plane, "all"))
+ {
+ return video::ECP_ALL;
+ }
+ else
+ {
+ scm_error (scm_arg_type_key, NULL, "Wrong color plane: ~S",
+ scm_list_1 (color_plane), scm_list_1 (color_plane));
+ }
+}
+
+
+video::E_COMPARISON_FUNC
+scm_to_comparison_func (SCM comparison_func)
+{
+ char* func = scm_to_utf8_stringn (scm_symbol_to_string (comparison_func), NULL);
+ if (!strcmp (func, "never"))
+ {
+ return video::ECFN_NEVER;
+ }
+ else if (!strcmp (func, "less-equal"))
+ {
+ return video::ECFN_LESSEQUAL;
+ }
+ else if (!strcmp (func, "equal"))
+ {
+ return video::ECFN_EQUAL;
+ }
+ else if (!strcmp (func, "less"))
+ {
+ return video::ECFN_LESS;
+ }
+ else if (!strcmp (func, "not-equal"))
+ {
+ return video::ECFN_NOTEQUAL;
+ }
+ else if (!strcmp (func, "greater-equal"))
+ {
+ return video::ECFN_GREATEREQUAL;
+ }
+ else if (!strcmp (func, "greater"))
+ {
+ return video::ECFN_GREATER;
+ }
+ else if (!strcmp (func, "always"))
+ {
+ return video::ECFN_ALWAYS;
+ }
+ else
+ {
+ scm_error (scm_arg_type_key, NULL, "Wrong comparison func: ~S",
+ scm_list_1 (comparison_func), scm_list_1 (comparison_func));
+ }
+}