--- /dev/null
+/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine
+
+ Copyright (C) 2020 Javier Sancho <jsf@jsancho.org>
+
+ This file is part of guile-irrlicht.
+
+ guile-irrlicht is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 3 of the
+ License, or (at your option) any later version.
+
+ guile-irrlicht is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with guile-irrlicht. If not, see
+ <http://www.gnu.org/licenses/>.
+*/
+
+#include <irrlicht/irrlicht.h>
+#include <libguile.h>
+#include "driver-types.h"
+
+extern "C" {
+
+ irr::video::E_DRIVER_TYPE
+ scm_to_driver_type (SCM driver_type)
+ {
+ char* driverType = scm_to_utf8_stringn (scm_symbol_to_string (driver_type), NULL);
+ if (!strcmp (driverType, "null"))
+ {
+ return irr::video::EDT_NULL;
+ }
+ else if (!strcmp (driverType, "software"))
+ {
+ return irr::video::EDT_SOFTWARE;
+ }
+ else if (!strcmp (driverType, "burnings"))
+ {
+ return irr::video::EDT_BURNINGSVIDEO;
+ }
+ else if (!strcmp (driverType, "direct3d8"))
+ {
+ return irr::video::EDT_DIRECT3D8;
+ }
+ else if (!strcmp (driverType, "direct3d9"))
+ {
+ return irr::video::EDT_DIRECT3D9;
+ }
+ else if (!strcmp (driverType, "opengl"))
+ {
+ return irr::video::EDT_OPENGL;
+ }
+ else
+ {
+ scm_error (scm_arg_type_key, NULL, "Wrong driver type: ~S",
+ scm_list_1 (driver_type), scm_list_1 (driver_type));
+ }
+ }
+
+}