slices working, broken colors

This commit is contained in:
2020-03-10 00:38:38 -04:00
parent ebcab7118d
commit c345e54d02
2 changed files with 77 additions and 27 deletions

View File

@@ -39,6 +39,16 @@ namespace cgl {
return id;
}
[[nodiscard]] size_t size() const {
GLint res;
glGetNamedBufferParameteriv(id, GL_BUFFER_SIZE, &res);
return (size_t) res;
}
[[nodiscard]] size_t count() const {
return size() / sizeof(T);
}
void put(const T &data, GLenum usage = GL_STATIC_DRAW) {
glNamedBufferData(id, sizeof(T), &data, usage);
}