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