#pragma once #include "gfx/gl_loader.h" #include "gfx/mesh_obj_load.h" namespace fn::gfx { // VAO + VBO interleaved (pos.xyz, nrm.xyz) + EBO. ok() despues de upload. struct MeshGpu { GLuint vao = 0; GLuint vbo = 0; GLuint ebo = 0; int index_count = 0; bool ok() const { return vao != 0 && index_count > 0; } }; // Sube un Mesh CPU al GPU. Requiere contexto GL activo. // Si Mesh esta vacio o no es valido, devuelve MeshGpu{} (ok() == false). // Layout: location 0 = vec3 a_pos, location 1 = vec3 a_normal. MeshGpu mesh_gpu_upload(const Mesh& mesh); // Libera los recursos GL. Seguro con mesh_gpu vacio. void mesh_gpu_destroy(MeshGpu& mesh_gpu); } // namespace fn::gfx