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,55 @@
#pragma once
#include "util/uix.hpp"
#include <span>
#include <system_error>
#include "GL/glew.h"
#include "opengl/handles/point_cloud_handle.hpp"
#include "assets/components/point_cloud_vertex_components.hpp"
namespace zgl {
struct point_cloud_data {
private:
point_cloud_data(
GLuint vertex_buffer_id,
GLuint vao_id,
GLsizei point_count
);
public:
point_cloud_data() = default;
[[nodiscard]] static std::error_code build_from(
std::span<const std::uint8_t> point_buffer,
std::span<const GLenum> component_types,
std::span<const GLint> component_lengths,
GLsizei stride,
point_cloud_data& data
);
point_cloud_data(const point_cloud_data& other) = delete;
point_cloud_data& operator=(const point_cloud_data& other) = delete;
point_cloud_data(point_cloud_data&& other) noexcept;
point_cloud_data& operator=(point_cloud_data&& other) noexcept;
~point_cloud_data();
[[nodiscard]] point_cloud_handle handle() const;
[[nodiscard]] components::point_cloud_vertex::flags components() const;
private:
point_cloud_handle m_handle{};
GLuint m_vertex_vbo_id{ 0 };
components::point_cloud_vertex::flags m_component_types{
components::point_cloud_vertex::flags::none
};
};
}
#define INCLUDE_POINT_CLOUD_DATA_IMPLEMENTATION
#include "opengl/data/point_cloud_data.ipp"
#undef INCLUDE_POINT_CLOUD_DATA_IMPLEMENTATION