Commit 2a2ff2b5 authored by Christian Schulte zu Berge's avatar Christian Schulte zu Berge
Browse files

Fixed assertion in campvis-test:

campvis-test does not use OpenGLJobProcessor and only initializes it halfway. However, some CAMPVis functionality relies on that. Therefore, I introduced a hack/workaround to set the OpenGL thread manually if you need to.

Furthermore, added exit(EXIT_FAILURE) to recursive assertions to avoid possible endless assertion loops in campvis-test (and thus amok running jobs in Jenkins).
parent 59646d0f
......@@ -261,6 +261,10 @@ namespace campvis {
return std::this_thread::get_id() == _this_thread_id;
}
void OpenGLJobProcessor::iKnowWhatImDoingSetThisThreadOpenGlThread() {
_this_thread_id = std::this_thread::get_id();
}
}
......
......@@ -153,6 +153,13 @@ namespace campvis {
*/
tgt::GLCanvas* iKnowWhatImDoingGetArbitraryContext();
/**
* Sets the calling thread as OpenGl thread.
* \note You can do really messy things with this. Do not use this method unless
* you know what you're doing and know that there is no other way...
*/
void iKnowWhatImDoingSetThisThreadOpenGlThread();
/**
* Checks whether calling thread is OpenGL thread.
* \return std::this_thread::get_id() == _this_thread_id
......
......@@ -54,6 +54,7 @@ bool myCustomAssert(long line, const char* filename, const char* functionName, c
exit(EXIT_FAILURE);
default:
std::cout << "An assertion in a assertion... :(" << std::endl;
exit(EXIT_FAILURE);
}
} while (true);
#else
......
......@@ -30,8 +30,6 @@ namespace tgt {
}
void GlContextManager::releaseCurrentContext() {
if (_currentContext != 0)
glFinish();
setCurrent(0);
}
......
......@@ -65,6 +65,7 @@ void init() {
tgt::GlContextManager::init();
campvis::OpenGLJobProcessor::init();
campvis::OpenGLJobProcessor::getRef().iKnowWhatImDoingSetThisThreadOpenGlThread();
campvis::SimpleJobProcessor::init();
tgtAssert(_initialized == false, "Tried to initialize CampVisApplication twice.");
......@@ -79,6 +80,7 @@ void init() {
tgt::GLContextScopedLock lock(_localContext);
tgt::GlContextManager::getRef().registerContextAndInitGlew(_localContext);
campvis::OpenGLJobProcessor::getRef().registerContext(_localContext);
tgt::initGL(featureset);
ShdrMgr.setDefaultGlslVersion("330");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment