-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTextureSubPluginAPI.cpp
More file actions
37 lines (30 loc) · 1.06 KB
/
TextureSubPluginAPI.cpp
File metadata and controls
37 lines (30 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "TextureSubPluginAPI.hpp"
#include "IUnityGraphics.h"
#include "PlatformBase.hpp"
IUnityInterfaces* g_UnityInterfaces = NULL;
IUnityGraphics* g_Graphics = NULL;
IUnityLog* g_Log = NULL;
TextureSubPluginAPI* CreateTextureSubPluginAPI(UnityGfxRenderer apiType) {
#if SUPPORT_D3D11
if (apiType == kUnityGfxRendererD3D11) {
extern TextureSubPluginAPI* CreateTextureSubPluginAPI_D3D11();
return CreateTextureSubPluginAPI_D3D11();
}
#endif // if SUPPORT_D3D11
#if SUPPORT_OPENGL_UNIFIED
if (apiType == kUnityGfxRendererOpenGLCore ||
apiType == kUnityGfxRendererOpenGLES30) {
extern TextureSubPluginAPI* CreateTextureSubPluginAPI_OpenGLCoreES(
UnityGfxRenderer apiType);
return CreateTextureSubPluginAPI_OpenGLCoreES(apiType);
}
#endif // if SUPPORT_OPENGL_UNIFIED
#if SUPPORT_VULKAN
if (apiType == kUnityGfxRendererVulkan) {
extern TextureSubPluginAPI* CreateTextureSubPluginAPI_Vulkan();
return CreateTextureSubPluginAPI_Vulkan();
}
#endif // if SUPPORT_VULKAN
// Unknown or unsupported graphics API
return NULL;
}