X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FVideo.cc;h=8610a7b8be499e1106d741433d98f7beab9cb513;hp=63970e44389f5b5944eb00092e6e78c07e3e072d;hb=542e50a284c7f5b144a5c97c17f6d89b2af0175c;hpb=fdfba4553433b9b2804c2772c7645211b828c2ea diff --git a/src/Moof/Video.cc b/src/Moof/Video.cc index 63970e4..8610a7b 100644 --- a/src/Moof/Video.cc +++ b/src/Moof/Video.cc @@ -31,6 +31,7 @@ #include #include "Dispatcher.hh" +#include "Log.hh" #include "Serializable.hh" #include "Settings.hh" #include "Video.hh" @@ -84,7 +85,6 @@ void Video::recreateContext() SDL_FreeSurface(context_); context_ = 0; setVideoMode(attribs_.mode); - Mf::Dispatcher::getInstance().dispatch("video.context_recreated"); } void Video::setOpenGLAttributes() @@ -129,8 +129,16 @@ void Video::setVideoMode(const long mode[3]) attribs_.mode[0] = mode[0]; attribs_.mode[1] = mode[1]; attribs_.mode[2] = mode[2]; + +#if defined(_WIN32) || defined (_WIN64) || defined(__WIN32__) + // on win32, creating a new context via SDL_SetVideoMode will wipe + // out the GL state, so we gotta notify everyone to reload their + // state after the change + Mf::dispatcher::dispatch("video.context_recreated"); + logInfo("video context recreated"); +#endif } - else throw Exception(SDL_GetError()); + else throw Exception(Exception::SDL_ERROR); } }