X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FTexture.cc;h=7d82e2d093416cf5190475a803de81873405d662;hp=48e6e1b6193909766df411c85757ab6393201a41;hb=e0c0a3b5e7337cde55e520801d2e59e03dc97d9c;hpb=ed5fcf5f1357fc42749408f705e9ec55531ff006 diff --git a/src/Moof/Texture.cc b/src/Moof/Texture.cc index 48e6e1b..7d82e2d 100644 --- a/src/Moof/Texture.cc +++ b/src/Moof/Texture.cc @@ -121,12 +121,13 @@ public: mObject(0) { // make sure we have a video context - ASSERT(video && - "cannot load textures without a current video context"); + Video* video = Video::current(); + ASSERT(video && "should have a video context set"); // we want to know when the GL context is recreated - mDispatchHandler = core.addHandler("video.newcontext", - boost::bind(&Impl::contextRecreated, this)); + Dispatch& dispatch = Dispatch::global(); + mNewContextDispatch = dispatch.addTarget("video.newcontext", + boost::bind(&Impl::contextRecreated, this)); } ~Impl() @@ -388,7 +389,7 @@ public: GLuint mObject; ///< GL texture handle. static GLuint gObject; ///< Global GL texture handle. - Dispatch::Handler mDispatchHandler; + Dispatch::Handle mNewContextDispatch; }; GLuint Texture::Impl::gObject = 0;