light/modules/engine/src/graphics/blender.cpp

33 lines
810 B
C++
Raw Normal View History

2025-07-05 13:28:41 +03:30
#include <engine/graphics/blender.hpp>
#include <engine/platform/graphics/opengl/blender.hpp>
#ifdef LIGHT_PLATFORM_WINDOWS
#include <engine/platform/graphics/directx/blender.hpp>
#include <engine/platform/graphics/directx/sharedcontext.hpp>
#endif
#include <engine/graphics/graphics_context.hpp>
namespace Light {
Scope<Blender> Blender::create(Ref<SharedContext> sharedContext)
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:
lt_win(return create_scope<dxBlender>(std::static_pointer_cast<dxSharedContext>(sharedContext
2025-07-05 13:28:41 +03:30
));)
default:
lt_assert(
2025-07-05 13:28:41 +03:30
false,
"Invalid/unsupported 'GraphicsAPI' {}",
static_cast<uint32_t>(GraphicsContext::get_graphics_api())
2025-07-05 13:28:41 +03:30
);
}
}
} // namespace Light