GLView

- Main Page
- Related Pages
- Data Structures
- Files
- Examples

Enumerations | Functions
GLView

## Enumerations
enum | Elm_GLView_Mode { , ELM_GLVIEW_ALPHA = (1<<1), ELM_GLVIEW_DEPTH = (1<<2), ELM_GLVIEW_STENCIL = (1<<3), ELM_GLVIEW_DIRECT = (1<<4), ELM_GLVIEW_CLIENT_SIDE_ROTATION = (1<<5), ELM_GLVIEW_DEPTH_8 = ELM_GLVIEW_DEPTH | (1 << 6), ELM_GLVIEW_DEPTH_16 = ELM_GLVIEW_DEPTH | (2 << 6), ELM_GLVIEW_DEPTH_24 = ELM_GLVIEW_DEPTH | (3 << 6), ELM_GLVIEW_DEPTH_32 = ELM_GLVIEW_DEPTH | (4 << 6), ELM_GLVIEW_STENCIL_1 = ELM_GLVIEW_STENCIL | (1 << 9), ELM_GLVIEW_STENCIL_2 = ELM_GLVIEW_STENCIL | (2 << 9), ELM_GLVIEW_STENCIL_4 = ELM_GLVIEW_STENCIL | (3 << 9), ELM_GLVIEW_STENCIL_8 = ELM_GLVIEW_STENCIL | (4 << 9), ELM_GLVIEW_STENCIL_16 = ELM_GLVIEW_STENCIL | (5 << 9), ELM_GLVIEW_MULTISAMPLE_LOW = (1 << 12), ELM_GLVIEW_MULTISAMPLE_MED = (2 << 12), ELM_GLVIEW_MULTISAMPLE_HIGH = (3 << 12) }
| Selects the target surface properties. More...
enum | Elm_GLView_Resize_Policy { ELM_GLVIEW_RESIZE_POLICY_RECREATE = 1, ELM_GLVIEW_RESIZE_POLICY_SCALE = 2 }
| Defines a policy for the glview resizing. More...
enum | Elm_GLView_Render_Policy { ELM_GLVIEW_RENDER_POLICY_ON_DEMAND = 1, ELM_GLVIEW_RENDER_POLICY_ALWAYS = 2 }
| Defines a policy for gl rendering. More...

## Functions
Evas_Object * | elm_glview_add (Evas_Object *parent)
| Add a new glview to the parent. More...

## Detailed Description

A GLView widget allows for simple GL rendering in elementary environment. GLView hides all the complicated evas_gl details so that the user only has to deal with registering a few callback functions for rendering to a surface using OpenGL APIs.

This widget emits the following signals, besides the ones sent from GLView:

- `"focused"` - when glview has received focus.
- `"unfocused"` - when glview has lost focus.
- `"language,changed"` - the program's language changed

Below is an illustrative example of how to use GLView and and OpenGL to render in elementary environment. glview_example_01_page

## Enumeration Type Documentation

enum Elm_GLView_Mode

Selects the target surface properties.

An OR combination of `Elm_GLView_Mode` values should be passed to elm_glview_mode_set when setting up a GL widget. These flags will specify the properties of the rendering target surface; in particular, the mode can request the surface to support alpha, depth and stencil buffers.

Note
  `ELM_GLVIEW_CLIENT_SIDE_ROTATION` is a special value that indicates to EFL that the application will handle the view rotation when the device is rotated. This is needed only when the application requests direct rendering. Please refer to Evas_GL for more information about direct rendering.

See also
  elm_glview_mode_set
  elm_opengl_page

Enumerator
ELM_GLVIEW_ALPHA | Alpha channel enabled rendering mode.
ELM_GLVIEW_DEPTH | Depth buffer enabled rendering mode (24 bits by default)
ELM_GLVIEW_STENCIL | Stencil buffer enabled rendering mode (8 bits by default)
ELM_GLVIEW_DIRECT | Request direct rendering, unless there must be a fallback.
ELM_GLVIEW_CLIENT_SIDE_ROTATION | Client will handle GL view rotation if direct rendering is enabled.
ELM_GLVIEW_DEPTH_8 | Request min. 8 bits for the depth buffer
ELM_GLVIEW_DEPTH_16 | Request min. 16 bits for the depth buffer
ELM_GLVIEW_DEPTH_24 | Request min. 24 bits for the depth buffer (default)
ELM_GLVIEW_DEPTH_32 | Request min. 32 bits for the depth buffer
ELM_GLVIEW_STENCIL_1 | Request min. 1 bits for the stencil buffer
ELM_GLVIEW_STENCIL_2 | Request min. 2 bits for the stencil buffer
ELM_GLVIEW_STENCIL_4 | Request min. 4 bits for the stencil buffer
ELM_GLVIEW_STENCIL_8 | Request min. 8 bits for the stencil buffer (default)
ELM_GLVIEW_STENCIL_16 | Request min. 16 bits for the stencil buffer
ELM_GLVIEW_MULTISAMPLE_LOW | MSAA with minimum number of samples.
ELM_GLVIEW_MULTISAMPLE_MED | MSAA with half the number of maximum samples.
ELM_GLVIEW_MULTISAMPLE_HIGH | MSAA with maximum number of samples.

enum Elm_GLView_Render_Policy

Defines a policy for gl rendering.

The rendering policy tells glview where to run the gl rendering code. ELM_GLVIEW_RENDER_POLICY_ON_DEMAND tells glview to call the rendering calls on demand, which means that the rendering code gets called only when it is visible.

Note
  Default is ELM_GLVIEW_RENDER_POLICY_ON_DEMAND

Enumerator
ELM_GLVIEW_RENDER_POLICY_ON_DEMAND | Render only when there is a need for redrawing.
ELM_GLVIEW_RENDER_POLICY_ALWAYS | Render always even when it is not visible.

enum Elm_GLView_Resize_Policy

Defines a policy for the glview resizing.

The resizing policy tells glview what to do with the underlying surface when resize happens. ELM_GLVIEW_RESIZE_POLICY_RECREATE will destroy the current surface and recreate the surface to the new size. ELM_GLVIEW_RESIZE_POLICY_SCALE will instead keep the current surface but only display the result at the desired size scaled.

Note
  Default is ELM_GLVIEW_RESIZE_POLICY_RECREATE

Enumerator
ELM_GLVIEW_RESIZE_POLICY_RECREATE | Resize the internal surface along with the image.
ELM_GLVIEW_RESIZE_POLICY_SCALE | Only resize the internal image and not the surface.

## Function Documentation

Evas_Object* elm_glview_add | ( | Evas_Object * | parent | ) |

Add a new glview to the parent.

Parameters

  parent | The parent object

Returns
  The new object or NULL if it cannot be created