Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/models/models_first_person_maze.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ int main(void)

raylib::Image imMap("resources/cubicmap.png"); // Load cubicmap image (RAM)
raylib::Texture cubicmap(imMap); // Convert image to texture to display (VRAM)
raylib::MeshUnmanaged mesh = raylib::MeshUnmanaged::Cubicmap(imMap, Vector3{ 1.0f, 1.0f, 1.0f }); // Use MeshUnmanaged, Mesh will be handled by Model
raylib::MeshUnmanaged mesh = raylib::Mesh::Cubicmap(imMap, Vector3{ 1.0f, 1.0f, 1.0f }); // Use MeshUnmanaged, Mesh will be handled by Model
raylib::Model model(mesh);

// NOTE: By default each cube is mapped to one part of texture atlas
Expand Down
9 changes: 9 additions & 0 deletions include/Model.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ class Model : public ::Model {
Load(mesh);
}

/*
* Load a model from a mesh.
*
* @throws raylib::RaylibException Throws if failed to load the Modal.
*/
Model(const raylib::Mesh& mesh) {
throw raylib::RaylibException("Model(mesh) constructor expects a ::Mesh or raylib::MeshUnmanaged, as it takes ownership of the Mesh itself.");
}

~Model() {
Unload();
}
Expand Down