13 #ifndef EGLPLUS_SURFACE_1305291005_HPP
14 #define EGLPLUS_SURFACE_1305291005_HPP
17 #include <eglplus/error/basic.hpp>
34 struct SurfaceValueTypeToSurfaceAttrib
37 ValueType(std::integral_constant<int, 0>);
44 ValueType(std::integral_constant<int, 1>);
51 ValueType(std::integral_constant<int, 2>);
58 ValueType(std::integral_constant<int, 3>);
65 ValueType(std::integral_constant<int, 4>);
72 ValueType(std::integral_constant<int, 5>);
79 ValueType(std::integral_constant<int, 6>);
85 #ifndef EGL_GL_COLORSPACE
86 static std::integral_constant<int, 6> MaxValueType(
void);
89 ValueType(std::integral_constant<int, 7>);
95 static std::integral_constant<int, 7> MaxValueType(
void);
100 typedef AttributeList<
102 SurfaceValueTypeToSurfaceAttrib,
107 typedef FinishedAttributeList<
113 ::EGLSurface GetEGLHandle(
const Surface&);
120 ::EGLSurface _handle;
122 friend ::EGLSurface GetEGLHandle(
const Surface&);
128 static ::EGLSurface _init(
135 ::EGLSurface result = EGLPLUS_EGLFUNC(CreatePbufferSurface)(
136 GetEGLHandle(display),
137 GetEGLHandle(config),
140 EGLPLUS_CHECK_SIMPLE(CreatePbufferSurface);
150 , _handle(_init(sel, _display, config, attribs))
155 static ::EGLSurface _init(
159 EGLNativePixmapType pixmap,
163 ::EGLSurface result = EGLPLUS_EGLFUNC(CreatePixmapSurface)(
164 GetEGLHandle(display),
165 GetEGLHandle(config),
169 EGLPLUS_CHECK_SIMPLE(CreatePixmapSurface);
177 EGLNativePixmapType pixmap,
180 , _handle(_init(sel, _display, config, pixmap, attribs))
185 static ::EGLSurface _init(
189 EGLNativeWindowType window,
193 ::EGLSurface result = EGLPLUS_EGLFUNC(CreateWindowSurface)(
194 GetEGLHandle(display),
195 GetEGLHandle(config),
199 EGLPLUS_CHECK_SIMPLE(CreateWindowSurface);
207 EGLNativeWindowType window,
210 , _handle(_init(sel, _display, config, window, attribs))
215 : _display(tmp._display)
216 , _handle(tmp._handle)
218 tmp._handle = EGL_NO_SURFACE;
228 if(_handle != EGL_NO_SURFACE)
230 EGLPLUS_EGLFUNC(DestroySurface)(
231 GetEGLHandle(_display),
234 EGLPLUS_VERIFY_SIMPLE(DestroySurface);
265 EGLNativePixmapType pixmap,
286 EGLNativeWindowType window,
307 GetEGLHandle(_display),
322 GetEGLHandle(_display),
338 GetEGLHandle(_display),
340 EGLint(EGLenum(attrib)),
354 bool result = EGLPLUS_EGLFUNC(QuerySurface)(
355 GetEGLHandle(_display),
357 EGLint(EGLenum(attrib)),
360 EGLPLUS_VERIFY_SIMPLE(QuerySurface);
371 EGLint result = EGL_UNKNOWN;
421 EGLint(render_buffer)
505 #if EGLPLUS_DOCUMENTATION_ONLY || defined(EGL_GL_COLORSPACE)
547 inline ::EGLSurface GetEGLHandle(
const Surface& surface)
549 return surface._handle;
554 #endif // include guard
void SwapBehavior(eglplus::SwapBehavior value)
Sets the buffer swap behavior setting of the surface.
Definition: surface.hpp:471
EGL render buffer enumeration.
AttributeList< SurfaceAttrib, SurfaceValueTypeToSurfaceAttrib, AttributeListTraits > SurfaceAttribs
Attribute list for surface attributes.
Definition: surface.hpp:104
eglplus::RenderBuffer RenderBuffer(void) const
Returns the render buffer setting of the surface.
Definition: surface.hpp:404
eglplus::TextureFormat TextureFormat(void) const
Returns the texture format setting of the surface.
Definition: surface.hpp:498
static Surface Pbuffer(const Display &display, const Config &config, const FinishedSurfaceAttribs &attribs)
Creates a Pbuffer surface.
Definition: surface.hpp:243
void RenderBuffer(eglplus::RenderBuffer render_buffer)
Sets the render buffer setting of the surface.
Definition: surface.hpp:417
EGL buffer swap behavior enumeration.
bool CopyBuffers(EGLNativePixmapType target)
Copy buffer to native pixmap.
Definition: surface.hpp:319
static Surface Pixmap(const Display &display, const Config &config, EGLNativePixmapType pixmap, const FinishedSurfaceAttribs &attribs)
Creates a Pixmap surface.
Definition: surface.hpp:262
bool SwapBuffers(void)
Swap buffers.
Definition: surface.hpp:304
VGColorspace
OpenVG colorspace enumeration.
Definition: vg_colorspace.hpp:24
bool QueryAttrib(SurfaceAttrib attrib, EGLint &value) const
Queries the specified surface attribute value.
Definition: surface.hpp:352
eglplus::SwapBehavior SwapBehavior(void) const
Returns the buffer swap behavior setting of the surface.
Definition: surface.hpp:458
Helper macro expanding into EGL function name.
Template for EGL surface and configuration attribute list.
EGLint Height(void) const
Returns the height of the surface.
Definition: surface.hpp:393
EGLint GetAttrib(SurfaceAttrib attrib) const
Gets the specified surface attribute value.
Definition: surface.hpp:369
EGL OpenVG colorspace enumeration.
EGL Multisample resolve enumeration.
SurfaceAttrib
EGL surface attribute enumeration.
Definition: surface_attrib.hpp:24
TextureTarget
EGL texture target enumeration.
Definition: texture_target.hpp:24
~Surface(void)
Destroys the wrapped surface.
Definition: surface.hpp:226
EGL surface attribute enumeration.
eglplus::MultisampleResolve MultisampleResolve(void) const
Returns the multisample resolve setting of the surface.
Definition: surface.hpp:431
Wrapper around EGLDisplay.
Definition: display.hpp:27
EGLint Width(void) const
Returns the Width of the surface.
Definition: surface.hpp:382
Declares and implements wrapper for EGLDisplay.
RenderBuffer
EGL render buffer enumeration.
Definition: render_buffer.hpp:24
bool Attrib(SurfaceAttrib attrib, EGLint value)
Sets the value of the specified attribute.
Definition: surface.hpp:335
eglplus::GLColorspace GLColorspace(void) const
Returns the OpenGL colorspace setting of the surface.
Definition: surface.hpp:512
EGL texture format enumeration.
static Surface Window(const Display &display, const Config &config, EGLNativeWindowType window, const FinishedSurfaceAttribs &attribs)
Creates a Window surface.
Definition: surface.hpp:283
SwapBehavior
EGL buffer swap behavior enumeration.
Definition: swap_behavior.hpp:24
VGAlphaFormat
OpenVG alpha format enumeration.
Definition: vg_alpha_format.hpp:24
GLColorspace
OpenGL colorspace enumeration.
Definition: gl_colorspace.hpp:24
eglplus::TextureTarget TextureTarget(void) const
Returns the texture target setting of the surface.
Definition: surface.hpp:485
void MultisampleResolve(eglplus::MultisampleResolve value)
Sets the multisample resolve setting of the surface.
Definition: surface.hpp:444
Surface(Surface &&tmp)
Surfaces are move-constructible.
Definition: surface.hpp:214
FinishedAttributeList< SurfaceAttrib, AttributeListTraits > FinishedSurfaceAttribs
Finished list of surface attribute values.
Definition: surface.hpp:110
TextureFormat
EGL texture format enumeration.
Definition: texture_format.hpp:24
A wrapper for EGL configuration.
Definition: configs.hpp:34
Wrapper for EGLSurfaces.
Definition: surface.hpp:116
MultisampleResolve
Multisample resolve enumeration.
Definition: multisample_resolve.hpp:24
eglplus::VGAlphaFormat VGAlphaFormat(void) const
Returns the OpenVG alpha format of the surface.
Definition: surface.hpp:539
EGL texture target enumeration.
EGL OpenGL colorspace enumeration.
eglplus::VGColorspace VGColorspace(void) const
Returns the OpenVG colorspace setting of the surface.
Definition: surface.hpp:526