NoJobEngine
2.0.7
Toggle main menu visibility
Loading...
Searching...
No Matches
Buffer.cpp
Go to the documentation of this file.
1
#include "
Engine/Renderer/Buffer.h
"
2
#include "
Engine/Renderer/RendererAPI.h
"
3
#include "
Engine/Platform/OpenGL/OpenGLBuffer.h
"
4
#include <stdexcept>
5
6
namespace
NoJob
7
{
8
std::shared_ptr<VertexBuffer>
VertexBuffer::Create
(
9
const
float
* vertices, std::uint32_t size)
10
{
11
switch
(
RendererAPI::GetAPI
())
12
{
13
case
GraphicsAPI::OpenGL
:
14
return
std::make_shared<OpenGLVertexBuffer>(vertices, size);
15
default
:
16
throw
std::runtime_error(
"NoJobEngine: unsupported graphics API."
);
17
}
18
}
19
20
std::shared_ptr<IndexBuffer>
IndexBuffer::Create
(
21
const
std::uint32_t* indices, std::uint32_t count)
22
{
23
switch
(
RendererAPI::GetAPI
())
24
{
25
case
GraphicsAPI::OpenGL
:
26
return
std::make_shared<OpenGLIndexBuffer>(indices, count);
27
default
:
28
throw
std::runtime_error(
"NoJobEngine: unsupported graphics API."
);
29
}
30
}
31
}
Buffer.h
Buffer declarations for the Rendering subsystem.
OpenGLBuffer.h
OpenGLBuffer declarations for the OpenGL Backend subsystem.
RendererAPI.h
RendererAPI declarations for the Rendering subsystem.
NoJob::IndexBuffer::Create
static std::shared_ptr< IndexBuffer > Create(const std::uint32_t *indices, std::uint32_t count)
Definition
Buffer.cpp:20
NoJob::RendererAPI::GetAPI
static GraphicsAPI GetAPI()
Definition
RendererAPI.h:49
NoJob::VertexBuffer::Create
static std::shared_ptr< VertexBuffer > Create(const float *vertices, std::uint32_t size)
Definition
Buffer.cpp:8
NoJob
Definition
BTActionNode.h:13
NoJob::GraphicsAPI::OpenGL
@ OpenGL
Definition
RendererAPI.h:16
Engine
Renderer
Buffer.cpp
Generated by
1.18.0