light/modules/renderer/src/blender.cpp

34 lines
809 B
C++
Raw Normal View History

#include <renderer/blender.hpp>
#include <renderer/gl/blender.hpp>
2025-07-05 13:28:41 +03:30
#ifdef LIGHT_PLATFORM_WINDOWS
#include <renderer/dx/blender.hpp>
#include <renderer/dx/sharedcontext.hpp>
2025-07-05 13:28:41 +03:30
#endif
#include <renderer/graphics_context.hpp>
2025-07-05 13:28:41 +03:30
namespace Light {
auto Blender::create(const Ref<SharedContext> & /*sharedContext*/) -> Scope<Blender>
2025-07-05 13:28:41 +03:30
{
switch (GraphicsContext::get_graphics_api())
2025-07-05 13:28:41 +03:30
{
case GraphicsAPI::OpenGL: return create_scope<glBlender>();
2025-07-05 13:28:41 +03:30
case GraphicsAPI::DirectX:
2025-07-06 14:02:50 +03:30
lt_win(return create_scope<dxBlender>(
std::static_pointer_cast<dxSharedContext>(sharedContext)
);)
2025-07-05 13:28:41 +03:30
2025-07-06 14:02:50 +03:30
default
: lt_assert(
false,
"Invalid/unsupported 'GraphicsAPI' {}",
static_cast<uint32_t>(GraphicsContext::get_graphics_api())
);
2025-07-05 13:28:41 +03:30
}
}
} // namespace Light