This commit is contained in:
ZY4N
2024-12-22 16:58:40 +01:00
parent 2704814de2
commit db8db8f9d7
161 changed files with 17102 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
#pragma once
#include <string>
#include <system_error>
#include "GL/glew.h"
#include "opengl/handles/shader_handle.hpp"
namespace zgl
{
class shader_data
{
private:
explicit shader_data(GLuint shader_id, GLenum type);
public:
shader_data() = default;
[[nodiscard]] static std::error_code build_from(
GLenum type,
const std::string& source,
shader_data& data
);
shader_data(const shader_data& other) = delete;
shader_data& operator=(const shader_data& other) = delete;
shader_data(shader_data&& other) noexcept;
shader_data& operator=(shader_data&& other) noexcept;
[[nodiscard]] shader_handle handle() const;
~shader_data();
private:
shader_handle m_handle{};
GLenum m_type{ GL_INVALID_ENUM };
};
}
#define INCLUDE_SHADER_DATA_IMPLEMENTATION
#include "opengl/data/shader_data.ipp"
#undef INCLUDE_SHADER_DATA_IMPLEMENTATION