Added reasons to assertions
This commit is contained in:
@ -27,7 +27,7 @@ namespace Dawn {
|
||||
|
||||
public:
|
||||
void init() {
|
||||
assertTrue(this->id == -1);
|
||||
assertTrue(this->id == -1, "ShaderParameterBuffer::init: ShaderParameterBuffer is already initialized!");
|
||||
this->size = sizeof(T);
|
||||
glGenBuffers(1, &this->id);
|
||||
|
||||
@ -50,7 +50,7 @@ namespace Dawn {
|
||||
}
|
||||
|
||||
void bind(shaderbufferslot_t location) override {
|
||||
assertTrue(this->isReady());
|
||||
assertTrue(this->isReady(), "ShaderParameterBuffer::bind: ShaderParameterBuffer is not ready!");
|
||||
glBindBuffer(GL_UNIFORM_BUFFER, this->id);
|
||||
glBindBufferBase(GL_UNIFORM_BUFFER, location, this->id);
|
||||
}
|
||||
@ -73,7 +73,7 @@ namespace Dawn {
|
||||
* @param length Length of the data to buffer.
|
||||
*/
|
||||
void bufferRaw(void *data, size_t start, size_t length) {
|
||||
assertTrue(this->isReady());
|
||||
assertTrue(this->isReady(), "ShaderParameterBuffer::bufferRaw: ShaderParameterBuffer is not ready!");
|
||||
glBindBuffer(GL_UNIFORM_BUFFER, this->id);
|
||||
glBufferSubData(GL_UNIFORM_BUFFER, start, length, (void*)((size_t)data + start));
|
||||
}
|
||||
|
Reference in New Issue
Block a user