Merge remote-tracking branch 'manul-public/master' into manul-staging

This commit is contained in:
WLs50
2025-04-05 14:24:53 +02:00
45 changed files with 875 additions and 477 deletions

View File

@@ -113,7 +113,8 @@ bool opengl33_renderer::Init(GLFWwindow *Window)
gfx::vertex_array billboard_array{
{{-size, size, 0.f}, glm::vec3(), {1.f, 1.f}}, {{size, size, 0.f}, glm::vec3(), {0.f, 1.f}}, {{-size, -size, 0.f}, glm::vec3(), {1.f, 0.f}}, {{size, -size, 0.f}, glm::vec3(), {0.f, 0.f}}};
m_billboardgeometry = m_geometry.create_chunk(billboard_array, geometrybank, GL_TRIANGLE_STRIP);
gfx::userdata_array userdata{};
m_billboardgeometry = m_geometry.create_chunk(billboard_array, userdata, geometrybank, GL_TRIANGLE_STRIP);
m_empty_vao = std::make_unique<gl::vao>();
try
@@ -1967,34 +1968,34 @@ gfx::geometrybank_handle opengl33_renderer::Create_Bank()
}
// creates a new indexed geometry chunk of specified type from supplied data, in specified bank. returns: handle to the chunk or NULL
gfx::geometry_handle opengl33_renderer::Insert( gfx::index_array &Indices, gfx::vertex_array &Vertices, gfx::geometrybank_handle const &Geometry, int const Type )
gfx::geometry_handle opengl33_renderer::Insert(gfx::index_array &Indices, gfx::vertex_array &Vertices, gfx::userdata_array &Userdata, gfx::geometrybank_handle const &Geometry, int const Type)
{
// NOTE: we expect indexed geometry to come with calculated tangents
return m_geometry.create_chunk( Indices, Vertices, Geometry, Type );
return m_geometry.create_chunk( Indices, Vertices, Userdata, Geometry, Type );
}
// creates a new geometry chunk of specified type from supplied data, in specified bank. returns: handle to the chunk or NULL
gfx::geometry_handle opengl33_renderer::Insert(gfx::vertex_array &Vertices, gfx::geometrybank_handle const &Geometry, int const Type)
gfx::geometry_handle opengl33_renderer::Insert(gfx::vertex_array &Vertices, gfx::userdata_array &Userdata, gfx::geometrybank_handle const &Geometry, int const Type)
{
gfx::calculate_tangents(Vertices, gfx::index_array(), Type);
return m_geometry.create_chunk(Vertices, Geometry, Type);
return m_geometry.create_chunk(Vertices, Userdata, Geometry, Type);
}
// replaces data of specified chunk with the supplied vertex data, starting from specified offset
bool opengl33_renderer::Replace(gfx::vertex_array &Vertices, gfx::geometry_handle const &Geometry, int const Type, std::size_t const Offset)
bool opengl33_renderer::Replace(gfx::vertex_array &Vertices, gfx::userdata_array &Userdata, gfx::geometry_handle const &Geometry, int const Type, const std::size_t Offset)
{
gfx::calculate_tangents(Vertices, gfx::index_array(), Type);
return m_geometry.replace(Vertices, Geometry, Offset);
return m_geometry.replace(Vertices, Userdata, Geometry, Offset);
}
// adds supplied vertex data at the end of specified chunk
bool opengl33_renderer::Append(gfx::vertex_array &Vertices, gfx::geometry_handle const &Geometry, int const Type)
bool opengl33_renderer::Append(gfx::vertex_array &Vertices, gfx::userdata_array &Userdata, gfx::geometry_handle const &Geometry, int const Type)
{
gfx::calculate_tangents(Vertices, gfx::index_array(), Type);
return m_geometry.append(Vertices, Geometry);
return m_geometry.append(Vertices, Userdata, Geometry);
}
// provides direct access to index data of specfied chunk
@@ -2009,6 +2010,11 @@ gfx::vertex_array const &opengl33_renderer::Vertices(gfx::geometry_handle const
return m_geometry.vertices(Geometry);
}
gfx::userdata_array const &opengl33_renderer::UserData(const gfx::geometry_handle &Geometry) const
{
return m_geometry.userdata(Geometry);
}
// material methods
material_handle opengl33_renderer::Fetch_Material(std::string const &Filename, bool const Loadnow)
{
@@ -4850,7 +4856,7 @@ bool opengl33_renderer::opengl33_imgui_renderer::Init()
return ImGui_ImplOpenGL3_Init("#version 330 core");
}
void opengl33_renderer::opengl33_imgui_renderer::Shutdown()
void opengl33_renderer::opengl33_imgui_renderer::Shutdown()
{
ImGui_ImplOpenGL3_Shutdown();
}
@@ -4865,3 +4871,4 @@ void opengl33_renderer::opengl33_imgui_renderer::Render()
gl::buffer::unbind(gl::buffer::ARRAY_BUFFER);
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
}