X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2FMoof%2FVideo.cc;h=9e74acbf2b75dae0b09cb53f17883ed1eb4063b8;hb=565445cda1dd3e9db8000c4a194831dc296a203d;hp=ba375e10318195cc770bca37552288d64bb6d816;hpb=4f62ce947db282f0bbf4d49b3aafb83d7cf51adc;p=chaz%2Fyoink diff --git a/src/Moof/Video.cc b/src/Moof/Video.cc index ba375e1..9e74acb 100644 --- a/src/Moof/Video.cc +++ b/src/Moof/Video.cc @@ -27,7 +27,6 @@ *******************************************************************************/ #include "Dispatch.hh" -#include "Engine.hh" #include "Error.hh" #include "Image.hh" #include "Log.hh" @@ -76,6 +75,8 @@ void Video::init(const Attributes& attribs) setCursorVisible(attribs.cursorVisible); setCursorGrab(attribs.cursorGrab); setVideoMode(attribs.mode); + + video = this; } void Video::recreateContext() @@ -110,6 +111,8 @@ void Video::setOpenGLAttributes() Video::~Video() { SDL_FreeSurface(mContext); + + if (video == this) video = 0; } @@ -132,8 +135,7 @@ void Video::setVideoMode(const long mode[3]) // 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 } @@ -296,7 +298,7 @@ int Video::getHeight() const 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; @@ -322,8 +324,6 @@ Video::Attributes::Attributes() cursorVisible = true; cursorGrab = false; - Settings& settings = Settings::getInstance(); - std::vector colors; settings.get("colorbuffers", colors); if (colors.size() > 0) colorBuffer[0] = colors[0]; @@ -395,6 +395,9 @@ Video::Attributes::Attributes() } +Video* video = 0; + + } // namespace Mf /** vim: set ts=4 sw=4 tw=80: *************************************************/