9#ifndef AVARA3D_RENDER_BACKEND_OPENGL_GLTYPES_H
10#define AVARA3D_RENDER_BACKEND_OPENGL_GLTYPES_H
17 using enum_t = std::uint32_t;
18 using uint_t = std::uint32_t;
19 using int_t = std::int32_t;
20 using sizei_t = std::int32_t;
21 using boolean_t = std::uint8_t;
22 using bitfield_t = std::uint32_t;
24 using sizeiptr_t = std::ptrdiff_t;
25 using intptr_t = std::ptrdiff_t;
28 using float_t = float;
29 using double_t = double;
31 using int64_t = std::int64_t;
32 using uint64_t = std::uint64_t;
36 constexpr enum_t false_ = 0u;
37 constexpr enum_t true_ = 1u;
39 constexpr enum_t unsigned_byte = 0x1401u;
40 constexpr enum_t unsigned_short = 0x1403u;
41 constexpr enum_t unsigned_int = 0x1405u;
42 constexpr enum_t float32 = 0x1406u;
44 constexpr enum_t invalid_index = 0xFFFFFFFFu;
45 constexpr uint_t null_handle = 0u;
49 enum class index_type : enum_t {
50 u8 = value::unsigned_byte,
51 u16 = value::unsigned_short,
52 u32 = value::unsigned_int,
57 constexpr enum_t raw(E e)
noexcept {
58 return static_cast<enum_t
>(e);
61 constexpr boolean_t gl_bool(
bool b)
noexcept {
62 return b ?
static_cast<boolean_t
>(value::true_) :
static_cast<boolean_t
>(value::false_);
68 uint_t
id = value::null_handle;
70 constexpr explicit operator bool() const noexcept {
71 return id != value::null_handle;
74 friend constexpr bool operator==(handle, handle) =
default;
79 struct texture_tag {};
83 struct program_tag {};
87 struct framebuffer_tag {};
89 using buffer = handle<buffer_tag>;
90 using texture = handle<texture_tag>;
91 using vao = handle<vao_tag>;
92 using program = handle<program_tag>;
93 using shader = handle<shader_tag>;
94 using framebuffer = handle<framebuffer_tag>;