summaryrefslogtreecommitdiff
path: root/common/headless_view.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/headless_view.cpp')
-rw-r--r--common/headless_view.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/common/headless_view.cpp b/common/headless_view.cpp
index ed00f48e82..94a6cd03bc 100644
--- a/common/headless_view.cpp
+++ b/common/headless_view.cpp
@@ -2,6 +2,7 @@
#include <mbgl/util/timer.hpp>
#include <stdexcept>
+#include <iostream>
namespace mbgl {
@@ -117,6 +118,8 @@ void HeadlessView::resize(uint16_t width, uint16_t height, float pixelRatio) {
void HeadlessView::clear_buffers() {
#if MBGL_USE_CGL
+ make_active();
+
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
if (fbo) {
@@ -156,6 +159,10 @@ HeadlessView::~HeadlessView() {
#endif
#if MBGL_USE_GLX
+ std::cerr << "~HeadlessView()" << '\n';
+ std::cerr << "x_display: " << x_display << '\n';
+ std::cerr << "glx_pixmap: " << glx_pixmap << '\n';
+ std::cerr << "gl_context: " << gl_context << '\n';
glXMakeCurrent(x_display, None, NULL);
glXDestroyContext(x_display, gl_context);
XFree(x_info);
@@ -176,6 +183,10 @@ void HeadlessView::make_active() {
#endif
#if MBGL_USE_GLX
+ std::cerr << "make_active()" << '\n';
+ std::cerr << "x_display: " << x_display << '\n';
+ std::cerr << "glx_pixmap: " << glx_pixmap << '\n';
+ std::cerr << "gl_context: " << gl_context << '\n';
if (!glXMakeCurrent(x_display, glx_pixmap, gl_context)) {
fprintf(stderr, "Switching OpenGL context failed\n");
}