summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-08-05 00:06:35 +0200
committerCarl Hetherington <cth@carlh.net>2020-08-05 00:06:35 +0200
commitf6ad8f0a2acae27196640a999440ed22abf5345b (patch)
treec7da489c449ea0d19a3b7ed3bd50915ec11da715
parenteaedff2a7877fa4b560e0c65ac13ed3dad9437e5 (diff)
Add some more OpenGL debugging.
-rw-r--r--src/wx/gl_video_view.cc23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/wx/gl_video_view.cc b/src/wx/gl_video_view.cc
index fe49a5b8e..215511538 100644
--- a/src/wx/gl_video_view.cc
+++ b/src/wx/gl_video_view.cc
@@ -53,6 +53,17 @@ using std::cout;
using boost::shared_ptr;
using boost::optional;
+
+static void
+check_gl_error (char const * last)
+{
+ GLenum const e = glGetError ();
+ if (e != GL_NO_ERROR) {
+ throw GLError (last, e);
+ }
+}
+
+
GLVideoView::GLVideoView (FilmViewer* viewer, wxWindow *parent)
: VideoView (viewer)
, _have_storage (false)
@@ -98,8 +109,11 @@ GLVideoView::GLVideoView (FilmViewer* viewer, wxWindow *parent)
#endif
glGenTextures (1, &_id);
+ check_gl_error ("glGenTextures");
glBindTexture (GL_TEXTURE_2D, _id);
+ check_gl_error ("glBindTexture");
glPixelStorei (GL_UNPACK_ALIGNMENT, 1);
+ check_gl_error ("glPixelStorei");
}
GLVideoView::~GLVideoView ()
@@ -128,14 +142,6 @@ GLVideoView::check_for_butler_errors ()
}
}
-static void
-check_gl_error (char const * last)
-{
- GLenum const e = glGetError ();
- if (e != GL_NO_ERROR) {
- throw GLError (last, e);
- }
-}
void
GLVideoView::update ()
@@ -257,6 +263,7 @@ DCPOMATIC_ENABLE_WARNINGS
}
glFlush();
+ check_gl_error ("glFlush");
boost::mutex::scoped_lock lm (_canvas_mutex);
_canvas->SwapBuffers();