Skip to content
Snippets Groups Projects
Verified Commit fb7653d8 authored by Tobias Frisch's avatar Tobias Frisch
Browse files

[#56] Added missing check into first_mesh example

parent 621fd545
No related branches found
No related tags found
1 merge request!45Resolve "Szene-Repräsentation"
Pipeline #26291 passed
......@@ -34,9 +34,8 @@ int main(int argc, const char** argv) {
if (result == 1) {
std::cout << "Mesh loading successful!" << std::endl;
}
else {
std::cout << "Mesh loading failed: " << result << std::endl;
} else {
std::cerr << "Mesh loading failed: " << result << std::endl;
return 1;
}
......@@ -74,7 +73,7 @@ int main(int argc, const char** argv) {
vkcv::PassHandle firstMeshPass = core.createPass(firstMeshPassDefinition);
if (!firstMeshPass) {
std::cout << "Error. Could not create renderpass. Exiting." << std::endl;
std::cerr << "Error. Could not create renderpass. Exiting." << std::endl;
return EXIT_FAILURE;
}
......@@ -113,12 +112,15 @@ int main(int argc, const char** argv) {
vkcv::PipelineHandle firstMeshPipeline = core.createGraphicsPipeline(firstMeshPipelineConfig);
if (!firstMeshPipeline) {
std::cout << "Error. Could not create graphics pipeline. Exiting." << std::endl;
std::cerr << "Error. Could not create graphics pipeline. Exiting." << std::endl;
return EXIT_FAILURE;
}
if (mesh.textures.empty()) {
std::cerr << "Error. No textures found. Exiting." << std::endl;
return EXIT_FAILURE;
}
// FIXME There should be a test here to make sure there is at least 1
// texture in the mesh.
vkcv::asset::Texture &tex = mesh.textures[0];
vkcv::Image texture = core.createImage(vk::Format::eR8G8B8A8Srgb, tex.w, tex.h);
texture.fill(tex.data.data());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment