summaryrefslogtreecommitdiffstats
path: root/unityplugin/GhostCubePlugin/PluginSource
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2019-01-10 04:04:04 +0000
committerEgor Yusov <egor.yusov@gmail.com>2019-01-10 04:04:04 +0000
commit58095c50964d86552d5ef0da8c3b53ee250ca0c6 (patch)
tree8ef0157ae63b0673f259288c0efbd84de8a8a251 /unityplugin/GhostCubePlugin/PluginSource
parentAdded cmake options to disable specific back-ends and glslang (diff)
downloadDiligentEngine-58095c50964d86552d5ef0da8c3b53ee250ca0c6.tar.gz
DiligentEngine-58095c50964d86552d5ef0da8c3b53ee250ca0c6.zip
Updated unity plugin source
Diffstat (limited to 'unityplugin/GhostCubePlugin/PluginSource')
-rw-r--r--unityplugin/GhostCubePlugin/PluginSource/src/PlatformBase.h15
-rw-r--r--unityplugin/GhostCubePlugin/PluginSource/src/RenderingPlugin.cpp18
2 files changed, 16 insertions, 17 deletions
diff --git a/unityplugin/GhostCubePlugin/PluginSource/src/PlatformBase.h b/unityplugin/GhostCubePlugin/PluginSource/src/PlatformBase.h
index bc4c6e0..ce25db7 100644
--- a/unityplugin/GhostCubePlugin/PluginSource/src/PlatformBase.h
+++ b/unityplugin/GhostCubePlugin/PluginSource/src/PlatformBase.h
@@ -41,18 +41,17 @@
#elif UNITY_WIN
#define SUPPORT_D3D11 D3D11_SUPPORTED
#define SUPPORT_D3D12 D3D12_SUPPORTED
- #define SUPPORT_OPENGL_UNIFIED 1
- #define SUPPORT_OPENGL_CORE 1
+ #define SUPPORT_OPENGL_UNIFIED GL_SUPPORTED
+ #define SUPPORT_OPENGL_CORE GL_SUPPORTED
#elif UNITY_IPHONE || UNITY_ANDROID || UNITY_WEBGL
- #define SUPPORT_OPENGL_UNIFIED 1
- #define SUPPORT_OPENGL_ES 1
+ #define SUPPORT_OPENGL_UNIFIED GLES_SUPPORTED
+ #define SUPPORT_OPENGL_ES GLES_SUPPORTED
#elif UNITY_OSX || UNITY_LINUX
#define SUPPORT_OPENGL_LEGACY 1
- #define SUPPORT_OPENGL_UNIFIED 1
- #define SUPPORT_OPENGL_CORE 1
+ #define SUPPORT_OPENGL_UNIFIED GL_SUPPORTED
+ #define SUPPORT_OPENGL_CORE GL_SUPPORTED
#endif
#if UNITY_IPHONE || UNITY_OSX
- #define SUPPORT_METAL 1
+ #define SUPPORT_METAL METAL_SUPPORTED
#endif
-
diff --git a/unityplugin/GhostCubePlugin/PluginSource/src/RenderingPlugin.cpp b/unityplugin/GhostCubePlugin/PluginSource/src/RenderingPlugin.cpp
index 0e472ea..e6ef47c 100644
--- a/unityplugin/GhostCubePlugin/PluginSource/src/RenderingPlugin.cpp
+++ b/unityplugin/GhostCubePlugin/PluginSource/src/RenderingPlugin.cpp
@@ -98,31 +98,31 @@ extern "C" void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API RegisterPlugin()
void CreateRenderAPI(UnityGfxRenderer apiType)
{
-# if D3D11_SUPPORTED
+# if SUPPORT_D3D11
if (apiType == kUnityGfxRendererD3D11)
{
extern RenderAPI* CreateRenderAPI_D3D11();
s_CurrentAPI.reset( CreateRenderAPI_D3D11() );
}
- # endif // if SUPPORT_D3D11
+# endif // if SUPPORT_D3D11
# if SUPPORT_D3D9
if (apiType == kUnityGfxRendererD3D9)
{
- UNSUPPORTED("D3D9 not supported")
+ UNSUPPORTED("D3D9 is not supported")
}
# endif // if SUPPORT_D3D9
-# if D3D12_SUPPORTED
+# if SUPPORT_D3D12
if (apiType == kUnityGfxRendererD3D12)
{
extern RenderAPI* CreateRenderAPI_D3D12();
s_CurrentAPI.reset( CreateRenderAPI_D3D12() );
}
-# endif // if SUPPORT_D3D9
+# endif // if SUPPORT_D3D12
-# if GL_SUPPORTED || GLES_SUPPORTED
+# if SUPPORT_OPENGL_UNIFIED
if (apiType == kUnityGfxRendererOpenGLCore || apiType == kUnityGfxRendererOpenGLES30)
{
extern RenderAPI* CreateRenderAPI_OpenGLCoreES(UnityGfxRenderer apiType);
@@ -133,14 +133,14 @@ void CreateRenderAPI(UnityGfxRenderer apiType)
# if SUPPORT_OPENGL_LEGACY
if (apiType == kUnityGfxRendererOpenGL)
{
- UNSUPPORTED("Legacy Opengl not supported");
+ UNSUPPORTED("Legacy Opengl is not supported");
}
# endif // if SUPPORT_OPENGL_LEGACY
-# if METAL_SUPPORTED
+# if SUPPORT_METAL
if (apiType == kUnityGfxRendererMetal)
{
- UNSUPPORTED("Metal not supported");
+ UNSUPPORTED("Metal is not supported");
}
# endif // if SUPPORT_METAL
}