summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-03-03 00:26:39 +0000
committerCarl Hetherington <cth@carlh.net>2019-05-06 21:31:09 +0100
commitaa5f98eba71af011e43dab16cd5d23adc8dbfdfc (patch)
treeccbd1fb73843d1b7f716b4ecf7dd868b26230d58 /src
parentf01dbe03f472188a002d611ee873f7de121d25b6 (diff)
Rendering fixes.
Diffstat (limited to 'src')
-rw-r--r--src/wx/film_viewer.cc11
-rw-r--r--src/wx/film_viewer.h3
-rw-r--r--src/wx/gl_view.cc3
3 files changed, 9 insertions, 8 deletions
diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc
index 173c286cc..29e84aa79 100644
--- a/src/wx/film_viewer.cc
+++ b/src/wx/film_viewer.cc
@@ -100,6 +100,8 @@ FilmViewer::FilmViewer (wxWindow* p)
set_film (shared_ptr<Film> ());
+ _gl_view->Bind (wxEVT_SIZE, boost::bind(&FilmViewer::panel_sized, this, _1));
+
_config_changed_connection = Config::instance()->Changed.connect (bind (&FilmViewer::config_changed, this, _1));
config_changed (Config::SOUND_OUTPUT);
}
@@ -427,8 +429,6 @@ FilmViewer::set_eyes (Eyes e)
slow_refresh ();
}
-#if 0
-XXX
void
FilmViewer::panel_sized (wxSizeEvent& ev)
{
@@ -441,7 +441,6 @@ FilmViewer::panel_sized (wxSizeEvent& ev)
}
PositionChanged ();
}
-#endif
void
FilmViewer::calculate_sizes ()
@@ -469,9 +468,9 @@ FilmViewer::calculate_sizes ()
_out_size.width = max (64, _out_size.width);
_out_size.height = max (64, _out_size.height);
- /* OpenGL can't cope with odd sizes */
- _out_size.width &= ~1;
- _out_size.height &= ~1;
+ /* OpenGL can't cope with sizes which aren't rounded up to the nearest 4 */
+ _out_size.width &= ~3;
+ _out_size.height &= ~3;
_player->set_video_container_size (_out_size);
}
diff --git a/src/wx/film_viewer.h b/src/wx/film_viewer.h
index b96fba34c..84ec698ea 100644
--- a/src/wx/film_viewer.h
+++ b/src/wx/film_viewer.h
@@ -116,7 +116,7 @@ public:
private:
// void paint_panel ();
-// void panel_sized (wxSizeEvent &);
+ void panel_sized (wxSizeEvent &);
void timer ();
void calculate_sizes ();
void player_change (ChangeType type, int, bool);
@@ -150,6 +150,7 @@ private:
/** Size of our output (including padding if we have any) */
dcp::Size _out_size;
+ dcp::Size _panel_size;
RtAudio _audio;
int _audio_channels;
diff --git a/src/wx/gl_view.cc b/src/wx/gl_view.cc
index 5edfdc91e..5bf5520e7 100644
--- a/src/wx/gl_view.cc
+++ b/src/wx/gl_view.cc
@@ -111,9 +111,10 @@ void
GLView::set_image (shared_ptr<const Image> image)
{
DCPOMATIC_ASSERT (image->pixel_format() == AV_PIX_FMT_RGB24);
+ DCPOMATIC_ASSERT (!image->aligned());
_size = image->size ();
- glTexImage2D (GL_TEXTURE_2D, 0, 3, image->size().width, image->size().height, 0, GL_RGB, GL_UNSIGNED_BYTE, image->data()[0]);
+ glTexImage2D (GL_TEXTURE_2D, 0, GL_RGB8, image->size().width, image->size().height, 0, GL_RGB, GL_UNSIGNED_BYTE, image->data()[0]);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);