2022-09-07 09:02:01 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <cstdint>
|
2022-10-22 12:15:25 +00:00
|
|
|
#include <vector>
|
2022-09-07 09:02:01 +00:00
|
|
|
|
2023-02-19 13:55:08 +00:00
|
|
|
// Enums and structs for the graphics abstraction
|
|
|
|
|
2022-10-22 12:15:25 +00:00
|
|
|
namespace engine::gfx {
|
2022-09-07 09:02:01 +00:00
|
|
|
|
2023-02-19 13:55:08 +00:00
|
|
|
enum class MSAALevel {
|
|
|
|
MSAA_OFF,
|
|
|
|
MSAA_2X,
|
|
|
|
MSAA_4X,
|
|
|
|
MSAA_8X,
|
|
|
|
MSAA_16X,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct GraphicsSettings {
|
|
|
|
|
|
|
|
GraphicsSettings()
|
|
|
|
{
|
|
|
|
// sane defaults
|
|
|
|
vsync = false;
|
|
|
|
msaaLevel = MSAALevel::MSAA_OFF;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool vsync;
|
|
|
|
MSAALevel msaaLevel;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2022-09-07 09:02:01 +00:00
|
|
|
enum class ShaderType {
|
|
|
|
VERTEX,
|
|
|
|
FRAGMENT,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum class BufferType {
|
|
|
|
VERTEX,
|
|
|
|
INDEX,
|
2022-10-24 13:30:05 +00:00
|
|
|
UNIFORM,
|
2022-09-07 09:02:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum class Primitive {
|
|
|
|
POINTS,
|
|
|
|
LINES,
|
|
|
|
LINE_STRIP,
|
|
|
|
TRIANGLES,
|
|
|
|
TRIANGLE_STRIP,
|
|
|
|
};
|
|
|
|
|
2022-10-22 12:15:25 +00:00
|
|
|
enum class VertexAttribFormat {
|
2023-01-20 16:30:35 +00:00
|
|
|
FLOAT2,
|
|
|
|
FLOAT3,
|
|
|
|
FLOAT4
|
2022-09-07 09:02:01 +00:00
|
|
|
};
|
|
|
|
|
2022-11-15 13:59:43 +00:00
|
|
|
enum class TextureFilter {
|
|
|
|
LINEAR,
|
|
|
|
NEAREST,
|
|
|
|
};
|
|
|
|
|
2023-01-26 21:17:07 +00:00
|
|
|
enum class MipmapSetting {
|
|
|
|
OFF,
|
|
|
|
NEAREST,
|
|
|
|
LINEAR,
|
|
|
|
};
|
|
|
|
|
2022-10-22 12:15:25 +00:00
|
|
|
struct VertexBufferDesc {
|
|
|
|
uint64_t size;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct VertexAttribDescription {
|
2023-02-18 15:54:31 +00:00
|
|
|
VertexAttribDescription(uint32_t location, VertexAttribFormat format, uint32_t offset) :
|
|
|
|
location(location),
|
|
|
|
format(format),
|
|
|
|
offset(offset) {}
|
2022-10-22 12:15:25 +00:00
|
|
|
uint32_t location;
|
|
|
|
VertexAttribFormat format;
|
|
|
|
uint32_t offset;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct VertexFormat {
|
|
|
|
uint32_t stride;
|
|
|
|
std::vector<VertexAttribDescription> attributeDescriptions;
|
|
|
|
};
|
|
|
|
|
|
|
|
// handles (incomplete types)
|
2022-10-23 23:19:07 +00:00
|
|
|
struct Pipeline;
|
2022-10-24 00:10:48 +00:00
|
|
|
struct Buffer;
|
2022-11-10 14:12:29 +00:00
|
|
|
struct Texture;
|
2022-10-22 12:15:25 +00:00
|
|
|
|
2022-09-07 09:02:01 +00:00
|
|
|
}
|