Browse Source

Platform: properly handle the optional EGL surface in moves.

I wonder what kind of bugs this caused.
pull/580/head
Vladimír Vondruš 4 years ago
parent
commit
6d4758f534
  1. 9
      src/Magnum/Platform/WindowlessEglApplication.cpp

9
src/Magnum/Platform/WindowlessEglApplication.cpp

@ -526,12 +526,18 @@ WindowlessEglContext::WindowlessEglContext(WindowlessEglContext&& other) noexcep
_sharedContext{other._sharedContext}, _sharedContext{other._sharedContext},
#endif #endif
_display{other._display}, _context{other._context} _display{other._display}, _context{other._context}
#if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_WEBGL)
, _surface{other._surface}
#endif
{ {
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
other._sharedContext = false; other._sharedContext = false;
#endif #endif
other._display = {}; other._display = {};
other._context = {}; other._context = {};
#if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_WEBGL)
other._surface = {};
#endif
} }
WindowlessEglContext::~WindowlessEglContext() { WindowlessEglContext::~WindowlessEglContext() {
@ -570,6 +576,9 @@ WindowlessEglContext& WindowlessEglContext::operator=(WindowlessEglContext&& oth
#endif #endif
swap(other._display, _display); swap(other._display, _display);
swap(other._context, _context); swap(other._context, _context);
#if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_WEBGL)
swap(other._surface, _surface);
#endif
return *this; return *this;
} }

Loading…
Cancel
Save