LesDingeriesDeDjalimSurOpenGL/src/loops/cube.cpp
Djalim Simaila 7e36811c91 ♻️ refactor engine to use Mesh3D with transform support
- Add position, rotation and scale fields to `Mesh3D` and expose them publicly.
- Remove the old `Object3D` struct; `Objects3D` now stores `unique_ptr<Mesh3D>`.
- Implement a new `createObject(name,textures,filepath,position,rotation,scale)` overload that sets transforms after loading the mesh.
- Add a `draw(Mesh3D*)` helper that binds the texture, builds a model matrix and issues `glDrawArrays`.
- Update the rendering loop to use `draw()` instead of the old cube routine.
- Simplify `onCreate`: enable depth test, flip textures, create two objects with proper transforms, set clear color.
- Enable window resizing (`GLFW_RESIZABLE`), change default size to 800×600 in `main.cpp`.
- Clean up includes and remove unused `cube.cpp`; refactor OBJ parsing for robustness.

These changes unify object handling, allow per‑object transformations, simplify the rendering pipeline, improve maintainability, and make the window resizable.
2025-10-25 19:46:49 +02:00

2 lines
1 B
C++