#include <SDL/SDL_image.h>
#include "Dispatcher.hh"
+#include "Log.hh"
#include "Serializable.hh"
#include "Settings.hh"
#include "Video.hh"
SDL_FreeSurface(context_);
context_ = 0;
setVideoMode(attribs_.mode);
- Mf::Dispatcher::getInstance().dispatch("video.context_recreated");
}
void Video::setOpenGLAttributes()
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());
}