فهرست منبع

Don't define backends if SDL_GPU_DISABLED is set

Sam Lantinga 7 ماه پیش
والد
کامیت
bc9780299c
1فایلهای تغییر یافته به همراه6 افزوده شده و 0 حذف شده
  1. 6 0
      src/gpu/SDL_gpu.c

+ 6 - 0
src/gpu/SDL_gpu.c

@@ -150,6 +150,7 @@
 
 // Drivers
 
+#ifndef SDL_GPU_DISABLED
 static const SDL_GPUBootstrap *backends[] = {
 #ifdef SDL_GPU_METAL
     &MetalDriver,
@@ -165,6 +166,7 @@ static const SDL_GPUBootstrap *backends[] = {
 #endif
     NULL
 };
+#endif // !SDL_GPU_DISABLED
 
 // Internal Utility Functions
 
@@ -547,7 +549,11 @@ void SDL_DestroyGPUDevice(SDL_GPUDevice *device)
 
 int SDL_GetNumGPUDrivers(void)
 {
+#ifndef SDL_GPU_DISABLED
     return SDL_arraysize(backends) - 1;
+#else
+    return 0;
+#endif
 }
 
 const char * SDL_GetGPUDriver(int index)