allow for direct setting of the texture_2d

main
Brett 2024-01-08 21:34:14 -05:00
parent 2f9bccc348
commit 00649a055d
2 changed files with 10 additions and 0 deletions

View File

@ -156,6 +156,7 @@ namespace blt::gfx
* @return a shared pointer to the stored vbo. used for chaining VAOs with multiple shared VBOs * @return a shared pointer to the stored vbo. used for chaining VAOs with multiple shared VBOs
*/ */
static_dynamic_array::vbo_type bindVBO(const vbo_t& vbo, int attribute_number, int coordinate_size, GLenum type, int stride, long offset); static_dynamic_array::vbo_type bindVBO(const vbo_t& vbo, int attribute_number, int coordinate_size, GLenum type, int stride, long offset);
// same as the other bind method except you provide the shared reference.
void bindVBO(const static_dynamic_array::vbo_type& vbo, int attribute_number, int coordinate_size, GLenum type, int stride, long offset); void bindVBO(const static_dynamic_array::vbo_type& vbo, int attribute_number, int coordinate_size, GLenum type, int stride, long offset);
inline void bindElement(const vbo_t& vbo) inline void bindElement(const vbo_t& vbo)

View File

@ -63,6 +63,15 @@ namespace blt::gfx
return textures_2d[name]; return textures_2d[name];
} }
/**
* Directly sets the internal representation of the texture. Can be used to set custom, non file system loaded textures.
* Note: this function takes ownership of the ptr.
*/
inline void set(std::string_view name, texture_gl2D* texture)
{
textures_2d[name] = texture;
}
void cleanup(); void cleanup();
}; };