37
37
mg::EGLContextStore::~EGLContextStore() noexcept
39
eglDestroyContext(egl_display_, egl_context_);
39
if (egl_context_ != EGL_NO_CONTEXT)
40
eglDestroyContext(egl_display_, egl_context_);
43
mg::EGLContextStore::EGLContextStore(EGLContextStore&& other)
44
: egl_display_{other.egl_display_},
45
egl_context_{other.egl_context_}
47
other.egl_display_ = EGL_NO_DISPLAY;
48
other.egl_context_ = EGL_NO_CONTEXT;
42
51
mg::EGLContextStore::operator EGLContext() const
48
57
* EGLSurfaceStore *
49
58
*******************/
60
mg::EGLSurfaceStore::EGLSurfaceStore(EGLDisplay egl_display, EGLSurface egl_surface,
61
enum AllowNoSurface allow_no_surface)
62
: egl_display_{egl_display}, egl_surface_{egl_surface}
64
if (egl_surface_ == EGL_NO_SURFACE && !allow_no_surface)
65
BOOST_THROW_EXCEPTION(std::runtime_error("Could not create egl surface\n"));
51
68
mg::EGLSurfaceStore::EGLSurfaceStore(EGLDisplay egl_display, EGLSurface egl_surface)
52
: egl_display_{egl_display}, egl_surface_{egl_surface}
54
if (egl_surface_ == EGL_NO_SURFACE)
55
BOOST_THROW_EXCEPTION(std::runtime_error("Could not create egl surface\n"));
69
: EGLSurfaceStore(egl_display, egl_surface, DisallowNoSurface)
73
mg::EGLSurfaceStore::EGLSurfaceStore(EGLSurfaceStore&& other)
74
: egl_display_{other.egl_display_},
75
egl_surface_{other.egl_surface_}
77
other.egl_display_ = EGL_NO_DISPLAY;
78
other.egl_surface_ = EGL_NO_SURFACE;
58
81
mg::EGLSurfaceStore::~EGLSurfaceStore() noexcept
60
eglDestroySurface(egl_display_, egl_surface_);
83
if (egl_surface_ != EGL_NO_SURFACE)
84
eglDestroySurface(egl_display_, egl_surface_);
63
87
mg::EGLSurfaceStore::operator EGLSurface() const