NoJobEngine 2.0.7
Loading...
Searching...
No Matches
Buffer.cpp
Go to the documentation of this file.
4#include <stdexcept>
5
6namespace NoJob
7{
8 std::shared_ptr<VertexBuffer> VertexBuffer::Create(
9 const float* vertices, std::uint32_t size)
10 {
11 switch (RendererAPI::GetAPI())
12 {
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 {
26 return std::make_shared<OpenGLIndexBuffer>(indices, count);
27 default:
28 throw std::runtime_error("NoJobEngine: unsupported graphics API.");
29 }
30 }
31}
Buffer declarations for the Rendering subsystem.
OpenGLBuffer declarations for the OpenGL Backend subsystem.
RendererAPI declarations for the Rendering subsystem.
static std::shared_ptr< IndexBuffer > Create(const std::uint32_t *indices, std::uint32_t count)
Definition Buffer.cpp:20
static GraphicsAPI GetAPI()
Definition RendererAPI.h:49
static std::shared_ptr< VertexBuffer > Create(const float *vertices, std::uint32_t size)
Definition Buffer.cpp:8