diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2022-12-29 23:25:25 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2022-12-29 23:25:25 +0000 |
commit | 94e99a5a9ded01e8184543b7ddf5cdfa39573ded (patch) | |
tree | ca6dd314da3c3d29fd8fc8d36f53d578c8c48be6 /test/testMainWindow.cpp | |
parent | Add missing explicit on constructors (diff) | |
download | ilt-94e99a5a9ded01e8184543b7ddf5cdfa39573ded.tar.bz2 ilt-94e99a5a9ded01e8184543b7ddf5cdfa39573ded.tar.xz ilt-94e99a5a9ded01e8184543b7ddf5cdfa39573ded.zip |
Move test render helpers into a new test library
Diffstat (limited to 'test/testMainWindow.cpp')
-rw-r--r-- | test/testMainWindow.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/testMainWindow.cpp b/test/testMainWindow.cpp new file mode 100644 index 0000000..66e8832 --- /dev/null +++ b/test/testMainWindow.cpp @@ -0,0 +1,24 @@ +#include "testMainWindow.h" +#include <boost/test/test_tools.hpp> + +TestMainWindow::TestMainWindow() : Window {1, 1, __FILE__, SDL_WINDOW_OPENGL | SDL_WINDOW_HIDDEN} +{ + glEnable(GL_DEBUG_OUTPUT); + glDebugMessageCallback( + [](GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar * message, + const void *) { + char buf[BUFSIZ]; + snprintf(buf, BUFSIZ, "GL CALLBACK: %s type = 0x%x, severity = 0x%x, message = %s", + (type == GL_DEBUG_TYPE_ERROR ? "** GL ERROR **" : ""), type, severity, message); + switch (type) { + case GL_DEBUG_TYPE_ERROR: + case GL_DEBUG_TYPE_PERFORMANCE: + case GL_DEBUG_TYPE_PORTABILITY: + case GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR: + case GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR: + BOOST_TEST_ERROR(buf); + } + BOOST_TEST_MESSAGE(buf); + }, + nullptr); +} |