Add IContext and IDevice classes with Vulkan backend
This commit is contained in:
28
engine/src/graphics/context.cpp
Normal file
28
engine/src/graphics/context.cpp
Normal file
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Copyright (c) 2025, Jayden Grubb <contact@jaydengrubb.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <nova/graphics/context.hpp>
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
#if defined(NOVA_BACKEND_VULKAN)
|
||||
#include "backends/vulkan/context.hpp"
|
||||
#endif
|
||||
|
||||
namespace nova::gfx {
|
||||
|
||||
std::unique_ptr<IContext> IContext::create(API p_api) {
|
||||
switch (p_api) {
|
||||
#if defined(NOVA_BACKEND_VULKAN)
|
||||
case API::VULKAN:
|
||||
return std::make_unique<VulkanContext>();
|
||||
#endif
|
||||
default:
|
||||
throw std::runtime_error("Unsupported graphics API");
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace nova::gfx
|
||||
Reference in New Issue
Block a user