Import material textures with mesh assets

This commit is contained in:
2026-03-26 16:22:24 +08:00
parent c479595bf5
commit e174862b8a
18 changed files with 622 additions and 21 deletions

View File

@@ -1,5 +1,6 @@
#include <gtest/gtest.h>
#include <XCEngine/Resources/Mesh/Mesh.h>
#include <XCEngine/Resources/Material/Material.h>
#include <XCEngine/Core/Asset/ResourceTypes.h>
#include <XCEngine/Core/Asset/ResourceManager.h>
@@ -31,6 +32,11 @@ TEST(Mesh, GetSections) {
EXPECT_EQ(mesh.GetSections().Size(), 0u);
}
TEST(Mesh, GetMaterials) {
Mesh mesh;
EXPECT_EQ(mesh.GetMaterials().Size(), 0u);
}
TEST(Mesh, SetVertexAndIndexData) {
Mesh mesh;
@@ -71,6 +77,17 @@ TEST(Mesh, AddSection) {
EXPECT_EQ(mesh.GetSections()[0].materialID, 2u);
}
TEST(Mesh, AddMaterial) {
Mesh mesh;
auto* material = new Material();
mesh.AddMaterial(material);
ASSERT_EQ(mesh.GetMaterials().Size(), 1u);
EXPECT_EQ(mesh.GetMaterial(0), material);
EXPECT_GT(mesh.GetMemorySize(), 0u);
}
TEST(Mesh, SetBounds) {
Mesh mesh;