EGl-PBuffer

Supports the creation of off-screen pixel buffers (surfaces) for use with OpenGL ES.  The implementation uses the EGL API which adapts OpenGL to the native windowing system.

Summary
EGl-PBufferSupports the creation of off-screen pixel buffers (surfaces) for use with OpenGL ES.
CopyrightThis program is free software.
Files
C-kern/api/platform/OpenGL/EGL/eglpbuffer.hHeader file EGl-PBuffer.
C-kern/platform/OpenGL/EGL/eglpbuffer.cImplementation file EGl-PBuffer impl.
Types
struct eglpbuffer_tExport eglpbuffer_t into global namespace.
Functions
test
unittest_platform_opengl_egl_eglpbufferTest eglpbuffer_t functionality.
eglpbuffer_tPoints to an OpenGL pixel buffer.
lifetime
eglpbuffer_FREEStatic initializer.
init_eglpbufferAllocates a pixel buffer with size (width, height) in pixels and returns it in eglpbuf.
free_eglpbufferFrees all associated resources with eglpbuf.
query
size_eglpbufferReturns the width and height of eglpbuf in width and height.
configid_eglpbufferReturns the configuration ID of eglpbuf in configid.

Copyright

This program is free software.  You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.

Author

© 2014 Jörg Seebohn

Files

C-kern/api/platform/OpenGL/EGL/eglpbuffer.h

Header file EGl-PBuffer.

C-kern/platform/OpenGL/EGL/eglpbuffer.c

Implementation file EGl-PBuffer impl.

Types

struct eglpbuffer_t

Export eglpbuffer_t into global namespace.

test

unittest_platform_opengl_egl_eglpbuffer

int unittest_platform_opengl_egl_eglpbuffer(void)

Test eglpbuffer_t functionality.

eglpbuffer_t

typedef struct opengl_surface_t * eglpbuffer_t

Points to an OpenGL pixel buffer.  The implementation uses os independent EGL API to create the context.  OpenGL(ES) allows the binding of an off-screen pixel buffer to texture.  This allows to render the content of the texture directly.  This version of the EGL implementation does not support binding to a texture.  ANother possibility

Summary
lifetime
eglpbuffer_FREEStatic initializer.
init_eglpbufferAllocates a pixel buffer with size (width, height) in pixels and returns it in eglpbuf.
free_eglpbufferFrees all associated resources with eglpbuf.
query
size_eglpbufferReturns the width and height of eglpbuf in width and height.
configid_eglpbufferReturns the configuration ID of eglpbuf in configid.

lifetime

eglpbuffer_FREE

#define eglpbuffer_FREE 0

Static initializer.

init_eglpbuffer

int init_eglpbuffer(/*out*/eglpbuffer_t *eglpbuf,
struct opengl_display_t *egldisp,
struct opengl_config_t *eglconf,
uint32_t width,
uint32_t height)

Allocates a pixel buffer with size (width, height) in pixels and returns it in eglpbuf.  The parameter egldisp must be a valid egldisplay_t and eglconf must be a valid eglconfig_t with attribute gconfig_TYPE containing set bit gconfig_value_TYPE_PBUFFER_BIT.

free_eglpbuffer

int free_eglpbuffer(eglpbuffer_t *eglpbuf,
struct opengl_display_t *egldisp)

Frees all associated resources with eglpbuf.  Make sure that the pixel buffer is not active in any thread before calling this function.

query

size_eglpbuffer

int size_eglpbuffer(const eglpbuffer_t eglpbuf,
struct opengl_display_t *egldisp,
/*out*/uint32_t *width,
/*out*/uint32_t *height)

Returns the width and height of eglpbuf in width and height.

configid_eglpbuffer

int configid_eglpbuffer(const eglpbuffer_t eglpbuf,
struct opengl_display_t *egldisp,
/*out*/uint32_t *configid)

Returns the configuration ID of eglpbuf in configid.  Use id in a call to <initfromconfigid_eglconfig> for querying the configuration values assigned during creation of eglpbuf.

Supports the creation of off-screen pixel buffers (surfaces) for use with OpenGL ES.
Implements EGl-PBuffer.
typedef struct opengl_surface_t * eglpbuffer_t
Points to an OpenGL pixel buffer.
int unittest_platform_opengl_egl_eglpbuffer(void)
Test eglpbuffer_t functionality.
#define eglpbuffer_FREE 0
Static initializer.
int init_eglpbuffer(/*out*/eglpbuffer_t *eglpbuf,
struct opengl_display_t *egldisp,
struct opengl_config_t *eglconf,
uint32_t width,
uint32_t height)
Allocates a pixel buffer with size (width, height) in pixels and returns it in eglpbuf.
int free_eglpbuffer(eglpbuffer_t *eglpbuf,
struct opengl_display_t *egldisp)
Frees all associated resources with eglpbuf.
int size_eglpbuffer(const eglpbuffer_t eglpbuf,
struct opengl_display_t *egldisp,
/*out*/uint32_t *width,
/*out*/uint32_t *height)
Returns the width and height of eglpbuf in width and height.
int configid_eglpbuffer(const eglpbuffer_t eglpbuf,
struct opengl_display_t *egldisp,
/*out*/uint32_t *configid)
Returns the configuration ID of eglpbuf in configid.
The configuration supports drawing into a specific surface type.
The config supports drawing into a OpenGL (ES) pixel buffer surface.
Close