using std::cout;
using boost::shared_ptr;
+using boost::optional;
GLVideoView::GLVideoView (wxWindow *parent)
{
_canvas = new wxGLCanvas (parent, wxID_ANY, 0, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE);
_context = new wxGLContext (_canvas);
_canvas->Bind (wxEVT_PAINT, boost::bind(&GLVideoView::paint, this, _1));
+ _canvas->Bind (wxEVT_SIZE, boost::bind(boost::ref(Sized)));
glGenTextures (1, &_id);
glBindTexture (GL_TEXTURE_2D, _id);
void
GLVideoView::set_image (shared_ptr<const Image> image)
{
+ if (!image) {
+ _size = optional<dcp::Size>();
+ return;
+ }
+
DCPOMATIC_ASSERT (image->pixel_format() == AV_PIX_FMT_RGB24);
DCPOMATIC_ASSERT (!image->aligned());
glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
check_gl_error ("glTexParameterf");
-
- _canvas->Refresh ();
}