Skip to content

Commit 10246b4

Browse files
committed
Vulkan commit tweaks (2)
1 parent 7e70475 commit 10246b4

File tree

4 files changed

+10
-14
lines changed

4 files changed

+10
-14
lines changed

lib/ivis_opengl/gfx_api.h

+4
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,17 @@ namespace gfx_api
3535
{
3636
// Must be implemented by backend (ex. SDL)
3737
class backend_OpenGL_Impl; // see: gfx_api_gl.h
38+
#if defined(WZ_VULKAN_ENABLED)
3839
class backend_Vulkan_Impl; // see: gfx_api_vk.h
40+
#endif
3941
class backend_Impl_Factory
4042
{
4143
public:
4244
virtual ~backend_Impl_Factory() {};
4345
virtual std::unique_ptr<backend_OpenGL_Impl> createOpenGLBackendImpl() const = 0;
46+
#if defined(WZ_VULKAN_ENABLED)
4447
virtual std::unique_ptr<backend_Vulkan_Impl> createVulkanBackendImpl() const = 0;
48+
#endif
4549
};
4650
//
4751
}

lib/ivis_opengl/gfx_api_vk.h

-10
Original file line numberDiff line numberDiff line change
@@ -467,14 +467,4 @@ struct VkRoot final : gfx_api::context
467467
virtual void shutdown() override;
468468
};
469469

470-
#else // !defined(WZ_VULKAN_ENABLED)
471-
472-
namespace gfx_api
473-
{
474-
class backend_Vulkan_Impl
475-
{
476-
// empty - Vulkan is disabled
477-
};
478-
}
479-
480470
#endif // defined(WZ_VULKAN_ENABLED)

lib/sdl/gfx_api_sdl.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ std::unique_ptr<gfx_api::backend_OpenGL_Impl> SDL_gfx_api_Impl_Factory::createOp
3333
return std::unique_ptr<gfx_api::backend_OpenGL_Impl>(new sdl_OpenGL_Impl(window));
3434
}
3535

36+
#if defined(WZ_VULKAN_ENABLED)
3637
std::unique_ptr<gfx_api::backend_Vulkan_Impl> SDL_gfx_api_Impl_Factory::createVulkanBackendImpl() const
3738
{
38-
#if defined(WZ_VULKAN_ENABLED) && defined(HAVE_SDL_VULKAN_H)
39+
#if defined(HAVE_SDL_VULKAN_H)
3940
return std::unique_ptr<gfx_api::backend_Vulkan_Impl>(new sdl_Vulkan_Impl(window));
40-
#else
41-
#if !defined(HAVE_SDL_VULKAN_H)
41+
#else // !defined(HAVE_SDL_VULKAN_H)
4242
SDL_version compiled_version;
4343
SDL_VERSION(&compiled_version);
4444
debug(LOG_ERROR, "The version of SDL used for compilation (%u.%u.%u) did not have the SDL_vulkan.h header", (unsigned int)compiled_version.major, (unsigned int)compiled_version.minor, (unsigned int)compiled_version.patch);
45-
#endif
4645
return std::unique_ptr<gfx_api::backend_Vulkan_Impl>();
4746
#endif
4847
}
48+
#endif

lib/sdl/gfx_api_sdl.h

+2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ class SDL_gfx_api_Impl_Factory final : public gfx_api::backend_Impl_Factory
2626
SDL_gfx_api_Impl_Factory(SDL_Window* window);
2727

2828
virtual std::unique_ptr<gfx_api::backend_OpenGL_Impl> createOpenGLBackendImpl() const override;
29+
#if defined(WZ_VULKAN_ENABLED)
2930
virtual std::unique_ptr<gfx_api::backend_Vulkan_Impl> createVulkanBackendImpl() const override;
31+
#endif
3032

3133
private:
3234
SDL_Window* window;

0 commit comments

Comments
 (0)