aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-08-06 17:38:05 +0200
committerdec05eba <dec05eba@protonmail.com>2019-08-06 17:38:08 +0200
commitc11d8f861b0e260240ec59c423cdb440d7409ac1 (patch)
tree13642d35913f9bee0fd1b5ab9958bfeb805e3df0 /src
parent31ac4c0061f0c34b99ddf2643e912efa5549d0bd (diff)
Fix black video after next video plays
Diffstat (limited to 'src')
-rw-r--r--src/VideoPlayer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/VideoPlayer.cpp b/src/VideoPlayer.cpp
index 7ce5f19..41b6d0e 100644
--- a/src/VideoPlayer.cpp
+++ b/src/VideoPlayer.cpp
@@ -185,6 +185,8 @@ namespace QuickMedia {
{
video_size.x = w;
video_size.y = h;
+ context.reset(new sf::Context(sf::ContextSettings(), w, h));
+ context->setActive(true);
// TODO: Verify if it's valid to re-create the texture like this,
// instead of using deconstructor
if(texture.create(w, h)) {
@@ -192,8 +194,6 @@ namespace QuickMedia {
if(newTextureBuf)
textureBuffer = (sf::Uint8*)newTextureBuf;
}
- context.reset(new sf::Context(sf::ContextSettings(), w, h));
- context->setActive(true);
glViewport(0, 0, w, h);
context->setActive(false);
resize(desired_size);