mild renaming + const

main
Brett 2024-01-10 10:54:28 -05:00
parent c1f42b2d3b
commit 58eafb1636
4 changed files with 6 additions and 14 deletions

View File

@ -129,7 +129,7 @@ namespace blt::gfx
private: private:
bool handle_vertex_and_normals(float x, float y, float z, char type); 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); void parse_face(char_tokenizer& tokenizer);

View File

@ -50,7 +50,7 @@ namespace blt::gfx
allocate(size, mem_type, static_cast<const void*>(data)); allocate(size, mem_type, static_cast<const void*>(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); void update(GLsizeiptr size, void* data);

View File

@ -23,7 +23,6 @@
#include <charconv> #include <charconv>
#include "blt/std/assert.h" #include "blt/std/assert.h"
#include "blt/std/utility.h" #include "blt/std/utility.h"
#include "blt/std/memory.h"
namespace blt::gfx namespace blt::gfx
{ {
@ -36,11 +35,6 @@ namespace blt::gfx
explicit char_tokenizer(std::string_view view): string(view) explicit char_tokenizer(std::string_view view): string(view)
{} {}
inline char peek()
{
return string[current_pos];
}
inline char advance() inline char advance()
{ {
return string[current_pos++]; return string[current_pos++];
@ -79,7 +73,7 @@ namespace blt::gfx
return x; return x;
} }
void obj_loader::parse_extra_line(char_tokenizer& tokenizer) void obj_loader::parse_vertex_line(char_tokenizer& tokenizer)
{ {
char type = tokenizer.advance(); char type = tokenizer.advance();
@ -121,8 +115,7 @@ namespace blt::gfx
obj_objects_t quick_load(std::string_view file) obj_objects_t quick_load(std::string_view file)
{ {
obj_loader loader; return obj_loader().parseFile(file);
return loader.parseFile(file);
} }
obj_objects_t obj_loader::parseFile(std::string_view file) obj_objects_t obj_loader::parseFile(std::string_view file)
@ -141,7 +134,7 @@ namespace blt::gfx
parse_face(token); parse_face(token);
break; break;
case 'v': case 'v':
parse_extra_line(token); parse_vertex_line(token);
break; break;
case 'o': case 'o':
{ {

View File

@ -75,7 +75,6 @@ namespace blt::gfx
return; return;
glDeleteBuffers(1, &bufferID_); glDeleteBuffers(1, &bufferID_);
bufferID_ = 0; bufferID_ = 0;
BLT_DEBUG("Deleted VBO!");
} }
void vbo_t::allocate(GLsizeiptr size, GLint mem_type, const void* data) void vbo_t::allocate(GLsizeiptr size, GLint mem_type, const void* data)
@ -95,7 +94,7 @@ namespace blt::gfx
size_ = size; 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(); bind();
glBufferSubData(buffer_type, offset, size, data); glBufferSubData(buffer_type, offset, size, data);