]> git.jsancho.org Git - guile-irrlicht.git/commitdiff
driver-types
authorJavier Sancho <jsf@jsancho.org>
Thu, 7 May 2020 11:23:47 +0000 (13:23 +0200)
committerJavier Sancho <jsf@jsancho.org>
Thu, 7 May 2020 11:23:47 +0000 (13:23 +0200)
src/driver-types.cpp
src/driver-types.h

index 886d40d4f55eee55d2a71315ff991a34b6dfc465..d0fec5065d042bf6e3990f48d045fffa3cd73cf9 100644 (file)
 #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));
-      }
-  }
 
+using namespace 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 video::EDT_NULL;
+    }
+  else if (!strcmp (driverType, "software"))
+    {
+      return video::EDT_SOFTWARE;
+    }
+  else if (!strcmp (driverType, "burnings"))
+    {
+      return video::EDT_BURNINGSVIDEO;
+    }
+  else if (!strcmp (driverType, "direct3d8"))
+    {
+      return video::EDT_DIRECT3D8;
+    }
+  else if (!strcmp (driverType, "direct3d9"))
+    {
+      return video::EDT_DIRECT3D9;
+    }
+  else if (!strcmp (driverType, "opengl"))
+    {
+      return 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));
+    }
 }
index dff3802b513e31a3773d5743b5e74bcc060b30ad..acabf0b29e454eb414d28401790bfbb64ea59718 100644 (file)
 #include <irrlicht/irrlicht.h>
 #include <libguile.h>
 
-extern "C" {
-
-  irr::video::E_DRIVER_TYPE
-  scm_to_driver_type (SCM driver_type);
-
-}
+irr::video::E_DRIVER_TYPE
+scm_to_driver_type (SCM driver_type);
 
 #endif