GraphicsWindowSDL2: adjust the log levels

This commit is contained in:
scrawl 2015-11-10 18:42:59 +01:00
parent 0409e5a043
commit 7776c49fc1

View file

@ -2,7 +2,6 @@
#include <SDL_video.h> #include <SDL_video.h>
#include <osg/DeleteHandler>
#include <osg/Version> #include <osg/Version>
namespace SDLUtil namespace SDLUtil
@ -79,15 +78,13 @@ void GraphicsWindowSDL2::init()
if(!_traits.valid()) if(!_traits.valid())
return; return;
// getEventQueue()->setCurrentEventState(osgGA::GUIEventAdapter::getAccumulatedEventState().get());
WindowData *inheritedWindowData = dynamic_cast<WindowData*>(_traits->inheritedWindowData.get()); WindowData *inheritedWindowData = dynamic_cast<WindowData*>(_traits->inheritedWindowData.get());
mWindow = inheritedWindowData ? inheritedWindowData->mWindow : NULL; mWindow = inheritedWindowData ? inheritedWindowData->mWindow : NULL;
mOwnsWindow = (mWindow == 0); mOwnsWindow = (mWindow == 0);
if(mOwnsWindow) if(mOwnsWindow)
{ {
OSG_NOTICE<<"Error: No SDL window provided."<<std::endl; OSG_FATAL<<"Error: No SDL window provided."<<std::endl;
return; return;
} }
@ -99,7 +96,7 @@ void GraphicsWindowSDL2::init()
mContext = SDL_GL_CreateContext(mWindow); mContext = SDL_GL_CreateContext(mWindow);
if(!mContext) if(!mContext)
{ {
OSG_NOTICE<< "Error: Unable to create OpenGL graphics context: "<<SDL_GetError() <<std::endl; OSG_FATAL<< "Error: Unable to create OpenGL graphics context: "<<SDL_GetError() <<std::endl;
return; return;
} }
@ -145,7 +142,7 @@ bool GraphicsWindowSDL2::makeCurrentImplementation()
{ {
if(!mRealized) if(!mRealized)
{ {
OSG_NOTICE<<"Warning: GraphicsWindow not realized, cannot do makeCurrent."<<std::endl; OSG_WARN<<"Warning: GraphicsWindow not realized, cannot do makeCurrent."<<std::endl;
return false; return false;
} }
@ -156,7 +153,7 @@ bool GraphicsWindowSDL2::releaseContextImplementation()
{ {
if(!mRealized) if(!mRealized)
{ {
OSG_NOTICE<< "Warning: GraphicsWindow not realized, cannot do releaseContext." <<std::endl; OSG_WARN<< "Warning: GraphicsWindow not realized, cannot do releaseContext." <<std::endl;
return false; return false;
} }
@ -166,8 +163,6 @@ bool GraphicsWindowSDL2::releaseContextImplementation()
void GraphicsWindowSDL2::closeImplementation() void GraphicsWindowSDL2::closeImplementation()
{ {
// OSG_NOTICE<<"Closing GraphicsWindowSDL2"<<std::endl;
if(mContext) if(mContext)
SDL_GL_DeleteContext(mContext); SDL_GL_DeleteContext(mContext);
mContext = NULL; mContext = NULL;
@ -184,8 +179,6 @@ void GraphicsWindowSDL2::swapBuffersImplementation()
{ {
if(!mRealized) return; if(!mRealized) return;
//OSG_NOTICE<< "swapBuffersImplementation "<<this<<" "<<OpenThreads::Thread::CurrentThread()<<std::endl;
SDL_GL_SwapWindow(mWindow); SDL_GL_SwapWindow(mWindow);
} }