X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FVideo.cc;h=1ed24c75fee3e3e877cea604eab0261c9028b0cf;hp=0452c973cd91264f0a82c2120de786625c079d7b;hb=33842c860fe18ca8cf087905992885687434320c;hpb=a5f0d391406a68275b41448fc3f49e8d8396c497 diff --git a/src/Moof/Video.cc b/src/Moof/Video.cc index 0452c97..1ed24c7 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,6 +129,14 @@ 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()); } @@ -311,7 +319,7 @@ Video::Attributes::Attributes() Settings& settings = Settings::getInstance(); - std::vector colors; + Serializable::Array colors; settings.get("video.colorbuffers", colors); if (colors.size() > 0) colors[0]->get(colorBuffer[0]); if (colors.size() > 1) colors[1]->get(colorBuffer[1]); @@ -323,7 +331,7 @@ Video::Attributes::Attributes() settings.get("video.depthbuffer", depthBuffer); settings.get("video.stencilbuffer", stencilBuffer); - std::vector accum; + Serializable::Array accum; settings.get("video.accumbuffers", accum); if (accum.size() > 0) accum[0]->get(accumBuffer[0]); if (accum.size() > 1) accum[1]->get(accumBuffer[1]); @@ -342,7 +350,7 @@ Video::Attributes::Attributes() } settings.get("video.icon", icon); - std::vector dimensions; + Serializable::Array dimensions; settings.get("video.mode", dimensions); if (dimensions.size() > 0) dimensions[0]->get(mode[0]); if (dimensions.size() > 1) dimensions[1]->get(mode[1]);