Final day of opengl. Animations mostly work but there's either a problem with the model or the way it's loaded from assimp.

This commit is contained in:
Zed A. Shaw 2026-10-19 19:02:02 -04:00
parent a629e16fe2
commit 3363921b6b
167 changed files with 17566 additions and 2 deletions

View file

@ -0,0 +1,42 @@
#include <deque>
#include <string>
#include <fuc2/testing.hpp>
#include "model.hpp"
#include "shader.hpp"
using namespace fuc2;
/*
* This also tests Mesh by using Model to load them.
*/
namespace model_tests {
void test_load_textures() {
Shader shader({"shaders/33-framebuffers.vert.glsl", "shaders/33-framebuffers.frag.glsl", ""});
Model popcorn{"assets", "popcorn_model_a.glb"};
popcorn.draw(shader, true);
Model crate_glb{"assets", "crate.glb"};
crate_glb.draw(shader, true);
Model crate_obj{"assets", "crate.obj"};
crate_obj.draw(shader, true);
}
void test_failures() {
auto runner = [&]() {
Model bad_obj{"assets", "does_not_exist.obj"};
};
BLOWS_UP(runner, "should fail on missing file.");
}
fuc2::Set TESTS{
.name="models",
.options={ .fail_fast=false },
.tests={
TEST(test_load_textures),
TEST(test_failures),
}
};
}