fixes
This commit is contained in:
55
include/opengl/data/point_cloud_data.hpp
Normal file
55
include/opengl/data/point_cloud_data.hpp
Normal 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
|
||||
Reference in New Issue
Block a user