Tizen Native API
|
Functions | |
Evas_GL * | evas_gl_new (Evas *e) |
Creates a new Evas_GL object and returns a handle for GL rendering with the EFL. | |
void | evas_gl_free (Evas_GL *evas_gl) |
Frees an Evas_GL object. | |
Evas_GL_Config * | evas_gl_config_new (void) |
Allocates a new config object for the user to fill out. | |
void | evas_gl_config_free (Evas_GL_Config *cfg) |
Frees a config object created from evas_gl_config_new. | |
Evas_GL_Surface * | evas_gl_surface_create (Evas_GL *evas_gl, Evas_GL_Config *cfg, int w, int h) |
Creates and returns a new Evas_GL_Surface object for GL Rendering. | |
Evas_GL_Surface * | evas_gl_pbuffer_surface_create (Evas_GL *evas_gl, Evas_GL_Config *cfg, int w, int h, const int *attrib_list) |
Create a pixel buffer surface. | |
void | evas_gl_surface_destroy (Evas_GL *evas_gl, Evas_GL_Surface *surf) |
Destroys an Evas GL Surface. | |
Evas_GL_Context * | evas_gl_context_create (Evas_GL *evas_gl, Evas_GL_Context *share_ctx) |
Creates and returns a new Evas GL context object (OpenGL-ES 2.0). | |
Evas_GL_Context * | evas_gl_context_version_create (Evas_GL *evas_gl, Evas_GL_Context *share_ctx, Evas_GL_Context_Version version) |
Creates and returns a new Evas GL context object for OpenGL-ES 1.1 or 2.0. | |
void | evas_gl_context_destroy (Evas_GL *evas_gl, Evas_GL_Context *ctx) |
Destroys the given Evas GL context object. | |
Eina_Bool | evas_gl_make_current (Evas_GL *evas_gl, Evas_GL_Surface *surf, Evas_GL_Context *ctx) |
Sets the given context as the current context for the given surface. | |
const char * | evas_gl_string_query (Evas_GL *evas_gl, int name) |
Returns a pointer to a static, null-terminated string describing some aspect of Evas GL. | |
Evas_GL_Func | evas_gl_proc_address_get (Evas_GL *evas_gl, const char *name) |
Returns a extension function from the Evas_GL glue layer. | |
Eina_Bool | evas_gl_native_surface_get (Evas_GL *evas_gl, Evas_GL_Surface *surf, Evas_Native_Surface *ns) |
Fills in the Native Surface information from a given Evas GL surface. | |
Evas_GL_API * | evas_gl_api_get (Evas_GL *evas_gl) |
Gets the API for rendering using OpenGL. | |
Evas_GL_API * | evas_gl_context_api_get (Evas_GL *evas_gl, Evas_GL_Context *ctx) |
Gets the API for rendering using OpenGL with non standard contexts. | |
int | evas_gl_rotation_get (Evas_GL *evas_gl) |
Get the current rotation of the view, in degrees. | |
Eina_Bool | evas_gl_surface_query (Evas_GL *evas_gl, Evas_GL_Surface *surface, int attribute, void *value) |
Query a surface for its properties. | |
int | evas_gl_error_get (Evas_GL *evas_gl) |
Returns the last error of any evas_gl function called in the current thread. Initially, the error is set to EVAS_GL_SUCCESS. A call to evas_gl_error_get resets the error to EVAS_GL_SUCCESS. | |
Evas_GL_Context * | evas_gl_current_context_get (Evas_GL *evas_gl) |
Returns the Evas GL context object in use or set by evas_gl_make_current. | |
Evas_GL_Surface * | evas_gl_current_surface_get (Evas_GL *evas_gl) |
Returns the Evas GL surface object in use or set by evas_gl_make_current. | |
Typedefs | |
typedef struct _Evas_GL | Evas_GL |
The structure type of the Evas GL object used to render GL in Evas. | |
typedef struct _Evas_GL_Surface | Evas_GL_Surface |
The structure type of the Evas GL Surface object, a GL rendering target in Evas GL. | |
typedef struct _Evas_GL_Context | Evas_GL_Context |
The structure type of the Evas GL Context object, a GL rendering context in Evas GL. | |
typedef struct _Evas_GL_Config | Evas_GL_Config |
The structure type of the Evas GL Surface configuration object for surface creation. | |
typedef struct _Evas_GL_API | Evas_GL_API |
The structure type of the Evas GL API object that contains the GL APIs to be used in Evas GL. | |
typedef void * | Evas_GL_Func |
Represents a function pointer, that can be used for Evas GL extensions. | |
typedef void * | EvasGLImage |
Represents an Evas GL Image object used with Evas GL Image extensions. | |
typedef enum _Evas_GL_Color_Format | Evas_GL_Color_Format |
Enumeration that defines the available surface color formats. | |
typedef enum _Evas_GL_Depth_Bits | Evas_GL_Depth_Bits |
Enumeration that defines the Surface Depth Format. | |
typedef enum _Evas_GL_Stencil_Bits | Evas_GL_Stencil_Bits |
Enumeration that defines the Surface Stencil Format. | |
typedef enum _Evas_GL_Options_Bits | Evas_GL_Options_Bits |
Enumeration that defines the Configuration Options. | |
typedef enum _Evas_GL_Multisample_Bits | Evas_GL_Multisample_Bits |
Enumeration that defines the configuration options for a Multisample Anti-Aliased (MSAA) rendering surface. | |
typedef enum _Evas_GL_Context_Version | Evas_GL_Context_Version |
Enumeration that defines the available OpenGL ES version numbers. They can be used to create OpenGL-ES 1.1 contexts. | |
Defines | |
#define | EVAS_GL_EXTENSIONS 1 |
Constant to use when calling evas_gl_string_query to retrieve the available Evas_GL extensions. | |
#define | EVAS_GL_IMAGE_PRESERVED 0x30D2 |
An attribute for evasglCreateImage or evasglCreateImageForContext, the default is EINA_FALSE . Please refer to EGL_IMAGE_PRESERVED_KHR . | |
#define | EVAS_VG_PARENT_IMAGE 0x30BA |
A target for evasglCreateImage or evasglCreateImageForContext. | |
#define | EVAS_GL_TEXTURE_2D 0x30B1 |
An attribute for evasglCreateImage or evasglCreateImageForContext. | |
#define | EVAS_GL_TEXTURE_LEVEL 0x30BC |
An attribute for evasglCreateImage or evasglCreateImageForContext. | |
#define | EVAS_GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x30B3 |
A target for evasglCreateImage or evasglCreateImageForContext. | |
#define | EVAS_GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x30B4 |
A target for evasglCreateImage or evasglCreateImageForContext. | |
#define | EVAS_GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x30B5 |
A target for evasglCreateImage or evasglCreateImageForContext. | |
#define | EVAS_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x30B6 |
A target for evasglCreateImage or evasglCreateImageForContext. | |
#define | EVAS_GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x30B7 |
A target for evasglCreateImage or evasglCreateImageForContext. | |
#define | EVAS_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x30B8 |
A target for evasglCreateImage or evasglCreateImageForContext. | |
#define | EVAS_GL_TEXTURE_3D 0x30B2 |
A target for evasglCreateImage or evasglCreateImageForContext. | |
#define | EVAS_GL_TEXTURE_ZOFFSET 0x30BD |
An attribute for evasglCreateImage or evasglCreateImageForContext. | |
#define | EVAS_GL_RENDERBUFFER 0x30B9 |
A target for evasglCreateImage or evasglCreateImageForContext. | |
#define | EVAS_GL_NATIVE_SURFACE_TIZEN 0x32A1 |
A target for evasglCreateImage or evasglCreateImageForContext. This is a Tizen specific feature. |
This group discusses the functions that are used to do OpenGL rendering on Evas. Evas allows you to use OpenGL to render to specially set up image objects (which act as render target surfaces). By default, Evas GL will use an OpenGL-ES 2.0 context and API set.
While it is possible to Evas and Ecore_Evas to create an OpenGL application, using these low-level APIs can be troublesome for most users. Before diving in Evas GL, please refer to the page OpenGL with Elementary.
Elementary GLView provides a set of helper functions in:
Similarly, two sets of helper functions are provided by Evas GL in the following header files:
typedef enum _Evas_GL_Context_Version Evas_GL_Context_Version |
Enumeration that defines the available OpenGL ES version numbers. They can be used to create OpenGL-ES 1.1 contexts.
typedef enum _Evas_GL_Depth_Bits Evas_GL_Depth_Bits |
Enumeration that defines the Surface Depth Format.
typedef enum _Evas_GL_Multisample_Bits Evas_GL_Multisample_Bits |
Enumeration that defines the configuration options for a Multisample Anti-Aliased (MSAA) rendering surface.
typedef enum _Evas_GL_Options_Bits Evas_GL_Options_Bits |
Enumeration that defines the Configuration Options.
typedef enum _Evas_GL_Stencil_Bits Evas_GL_Stencil_Bits |
Enumeration that defines the Surface Stencil Format.
Enumeration that defines the available surface color formats.
EVAS_GL_RGB_888 |
Opaque RGB surface |
EVAS_GL_RGBA_8888 |
RGBA surface with alpha |
EVAS_GL_NO_FBO |
Special value for creating PBuffer surfaces without any attached buffer.
|
Enumeration that defines the available OpenGL ES version numbers. They can be used to create OpenGL-ES 1.1 contexts.
enum _Evas_GL_Depth_Bits |
Enumeration that defines the configuration options for a Multisample Anti-Aliased (MSAA) rendering surface.
Enumeration that defines the Configuration Options.
EVAS_GL_OPTIONS_NONE |
No extra options |
EVAS_GL_OPTIONS_DIRECT |
Optional hint to allow rendering directly to the Evas window if possible |
EVAS_GL_OPTIONS_CLIENT_SIDE_ROTATION |
Force direct rendering even if the canvas is rotated. In that case, it is the application's role to rotate the contents of the Evas_GL view.
|
Enumeration that defines the Surface Stencil Format.
Evas_GL_API* evas_gl_api_get | ( | Evas_GL * | evas_gl | ) |
Gets the API for rendering using OpenGL.
This returns a structure that contains all the OpenGL functions you can use to render in Evas. These functions consist of all the standard OpenGL-ES2.0 functions and any additional ones that Evas has decided to provide. This means that if you have your code ported to OpenGL-ES2.0, it is going to be easy to render to Evas.
[in] | evas_gl | The given Evas_GL object |
void evas_gl_config_free | ( | Evas_GL_Config * | cfg | ) |
Frees a config object created from evas_gl_config_new.
[in] | cfg | The configuration structure to free, it can not be accessed afterwards. |
Evas_GL_Config* evas_gl_config_new | ( | void | ) |
Allocates a new config object for the user to fill out.
Evas_GL_API* evas_gl_context_api_get | ( | Evas_GL * | evas_gl, |
Evas_GL_Context * | ctx | ||
) |
Gets the API for rendering using OpenGL with non standard contexts.
This function is similar to evas_gl_api_get but takes an extra Evas GL context argument as it is used to get the real API used by special contexts, that have been instanciated with evas_gl_context_version_create().
This function can be used to get the GL API for a OpenGL-ES 1.1 context. When using OpenGL-ES 1.1, applications should always use evas_gl_context_api_get and never call evas_gl_api_get (this will always return a OpenGL-ES 2+ API).
[in] | evas_gl | The given Evas_GL object |
[in] | ctx | Specifies which context to use, based on this, Evas GL will return a 1.1- or a 2.0-compatible OpenGL-ES API. |
Evas_GL_Context* evas_gl_context_create | ( | Evas_GL * | evas_gl, |
Evas_GL_Context * | share_ctx | ||
) |
Creates and returns a new Evas GL context object (OpenGL-ES 2.0).
[in] | evas_gl | The given Evas_GL object |
[in] | share_ctx | An Evas_GL context to share with the new context |
The API in use will be an OpenGL-ES 2.0 API (ie. with framebuffers and shaders). Consider calling evas_gl_context_version_create if you need an OpenGL-ES 1.1 context instead.
NULL
on failurevoid evas_gl_context_destroy | ( | Evas_GL * | evas_gl, |
Evas_GL_Context * | ctx | ||
) |
Destroys the given Evas GL context object.
[in] | evas_gl | The given Evas_GL object |
[in] | ctx | The given Evas GL context |
Evas_GL_Context* evas_gl_context_version_create | ( | Evas_GL * | evas_gl, |
Evas_GL_Context * | share_ctx, | ||
Evas_GL_Context_Version | version | ||
) |
Creates and returns a new Evas GL context object for OpenGL-ES 1.1 or 2.0.
[in] | evas_gl | The given Evas_GL object |
[in] | share_ctx | A context to share (can be NULL) |
[in] | version | Major OpenGL-ES version number |
NULL
on failureThis function can be used to create OpenGL-ES 1.1 contexts, but OpenGL-ES 3.x is not supported yet.
The GL API bound to the created context must be queried using evas_gl_context_api_get (instead of evas_gl_api_get).
Evas_GL_Context* evas_gl_current_context_get | ( | Evas_GL * | evas_gl | ) |
Returns the Evas GL context object in use or set by evas_gl_make_current.
[in] | evas_gl | The given Evas_GL object |
NULL
in case of failure and when there is no current context in this thread.Evas_GL_Surface* evas_gl_current_surface_get | ( | Evas_GL * | evas_gl | ) |
Returns the Evas GL surface object in use or set by evas_gl_make_current.
evas_gl | The given Evas_GL object |
NULL
in case of failure and when there is no current surface in this thread.This can be used to get a handle to the current surface, so as to switch between contexts back and forth. Note that the OpenGL driver may stall when doing so.
int evas_gl_error_get | ( | Evas_GL * | evas_gl | ) |
Returns the last error of any evas_gl function called in the current thread. Initially, the error is set to EVAS_GL_SUCCESS. A call to evas_gl_error_get resets the error to EVAS_GL_SUCCESS.
[in] | evas_gl | The given Evas_GL object |
EVAS_GL
error code.Since Evas GL is a glue layer for GL imitating EGL, the error codes returned have a similar meaning as those defined in EGL, so please refer to the EGL documentation for more information about the various error codes.
void evas_gl_free | ( | Evas_GL * | evas_gl | ) |
Frees an Evas_GL object.
[in] | evas_gl | The given Evas_GL object to destroy |
Eina_Bool evas_gl_make_current | ( | Evas_GL * | evas_gl, |
Evas_GL_Surface * | surf, | ||
Evas_GL_Context * | ctx | ||
) |
Sets the given context as the current context for the given surface.
[in] | evas_gl | The given Evas_GL object |
[in] | surf | The given Evas GL surface |
[in] | ctx | The given Evas GL context |
EINA_TRUE
if successful, otherwise EINA_FALSE
if notEina_Bool evas_gl_native_surface_get | ( | Evas_GL * | evas_gl, |
Evas_GL_Surface * | surf, | ||
Evas_Native_Surface * | ns | ||
) |
Fills in the Native Surface information from a given Evas GL surface.
[in] | evas_gl | The given Evas_GL object |
[in] | surf | The given Evas GL surface to retrieve the Native Surface information from |
[out] | ns | The native surface structure that the function fills in |
EINA_TRUE
if successful, otherwise EINA_FALSE
if notThis function can be called to later set this native surface as source of an Evas Object Image. Please refer to evas_object_image_native_surface_set.
Evas_GL* evas_gl_new | ( | Evas * | e | ) |
Creates a new Evas_GL object and returns a handle for GL rendering with the EFL.
[in] | e | The given Evas canvas to use |
NULL
in case of failureEvas_GL_Surface* evas_gl_pbuffer_surface_create | ( | Evas_GL * | evas_gl, |
Evas_GL_Config * | cfg, | ||
int | w, | ||
int | h, | ||
const int * | attrib_list | ||
) |
Create a pixel buffer surface.
[in] | evas_gl | The given Evas_GL object |
[in] | cfg | Pixel format and configuration of the pixel buffer surface |
[in] | w | Requested width of the buffer |
[in] | h | Requested height of the buffer |
[in] | attrib_list | An optional list of attribute-value pairs terminated by attribute 0, can be NULL . Currently, no attributes are supported. |
NULL
on failureThe surface must be released with evas_gl_surface_destroy.
If the color format in cfg is EVAS_GL_RGB_888 or EVAS_GL_RGBA_8888, then Evas will automatically generate a framebuffer attached to this PBuffer. Its properties can be queried using evas_gl_native_surface_get. If you want to attach an FBO yourself, or create a PBuffer surface only, please use the color format EVAS_GL_NO_FBO.
Creating a 1x1 PBuffer surface can be useful in order to call evas_gl_make_current() from another thread.
Evas_GL_Func evas_gl_proc_address_get | ( | Evas_GL * | evas_gl, |
const char * | name | ||
) |
Returns a extension function from the Evas_GL glue layer.
[in] | evas_gl | The given Evas_GL object |
[in] | name | The name of the function to return |
The available extension functions may depend on the backend engine Evas GL is running on.
int evas_gl_rotation_get | ( | Evas_GL * | evas_gl | ) |
Get the current rotation of the view, in degrees.
This function should be called in order to properly handle the current rotation of the view. It will always return 0 unless the option EVAS_GL_OPTIONS_CLIENT_SIDE_ROTATION has been set.
Indeed, in case of direct rendering to the back buffer, the client application is responsible for properly rotating its view. This can generally be done by applying a rotation to a view matrix.
[in] | evas_gl | The current Evas_GL object |
const char* evas_gl_string_query | ( | Evas_GL * | evas_gl, |
int | name | ||
) |
Returns a pointer to a static, null-terminated string describing some aspect of Evas GL.
[in] | evas_gl | The given Evas_GL object |
[in] | name | A symbolic constant, only EVAS_GL_EXTENSIONS is supported for now |
Evas_GL_Surface* evas_gl_surface_create | ( | Evas_GL * | evas_gl, |
Evas_GL_Config * | cfg, | ||
int | w, | ||
int | h | ||
) |
Creates and returns a new Evas_GL_Surface object for GL Rendering.
[in] | evas_gl | The given Evas_GL object |
[in] | cfg | The pixel format and configuration of the rendering surface |
[in] | w | The width of the surface |
[in] | h | The height of the surface |
NULL
on failurevoid evas_gl_surface_destroy | ( | Evas_GL * | evas_gl, |
Evas_GL_Surface * | surf | ||
) |
Destroys an Evas GL Surface.
[in] | evas_gl | The given Evas_GL object |
[in] | surf | The given GL surface object |
Eina_Bool evas_gl_surface_query | ( | Evas_GL * | evas_gl, |
Evas_GL_Surface * | surface, | ||
int | attribute, | ||
void * | value | ||
) |
Query a surface for its properties.
[in] | evas_gl | The current Evas_GL object |
[in] | surface | An Evas_GL_Surface surface to query |
[in] | attribute | Specifies the attribute to query. |
[out] | value | Returns the requested value (usually an int) |
The currently accepted attributes are the following: