light/modules/renderer/public/graphics_context.hpp
light7734 cd886aa8c9
Some checks reported errors
continuous-integration/drone/push Build was killed
refactor: flatten directory structure
2025-07-20 04:46:15 +03:30

57 lines
861 B
C++

#pragma once
struct GLFWwindow;
namespace lt {
class SharedContext;
class WindowResizedEvent;
enum class GraphicsAPI
{
Default = 0,
OpenGL,
DirectX,
Vulkan,
Metal
};
class GraphicsContext
{
public:
static auto create(
GraphicsAPI api,
GLFWwindow *window_handle
) -> Scope<GraphicsContext>;
GraphicsContext(const GraphicsContext &) = delete;
GraphicsContext &operator=(const GraphicsContext &) = delete;
virtual ~GraphicsContext();
virtual void log_debug_data() = 0;
static GraphicsAPI get_graphics_api()
{
return s_context->m_graphics_api;
}
static Ref<SharedContext> get_shared_context()
{
return s_context->m_shared_context;
}
protected:
GraphicsContext() = default;
GraphicsAPI m_graphics_api;
Ref<SharedContext> m_shared_context = nullptr;
private:
static GraphicsContext *s_context;
};
} // namespace lt