Skip to content
Snippets Groups Projects
Commit a087368e authored by Tim Übelhör's avatar Tim Übelhör
Browse files

Require explicit swap_buffer

parent 9e945bd6
No related branches found
No related tags found
No related merge requests found
......@@ -51,10 +51,13 @@ public:
void *do_read();
/*!
Unmaps the OpenGL memory and swaps front- & backbuffer.
Unmaps the OpenGL memory.
*/
void end_read();
/*! Swap the front- and backbuffer */
void swap_buffers();
private:
int width;
int height;
......@@ -66,8 +69,5 @@ private:
int backbuffer_index = 0;
// transfer from pbo to CPU memory
int frontbuffer_index = 1;
/*! Swap the front- and backbuffer */
void swap_buffers();
};
} // namespace scigl_render
......@@ -52,6 +52,7 @@ void ExampleRender::next_frame(const CvCamera &camera, const Model &model,
check_gl_error("synchronous reading from pbo");
display_data(data);
offscreen_render.end_read();
offscreen_render.swap_buffers();
check_gl_error("end synchronous reading");
}
......
......@@ -56,7 +56,6 @@ void *OffscreenRender::do_read()
void OffscreenRender::end_read()
{
glUnmapBuffer(GL_PIXEL_PACK_BUFFER);
swap_buffers();
}
void OffscreenRender::swap_buffers()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment