diff --git a/include/blt/gfx/loader/obj_loader.h b/include/blt/gfx/loader/obj_loader.h index 3072d77..ad75b50 100644 --- a/include/blt/gfx/loader/obj_loader.h +++ b/include/blt/gfx/loader/obj_loader.h @@ -129,7 +129,7 @@ namespace blt::gfx private: bool handle_vertex_and_normals(float x, float y, float z, char type); - void parse_extra_line(char_tokenizer& tokenizer); + void parse_vertex_line(char_tokenizer& tokenizer); void parse_face(char_tokenizer& tokenizer); diff --git a/include/blt/gfx/model.h b/include/blt/gfx/model.h index 82dcbfd..778a4a3 100644 --- a/include/blt/gfx/model.h +++ b/include/blt/gfx/model.h @@ -50,7 +50,7 @@ namespace blt::gfx allocate(size, mem_type, static_cast(data)); } - void sub_update(GLsizeiptr offset, GLsizeiptr size, void* data); + void sub_update(GLsizeiptr offset, GLsizeiptr size, void* data) const; void update(GLsizeiptr size, void* data); diff --git a/src/blt/gfx/loader/obj_loader.cpp b/src/blt/gfx/loader/obj_loader.cpp index ddc7d72..ec9f8a3 100644 --- a/src/blt/gfx/loader/obj_loader.cpp +++ b/src/blt/gfx/loader/obj_loader.cpp @@ -23,7 +23,6 @@ #include #include "blt/std/assert.h" #include "blt/std/utility.h" -#include "blt/std/memory.h" namespace blt::gfx { @@ -36,11 +35,6 @@ namespace blt::gfx explicit char_tokenizer(std::string_view view): string(view) {} - inline char peek() - { - return string[current_pos]; - } - inline char advance() { return string[current_pos++]; @@ -79,7 +73,7 @@ namespace blt::gfx return x; } - void obj_loader::parse_extra_line(char_tokenizer& tokenizer) + void obj_loader::parse_vertex_line(char_tokenizer& tokenizer) { char type = tokenizer.advance(); @@ -121,8 +115,7 @@ namespace blt::gfx obj_objects_t quick_load(std::string_view file) { - obj_loader loader; - return loader.parseFile(file); + return obj_loader().parseFile(file); } obj_objects_t obj_loader::parseFile(std::string_view file) @@ -141,7 +134,7 @@ namespace blt::gfx parse_face(token); break; case 'v': - parse_extra_line(token); + parse_vertex_line(token); break; case 'o': { diff --git a/src/blt/gfx/model.cpp b/src/blt/gfx/model.cpp index a5bc876..1d833bc 100644 --- a/src/blt/gfx/model.cpp +++ b/src/blt/gfx/model.cpp @@ -75,7 +75,6 @@ namespace blt::gfx return; glDeleteBuffers(1, &bufferID_); bufferID_ = 0; - BLT_DEBUG("Deleted VBO!"); } void vbo_t::allocate(GLsizeiptr size, GLint mem_type, const void* data) @@ -95,7 +94,7 @@ namespace blt::gfx size_ = size; } - void vbo_t::sub_update(GLsizeiptr offset, GLsizeiptr size, void* data) + void vbo_t::sub_update(GLsizeiptr offset, GLsizeiptr size, void* data) const { bind(); glBufferSubData(buffer_type, offset, size, data);