+public:
+
+ /**
+ * Construction is initialization.
+ */
+
+ explicit texture_impl(const std::string& name) :
+ mippleton<texture_impl>(name),
+ width_(0),
+ height_(0),
+ mode_(0),
+ minFilter_(GL_NEAREST),
+ maxFilter_(GL_NEAREST),
+ wrapU_(GL_CLAMP),
+ wrapV_(GL_CLAMP),
+ object_(0)
+ {
+ uploadToGL();
+
+ // we want to know when the GL context is recreated
+ dispatcher::instance().addHandler("video.context_recreated",
+ boost::bind(&texture_impl::contextRecreated, this, _1), this);
+ }
+
+ ~texture_impl()
+ {
+ unloadFromGL();
+
+ dispatcher::instance().removeHandler(this);
+ }
+
+
+ /**
+ * Adapted from some public domain code. This stuff is common enough that
+ * it really should be included in SDL_image... We need this because images
+ * loaded with SDL_image aren't exactly GL-ready right out of the box. This
+ * method makes them ready.
+ */
+