Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug in opengl #1051

Merged
merged 1 commit into from
Aug 27, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions libs/yocto_gui/yocto_opengl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,7 @@ bool init_program(ogl_program* program, const string& vertex,
}
return false;
}
return true;
}

// clear program
Expand Down Expand Up @@ -1109,6 +1110,7 @@ void main() {

ogl_image::~ogl_image() {
if (program) delete program;
if (texture) delete texture;
if (quad) delete quad;
}

Expand All @@ -1121,7 +1123,6 @@ bool init_image(ogl_image* image) {
if (is_initialized(image)) return true;
if (!init_program(image->program, glimage_vertex, glimage_fragment))
return false;

set_quad_shape(image->quad);
return true;
}
Expand All @@ -1131,7 +1132,6 @@ void clear_image(ogl_image* image) {
clear_program(image->program);
clear_texture(image->texture);
clear_shape(image->quad);
*image = {};
}

// update image data
Expand Down