CoriEngine
Loading...
Searching...
No Matches
CoriGraphicsAPI.cpp
Go to the documentation of this file.
1#include "CoriGraphicsAPI.hpp"
4
5namespace Cori {
6 namespace Graphics {
7 std::unique_ptr<CoriGraphicsAPI> CoriGraphicsAPI::Create() {
10 {
11 auto api = std::make_unique<Internal::OpenGLGraphicsAPI>();
12 CORI_CORE_ASSERT(api, "Failed to create Texture2D for API: {}. Check registrations and API validity.", APIEnumToName(Core::Window::GetCurrentAPI()));
13 return api;
14 break;
15 }
17 {
18 CORI_CORE_ASSERT(false, "Unsupported Graphics API.");
19 }
21 {
22 break;
23 }
24 }
25
26 return nullptr;
27 }
28 }
29}
#define CORI_CORE_ASSERT(x,...)
Definition Logger.hpp:1029
static Graphics::GraphicsAPIs GetCurrentAPI()
Returns the graphical API used by this window.
Definition Window.hpp:63
static std::unique_ptr< CoriGraphicsAPI > Create()
Almost everything connected to graphics is in this namespace.
Definition Window.hpp:7
@ Vulkan
I want to support vulkan, BUT later-later.
@ None
Invalid enumerator.
@ OpenGL
The only one available for now.
static const char * APIEnumToName(const GraphicsAPIs api)
Global engine namespace.