fixing projection issue

This commit is contained in:
2024-10-17 15:37:39 +02:00
parent 99437a6d6a
commit 160364bda2
13 changed files with 117 additions and 57 deletions

View File

@@ -7,6 +7,7 @@ namespace mlx
void Mesh::Draw(VkCommandBuffer cmd, std::size_t& drawcalls, std::size_t& polygondrawn) const noexcept
{
MLX_PROFILE_FUNCTION();
#pragma omp parallel for
for(std::size_t i = 0; i < m_sub_meshes.size(); i++)
Draw(cmd, drawcalls, polygondrawn, i);
}
@@ -25,6 +26,7 @@ namespace mlx
Mesh::~Mesh()
{
MLX_PROFILE_FUNCTION();
#pragma omp parallel for
for(auto& mesh : m_sub_meshes)
{
mesh.vbo.Destroy();

View File

@@ -23,7 +23,7 @@ namespace mlx
data[3].position = Vec4f(x, y + height, 0.0f, 1.0f);
data[3].uv = Vec2f(1.0f, 0.0f);
std::vector<std::uint32_t> indices = {
std::vector<std::uint32_t> indices{
0,
1,
2,
@@ -40,7 +40,7 @@ namespace mlx
Sprite::Sprite(Renderer& renderer, NonOwningPtr<Texture> texture)
{
MLX_PROFILE_FUNCTION();
Verify((bool)texture, "Sprite: invalid texture");
Verify((bool)texture, "Sprite: invalid texture (internal mlx issue, please report to devs)");
p_mesh = CreateQuad(0, 0, texture->GetWidth(), texture->GetHeight());
p_texture = texture;
@@ -49,6 +49,6 @@ namespace mlx
if(event.What() == Event::DescriptorPoolResetEventCode)
m_set.Reallocate(renderer.GetCurrentFrameIndex());
};
EventBus::RegisterListener({ functor, "__Sprite" + std::to_string(reinterpret_cast<std::uintptr_t>(this)) });
EventBus::RegisterListener({ functor, "__MlxSprite" + std::to_string(reinterpret_cast<std::uintptr_t>(this)) });
}
}