From 58095c50964d86552d5ef0da8c3b53ee250ca0c6 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Wed, 9 Jan 2019 20:04:04 -0800 Subject: Updated unity plugin source --- .../GhostCubePlugin/PluginSource/src/PlatformBase.h | 15 +++++++-------- .../PluginSource/src/RenderingPlugin.cpp | 18 +++++++++--------- 2 files changed, 16 insertions(+), 17 deletions(-) (limited to 'unityplugin/GhostCubePlugin/PluginSource') 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 } -- cgit v1.2.3