14#include <lagrange/ui/api.h>
15#include <lagrange/ui/components/GLMesh.h>
16#include <lagrange/ui/components/VertexData.h>
17#include <lagrange/ui/types/Camera.h>
18#include <lagrange/ui/types/FrameBuffer.h>
19#include <lagrange/ui/types/Shader.h>
20#include <lagrange/ui/types/ShaderLoader.h>
38LA_UI_API Eigen::Matrix4f offset_depth(
const Eigen::Projective3f&
perspective,
int layer_index);
49LA_UI_API
void set_render_pass_defaults(GLScope& scope);
56LA_UI_API std::pair<Eigen::Vector3f, Eigen::Vector3f> compute_perpendicular_plane(
57 Eigen::Vector3f direction);
77LA_UI_API
void set_render_transforms(
81 const Transform* transform =
nullptr);
84LA_UI_API
void render_vertex_data(
const VertexData& vd, GLenum primitive, GLsizei per_element_size);
86LA_UI_API GLenum get_gl_primitive(
const PrimitiveType& p);
88LA_UI_API GLsizei get_gl_primitive_size(
const PrimitiveType& p);
89LA_UI_API GLsizei get_gl_primitive_size(GLenum primitive_enum);
92LA_UI_API std::shared_ptr<VertexData> generate_cube_vertex_data(
bool edges =
false);
93LA_UI_API std::shared_ptr<VertexData> generate_quad_vertex_data();
95LA_UI_API GLMesh generate_quad_mesh_gpu();
98LA_UI_API
void update_vao(VertexData& vertex_data);
101LA_UI_API entt::resource<Shader>
102get_or_load_shader(ShaderCache& cache,
const std::string& generic_path,
bool virtual_fs =
false);
105template <
typename BufferComponent>
106bool set_mesh_geometry_layout(
107 const Registry& registry,
108 const Entity mesh_geometry_entity,
110 VertexData& vertex_data)
112 const auto* buffer_component = registry.try_get<BufferComponent>(mesh_geometry_entity);
114 vertex_data.attribute_dimensions[location] = BufferComponent::dimension;
116 if (buffer_component && buffer_component->buffer) {
117 vertex_data.attribute_buffers[location] = buffer_component->buffer;
120 vertex_data.attribute_buffers[location] =
nullptr;
125LA_UI_API
int get_gl_attribute_dimension(GLenum attrib_type);
133 const GLMesh& glmesh,
134 const Shader& shader,
136 IndexingMode indexing,
137 entt::id_type submesh_index);
Lagrange UI Viewer and mini 3D engine.
Definition: AcceleratedPicking.h:22
LA_UI_API Eigen::Projective3f perspective(float fovy, float aspect, float zNear, float zFar)
Constructs perspective projection matrix.
Definition: math.cpp:52
LA_UI_API void update_vertex_data(const GLMesh &glmesh, const Shader &shader, VertexData &glvd, IndexingMode indexing, entt::id_type submesh_index)
Assigns buffers from GLMesh to GLVertexData to Shader specified locations.
Definition: render.cpp:432
Main namespace for Lagrange.
Definition: AABBIGL.h:30