fixes
This commit is contained in:
45
include/opengl/data/texture_data.hpp
Normal file
45
include/opengl/data/texture_data.hpp
Normal file
@@ -0,0 +1,45 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user