From 51e5e742e518be511c2cb3234d01459d1233dc85 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 20 Feb 2020 04:52:40 +0100 Subject: Add debug output for opengl --- src/model_loader/ObjModelLoader.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/model_loader') diff --git a/src/model_loader/ObjModelLoader.cpp b/src/model_loader/ObjModelLoader.cpp index 51d8a74..a42f8d7 100644 --- a/src/model_loader/ObjModelLoader.cpp +++ b/src/model_loader/ObjModelLoader.cpp @@ -160,16 +160,16 @@ namespace amalgine { texture_coords.push_back(temp_texture_coords[texture_coord_indices[1]]); texture_coords.push_back(temp_texture_coords[texture_coord_indices[2]]); } else if(num_columns == 4) { // Quad, convert to triangle. TODO: Support rendering quads instead of converting to triangles - triangles.push_back({ vertices[vertex_indices[0]], vertices[vertex_indices[1]], vertices[vertex_indices[3]] }); - triangles.push_back({ vertices[vertex_indices[3]], vertices[vertex_indices[2]], vertices[vertex_indices[1]] }); + triangles.push_back({ vertices[vertex_indices[0]], vertices[vertex_indices[1]], vertices[vertex_indices[2]] }); + triangles.push_back({ vertices[vertex_indices[2]], vertices[vertex_indices[3]], vertices[vertex_indices[0]] }); texture_coords.push_back(temp_texture_coords[texture_coord_indices[0]]); texture_coords.push_back(temp_texture_coords[texture_coord_indices[1]]); - texture_coords.push_back(temp_texture_coords[texture_coord_indices[3]]); + texture_coords.push_back(temp_texture_coords[texture_coord_indices[2]]); - texture_coords.push_back(temp_texture_coords[texture_coord_indices[3]]); texture_coords.push_back(temp_texture_coords[texture_coord_indices[2]]); - texture_coords.push_back(temp_texture_coords[texture_coord_indices[1]]); + texture_coords.push_back(temp_texture_coords[texture_coord_indices[3]]); + texture_coords.push_back(temp_texture_coords[texture_coord_indices[0]]); } } } @@ -245,7 +245,7 @@ namespace amalgine { Result image_result = Image::loadFromFile(texture_path.c_str()); if(!image_result) - return Result::Err("Failed to load texture: " + texture_path); + return Result::Err(image_result.getErrorMsg(), image_result.getErrorCode()); image = image_result.unwrap(); break; -- cgit v1.2.3