This commit is contained in:
ZY4N
2025-03-23 21:11:22 +01:00
parent 510398423a
commit c609d49f0d
49 changed files with 1412 additions and 924 deletions

View File

@@ -9,21 +9,11 @@
namespace zgl
{
class shader_program_data
struct shader_program_data
{
private:
explicit shader_program_data(GLuint program_id);
public:
shader_program_data() = default;
[[nodiscard]] static std::error_code build_from(
const shader_handle& vertex_shader,
const shader_handle& geometry_shader,
const shader_handle& fragment_shader,
shader_program_data& data
);
explicit shader_program_data(GLuint program_id);
shader_program_data(const shader_program_data& other) = delete;
shader_program_data& operator=(const shader_program_data& other) = delete;
@@ -31,12 +21,9 @@ public:
shader_program_data(shader_program_data&& other) noexcept ;
shader_program_data& operator=(shader_program_data&& other) noexcept;
[[nodiscard]] shader_program_handle handle() const;
~shader_program_data();
private:
shader_program_handle m_handle{};
shader_program_handle handle{};
};
}

View File

@@ -1,45 +0,0 @@
#pragma once
#include "GL/glew.h"
#include "opengl/handles/texture_handle.hpp"
#include <span>
namespace zgl
{
struct texture_data
{
private:
explicit texture_data(GLuint texture_id);
public:
texture_data() = default;
template<typename T>
[[nodiscard]] static std::error_code build_from(
std::span<const T> buffer,
GLenum format,
GLenum type,
GLsizei width,
GLsizei height,
texture_data& data
);
texture_data(const texture_data&) = delete;
texture_data& operator=(const texture_data&) = delete;
texture_data(texture_data&&) noexcept;
texture_data& operator=(texture_data&&) noexcept;
~texture_data();
[[nodiscard]] texture_handle handle() const;
private:
texture_handle m_handle{};
};
}
#define INCLUDE_TEXTURE_DATA_IMPLEMENTATION
#include "opengl/data/texture_data.ipp"
#undef INCLUDE_TEXTURE_DATA_IMPLEMENTATION