blob: d0cd4b041493122cde5aad718c97cbcba2f69355 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#include "vertex_array.h"
#include "renderer.h"
#include "platform/opengl/opengl_vertex_array.h"
#include "platform/vulkan/vulkan_vertex_array.h"
namespace Donut
{
uint32_t VertexBufferElement::get_size_of_type(uint32_t type)
{
switch (type)
{
case 0x1406: return 4;
case 0x1405: return 4;
case 0x1401: return 1;
default: return 0;
}
}
Ref<VertexArray> VertexArray::create()
{
switch (Renderer::get_api())
{
case RendererAPI::API::OpenGL:
return create_ref<OpenGLVertexArray>();
case RendererAPI::API::Vulkan:
return create_ref<VulkanVertexArray>();
default:
return nullptr;
}
}
};
|