*******************************************************************************/
#include "Dispatch.hh"
-#include "Engine.hh"
#include "Error.hh"
#include "Image.hh"
#include "Log.hh"
setCursorVisible(attribs.cursorVisible);
setCursorGrab(attribs.cursorGrab);
setVideoMode(attribs.mode);
+
+ video = this;
}
void Video::recreateContext()
Video::~Video()
{
SDL_FreeSurface(mContext);
+
+ if (video == this) video = 0;
}
// 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
- Engine::getInstance().dispatch("video.newcontext");
-
+ core.dispatch("video.newcontext");
logInfo("video context recreated");
#endif
}
Video::Attributes::Attributes()
{
- // Set some sane GL and window defaults (see SDL_video.c:217)
+ // set some sane GL and window defaults (see SDL_video.c:217)
colorBuffer[0] = 3;
colorBuffer[1] = 3;
colorBuffer[2] = 2;
cursorVisible = true;
cursorGrab = false;
- Settings& settings = Settings::getInstance();
-
std::vector<long> colors;
settings.get("colorbuffers", colors);
if (colors.size() > 0) colorBuffer[0] = colors[0];
}
+Video* video = 0;
+
+
} // namespace Mf
/** vim: set ts=4 sw=4 tw=80: *************************************************/