Having OpenGL calls in a destructor:
Code :
brush::~brush()
{
glDeleteBuffers(1, &(this->vboId));
glDeleteBuffers(1, &(this->iboId));
}
can sometimes cause problems depending on when the object is destroyed. The context could potentially have been destroyed already, there could be no context current, or a different context could be current to the one you expected. It may be better to have a brush::deleteBuffers() instead.