Skip to content

Commit

Permalink
fixing #8
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCrazyT committed Jul 14, 2018
1 parent e071e25 commit e6894ab
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .bintray.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},

"version": {
"name": "0.4"
"name": "0.5"
},

"files":
Expand Down
24 changes: 16 additions & 8 deletions roboschool/cpp-household/render-simple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,32 +337,40 @@ Texture::Texture() {
glFuncs->glGenTextures(1, &handle);
}
Texture::~Texture() {
QOpenGLExtraFunctions *glFuncs = QOpenGLContext::currentContext()->extraFunctions();
glFuncs->glDeleteTextures(1, &handle);
if(QOpenGLContext::currentContext()!=null){
QOpenGLExtraFunctions *glFuncs = QOpenGLContext::currentContext()->extraFunctions();
glFuncs->glDeleteTextures(1, &handle);
}
}
Framebuffer::Framebuffer() {
QOpenGLExtraFunctions *glFuncs = QOpenGLContext::currentContext()->extraFunctions();
glFuncs->glGenFramebuffers(1, &handle);
}
Framebuffer::~Framebuffer() {
QOpenGLExtraFunctions *glFuncs = QOpenGLContext::currentContext()->extraFunctions();
glFuncs->glDeleteFramebuffers(1, &handle);
if(QOpenGLContext::currentContext()!=null){
QOpenGLExtraFunctions *glFuncs = QOpenGLContext::currentContext()->extraFunctions();
glFuncs->glDeleteFramebuffers(1, &handle);
}
}
Buffer::Buffer() {
QOpenGLExtraFunctions *glFuncs = QOpenGLContext::currentContext()->extraFunctions();
glFuncs->glGenBuffers(1, &handle);
}
Buffer::~Buffer() {
QOpenGLExtraFunctions *glFuncs = QOpenGLContext::currentContext()->extraFunctions();
glFuncs->glDeleteBuffers(1, &handle);
if(QOpenGLContext::currentContext()!=null){
QOpenGLExtraFunctions *glFuncs = QOpenGLContext::currentContext()->extraFunctions();
glFuncs->glDeleteBuffers(1, &handle);
}
}
VAO::VAO() {
QOpenGLExtraFunctions *glFuncs = QOpenGLContext::currentContext()->extraFunctions();
glFuncs->glGenVertexArrays(1, &handle);
}
VAO::~VAO() {
QOpenGLExtraFunctions *glFuncs = QOpenGLContext::currentContext()->extraFunctions();
glFuncs->glDeleteVertexArrays(1, &handle);
if(QOpenGLContext::currentContext()!=null){
QOpenGLExtraFunctions *glFuncs = QOpenGLContext::currentContext()->extraFunctions();
glFuncs->glDeleteVertexArrays(1, &handle);
}
}

void ContextViewport::_render_single_object(const shared_ptr<Household::ShapeDetailLevels>& m, uint32_t options, int detail, const QMatrix4x4& at_pos)
Expand Down

0 comments on commit e6894ab

Please sign in to comment.