SlideShare una empresa de Scribd logo
1 de 30
OpenGL ES EGL Spec & APIs
SK planet/Mobile Platform Dept.
Jungsoo Nam
namjungsoo@gmail.com
OpenGL ARB and Khronos Group
• OpenGL ES
– OpenGL ES is a lightweight graphics API which is designed for Embedded
System from OpenGL which is designed for Work Station.
– OpenGL is maintained by OpenGL ARB(Architecture Review Board), OpenGL
ES is maintained Khronos Group.
OpenGL Driver and Implementation
• OpenGL Terminology(Link)
Name Description
ICD Installable Client Driver, contains the entire rendering pipeline of OpenGL. This solution, while providing the highest
possible performance, was also daunting to IHVs. The Microsoft ICD kit required considerable effort to turn into a driver.
SGI's DDK is also an ICD, but comes with a sample driver (for Virge/GX) as an example.
IHV Independent Hardware Vendor, the manufacturers of 3D accelerators.
MCD Mini Client Driver, designed as an abstraction of the rasterization layer of the rendering pipeline. The MCD promised to
make developing OpenGL drivers for Windows easy for IHVs. Released for Windows/NT, it was promised, then never
delivered for Win95. The MCD also gave up considerable performance due to it's design.
PFD Pixel Format Descriptor, describes the pixel depth and buffers available.
OpenGL Utility Libraries
Prefix Name Functions
gl OpenGL API glClear,glDrawArrays,…
glu OpenGL Utility Library gluPerspective,gluLookAt
glut OpenGL Utility Toolkit glutInitDisplayMode,glutSwapBuffers
aux OpenGL Auxiliary Library auxDIBImageLoad,auxInitWindow
glew OpenGL Extension Wrangler Library glewInit, glewIsSupported
wgl/agl/cgl/glx/egl Native Interface for OpenGL wglCreateContext,wglMakeCurrent,eglCr
eateContext,eglMakeCurrent
GLU
• OpenGL Utility Library
– Matrix support
• gluPerspective, gluOrtho, gluLookAt
– Modeling support(GLUquadric)
• gluDisk, gluPartialDisk, gluSphere, gluCylinder, gluCone
GLAUX
• OpenGL Auxiliary Library
– which was a part of the GLUT library and is now obsolete. We need to rewrite
the program using GLUT.
GLUT
• The OpenGL Utility Toolkit
– GLUT (pronounced like the glut in gluttony) is the OpenGL Utility Toolkit, a window system
independent toolkit for writing OpenGL programs. It implements a simple windowing application
programming interface (API) for OpenGL. GLUT makes it considerably easier to learn about and
explore OpenGL programming. GLUT provides a portable API so you can write a single OpenGL
program that works across all PC and workstation OS platforms.
• Usage
– Window system support
– Modeling support
• glutSolid/WireCube
• glutSolid/WireSphere
• glutSolid/WireTorus
• glutSolid/WireTeapot
• glutSolid/WireDodecahedron(12면체)
GLEW
• The OpenGL Extension Wrangler Library
– http://glew.sourceforge.net/basic.html
• Usage
– Initializing
– Checking extensions
• How to get WGL extension
WGL
• OpenGL Native Interface for Windows
– WGL or Wiggle is an API between OpenGL and the windowing system interface of Microsoft
Windows.
• http://nehe.gamedev.net/tutorial/creating_an_opengl_window_(win32)/13001/
ChoosePixelFormat()
SetPixelFormat()
wglCreateContext()
wglMakeCurrent()
EGL (Native Platform Graphics
Interface) Overview
• Native Platform Interface
– EGL™ is an interface between Khronos rendering APIs such as OpenGL ES or OpenVG and the
underlying native platform window system. It handles graphics context management, surface/buffer
binding, and rendering synchronization and enables high-performance, accelerated, mixed-mode 2D
and 3D rendering using other Khronos APIs. EGL also provides interop capability between Khronos to
enable efficient transfer of data between APIs – for example between a video subsystem running
OpenMAX AL and a GPU running OpenGL ES.
• Portable Layer for Graphics Resource Management
– EGL can be implemented on multiple operating systems (such as Android and Linux) and native
window systems (such as X and Microsoft Windows). Implementations may also choose to allow
rendering into specific types of EGL surfaces via other supported native rendering APIs, such as Xlib
or GDI. EGL provides:
• Mechanisms for creating rendering surfaces (windows, pbuffers, pixmaps) onto which client APIs can draw and
share
• Methods to create and manage graphics contexts for client APIs
• Ways to synchronize drawing by client APIs as well as native platform rendering APIs.
EGL Features
• Specifically EGL is a wrapper over the following subsystems;
– WGL – Windows GL – the Windows-OpenGL interface (pronounced wiggle)
– CGL – the Mac OS X-OpenGL interface (the AGL layer sits on top of CGL)
– GLX – the equivalent X11-OpenGL interface
• EGL not only provides a convenient binding between the operating system
resources and the OpenGL subsystem, but also provides the hooks to the
operating system to inform it when you require something, such as;
1. Iterating, selecting, and initializing an OpenGL context
2. This can be the OGL API level, software vs. hardware rendering, etc.
3. Requesting a surface or memory resource.
4. The OS services requests for system or video memory
5. Iterating through the available surface formats (to pick an optimal one)
6. You can find out properties of the video card(s) from the OS – the surfaces presented will
resides on the video card(s) or software renderer interface.
7. Selecting the desired surface format
8. Informing the OS you are done rendering and it’s time to show the scene.
9. Informing the OS to use a different OpenGL context
10. Informing the OS you are done with the resources.
EGLWindow, EGLDisplay, EGLSurface
• EGLDisplay
– Abstract display on which graphics are drawn
– Single physical screen
– Initialize by querying a default display
– All EGL objects are associated with an EGLDisplay
• EGLContext(Rendering Contexts)
– EGLContext is a state machine defined by a client API
– EGLContext is associated with EGLSurfaces
• EGLSurface(Drawing Surfaces)
– Types: windows, pbuffers, pixmaps
• Windows, pixmaps: tied to native window system
– Created with EGLConfig
• Describes depth of color buffer component and types, quantities, and sizes of the ancillary buffers(depth,
multisample, stencil buffers)
– Ancillary buffers are associated with an EGLSurface
• Not EGLContext
EGL Operation
• Interaction with native rendering
– Native rendering will always be supported by pixmap surfaces
• Pixmap surfaces have restricted capabilities and performance relative to window and pbuffer surfaces
– Native rendering will not be supported by pbuffer surfaces, since the color buffers of pbuffers are allocated internally by EGL and
are not accessible through any other means.
– Native rendering may be supported by window surfaces, but only if the native window system has a compatible rendering model
allowing it to share the back color buffer, or if single buffered rendering to the window surface is being done.
– When both native rendering APIs and client APIs are drawing into the same underlying surface, no guarantees are placed on the
relative order of completion of operations in the different rendering streams other than those provided by the synchronization
primitives discussed in section 3.8
• Shared State
– OpenGL and OpenGL ES Texture Objects
• OpenGL and OpenGL ES makes no attempt to synchronize access to texture objects. If a texture object is bound to more than
one context, then it is up to the programmer to ensure that the contents of the object are not being changed via one context
while another context is using the texture object for rendering. The results of changing a texture object while another context
is using it are undefined.
– OpenGL and OpenGL ES Buffer Objects
• hen it is up to the programmer to ensure that the contents of the object are not being changed via one context while another
context is using the buffer object for rendering. The results of changing a buffer object while another context is using it are
undefined.
• Multiple Threads
– EGL guarantees sequentially within a command stream for each of its client APIs , but not between these APIs and native APIs
which may also be rendering into the same surface.
– Client API commands are not guaranteed to be atomic.
• Synchronization is in the hands of the client.
• It can be maintained at moderate cost with the judicious use of commands such as glFinish, vgFinish, eglWaitClient, and
eglWaitNative, as well as (if they exist) synchronization commands present in native rendering APIs.
EGL Operation
• Power Management
– Power management events can occur synchronously while an
application is running. When the system returns from the power
management event the EGLContext will be invalidated, and all
subsequent client API calls will have no effect (as if no context is
bound).
– Following a power management event, calls to eglSwapBuffers,
eglCopyBuffers, or eglMakeCurrent will indicate failure by returning
EGL_FALSE. The error EGL_CONTEXT_LOST will be returned if a power
management event has occurred.
• On detection of this error, the application must destroy all contexts (by calling
eglDestroyContext for each context). To continue rendering the application must
recreate any contexts it requires, and subsequently restore any client API state and
objects it wishes to use.
• Any EGLSurfaces that the application has created need not be destroyed following a
power management event, but their contents will be invalid.
EGL Basic Usage
• The basic usage of EGL and similar API are the following;
1. (Android) Obtain the EGL interface.
• So you can make EGL calls
2. Obtain a display that’s associated with an app or physical display
3. Initialize the display
4. Configure the display
5. Create surfaces
• Front, back, offscreen buffers, etc.
6. Create a context associated with the display
• This holds the “state” for the OpenGL calls
7. Make the context “current”
• This selects the active state
8. Render with OpenGL (OpenGL not EGL calls, the OpenGL state is held by EGL context)
9. Flush or swap the buffers so EGL tells the OS to display the rendered scene. Repeat
rendering till done.
10. Make the context “not current”
11. Clean up the EGL resources
OpenGL Framebuffer(Ancillary buffer)
• Framebuffer(Ancillary buffer)
– A Framebuffer is a collection of buffers that can be used as
the destination for rendering.
Name Description
Color Buffer Double buffering, stereo buffering
glDrawBuffer,glReadBuffer,glClearColor
Depth Buffer Shadow map, internal rendering
glDepthFunc,glClearDepth
Stencil Buffer Shadow volume, color masking, reflection
glStencilFunc,glStencilOp,glClearStencil
Accum Buffer Motion blur, anti-aliasing
glAccum,glClearAccum
Functions Parameters
glClear GL_COLOR_BUFFER_BIT,GL_DEPTH_BUFFER_BIT,GL_STENCIL_BUFFER_BIT,GL_ACC
UM_BUFFER_BIT
glEnable GL_DEPTH_TEST, GL_STENCIL_TEST
API Usage (1/2)
API Usage (2/2)
Initializing
Funtion Description
EGLDisplay eglGetDisplay(EGLNativeDisplayType
display_id);
EGL_DEFAULT_DISPLAY
EGLBoolean eglInitialize(EGLDisplay dpy, EGLint
*major, EGLint *minor);
the values of *major and *minor would be 1 and 2, respectively).
major and minor are not updated if they are specified as NULL.
EGLBoolean eglTerminate(EGLDisplay dpy);
const char *eglQueryString(EGLDisplay dpy, EGLint
name);
EGL_CLIENT_APIS, EGL_EXTENSIONS, EGL_VENDOR, or EGL_
VERSION.
Configuration
Funtion Description
EGLBoolean eglGetConfigs(EGLDisplay dpy,
EGLConfig *configs, EGLint config_size,
EGLint *num_config);
Get configs
EGLBoolean eglChooseConfig(EGLDisplay dpy,
const
EGLint *attrib_list, EGLConfig *configs,
EGLint config_size, EGLint *num_config);
Choose configs by attrib_list
EGLBoolean eglGetConfigAttrib(EGLDisplay dpy,
EGLConfig config, EGLint attribute, EGLint
*value);
Get config attribs
Surface
Funtion Description
EGLSurface eglCreateWindowSurface(EGLDisplay dpy,
EGLConfig config, EGLNativeWindowType win,
const EGLint *attrib_list);
Create surface for window rendering
EGLSurface eglCreatePbufferSurface(EGLDisplay dpy,
EGLConfig config, const EGLint
*attrib_list);
Create surface for offline rendering
EGLSurface eglCreatePbufferFromClientBuffer(EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer,
EGLConfig config, const EGLint *attrib_list);
Create surface for offline rendering from
client buffer
EGLSurface eglCreatePixmapSurface(EGLDisplay dpy,
EGLConfig config, EGLNativePixmapType
pixmap, const EGLint *attrib_list);
Create surface for pixmap rendering
EGLBoolean eglDestroySurface(EGLDisplay dpy,
EGLSurface surface);
Destroy a surface
EGLBoolean eglSurfaceAttrib(EGLDisplay dpy,
EGLSurface surface, EGLint attribute,
EGLint value);
Get surface attributes
EGLBoolean eglQuerySurface(EGLDisplay dpy,
EGLSurface surface, EGLint attribute,
EGLint *value);
Get surface attributes
Rendering to Textures
Funtion Description
EGLBoolean eglBindTexImage(EGLDisplay dpy,
EGLSurface surface, EGLint buffer);
Bind OpenGL ES Texture
EGLBoolean eglReleaseTexImage(EGLDisplay dpy,
EGLSurface surface, EGLint buffer);
Release OpenGL ES Texture
Context
Funtion Description
EGLBoolean eglBindAPI(EGLenum api); EGL_OPENGL_API,
EGL_OPENGL_ES_API, or EGL_OPENVG_API.
EGLenum eglQueryAPI(void); The value returned will be one of the valid api parameters to
eglBindAPI, or
EGL_NONE.
EGLContext eglCreateContext(EGLDisplay dpy,
EGLConfig config, EGLContext share_context,
const EGLint *attrib_list);
Create a context
EGLBoolean eglDestroyContext(EGLDisplay dpy,
EGLContext ctx);
Destroy a context
EGLBoolean eglMakeCurrent(EGLDisplay dpy,
EGLSurface draw, EGLSurface read,
EGLContext ctx);
Set context to current context
EGLContext eglGetCurrentContext(void); Get current context
EGLSurface eglGetCurrentSurface(EGLint readdraw); Get current surface
EGLDisplay eglGetCurrentDisplay(void); Get current display
EGLBoolean eglQueryContext(EGLDisplay dpy,
EGLContext ctx, EGLint attribute, EGLint
*value);
Return attribute list
Syncronization
Funtion Description
EGLBoolean eglWaitClient(void); The same result can be achieved using client API -specific calls
such as glFinish
or vgFinish.
EGLBoolean eglWaitGL(void); EGLenum api = eglQueryAPI();
eglBindAPI(EGL_OPENGL_ES_API);
eglWaitClient();
eglBindAPI(api);
Posting the color buffer
Funtion Description
EGLBoolean eglSwapBuffers(EGLDisplay dpy,
EGLSurface surface);
Posting to a Window
When native window resizing, called automatically
EGLBoolean eglCopyBuffers(EGLDisplay dpy,
EGLSurface surface, EGLNativePixmapType
target);
Copying to a Native Pixmap
EGLBoolean eglSwapInterval(EGLDisplay dpy, EGLint
interval);
Control swap buffer interval
EGL Extension
Funtion Description
void (*eglGetProcAddress(const char *procname))(void); eglQueryString(dpy, EGL_EXTENSIONS)
GLSurfaceView
• Features
– Inherited from SurfaceView
– EGL encapsulation
• Functions
– setRenderer()
– setEGLConfigChooser()
• Default egl config chooser included
– setRenderMode()
• RENDERMODE_WHEN_DIRTY
• requestRender()
– setDebugFlags()
• DEBUG_CHECK_GL_ERROR
• DEBUG_LOG_GL_CALLS
GLSurfaceView.Renderer
• Functions
– onSurfaceCreate()
• Create window surface
– onSurfaceChanged()
• Surface size changed
– onDrawFrame()
• Automatically eglSwapBuffers when non-dirty rendering
PBuffer example
Thank you
• Q & A

Más contenido relacionado

La actualidad más candente

Project meeting: Android Graphics Architecture Overview
Project meeting: Android Graphics Architecture OverviewProject meeting: Android Graphics Architecture Overview
Project meeting: Android Graphics Architecture OverviewYu-Hsin Hung
 
Jetpack Compose beginner.pdf
Jetpack Compose beginner.pdfJetpack Compose beginner.pdf
Jetpack Compose beginner.pdfAayushmaAgrawal
 
Unit Testing Android Applications
Unit Testing Android ApplicationsUnit Testing Android Applications
Unit Testing Android ApplicationsRody Middelkoop
 
Android Jetpack Compose - Turkey 2021
Android Jetpack Compose - Turkey 2021Android Jetpack Compose - Turkey 2021
Android Jetpack Compose - Turkey 2021Nelson Glauber Leal
 
BKK16-315 Graphics Stack Update
BKK16-315 Graphics Stack UpdateBKK16-315 Graphics Stack Update
BKK16-315 Graphics Stack UpdateLinaro
 
Grails Connecting to MySQL
Grails Connecting to MySQLGrails Connecting to MySQL
Grails Connecting to MySQLashishkirpan
 
Tizen 3.0's Window System Integration Layer of OpenGLES/EGL & Vulkan Driver
Tizen 3.0's Window System Integration Layer of OpenGLES/EGL & Vulkan DriverTizen 3.0's Window System Integration Layer of OpenGLES/EGL & Vulkan Driver
Tizen 3.0's Window System Integration Layer of OpenGLES/EGL & Vulkan DriverRyo Jin
 
Supporting multiple screens on android
Supporting multiple screens on androidSupporting multiple screens on android
Supporting multiple screens on androidLi SUN
 
Compose Camp - Jetpack Compose for Android Developers Introduction Session De...
Compose Camp - Jetpack Compose for Android Developers Introduction Session De...Compose Camp - Jetpack Compose for Android Developers Introduction Session De...
Compose Camp - Jetpack Compose for Android Developers Introduction Session De...JassGroup TICS
 
An Introduction to the Android Framework -- a core architecture view from app...
An Introduction to the Android Framework -- a core architecture view from app...An Introduction to the Android Framework -- a core architecture view from app...
An Introduction to the Android Framework -- a core architecture view from app...William Liang
 
Android activities & views
Android activities & viewsAndroid activities & views
Android activities & viewsma-polimi
 
Android Jetpack
Android Jetpack Android Jetpack
Android Jetpack Tudor Sirbu
 
Unity advanced computer graphics week 02
Unity advanced computer graphics week 02Unity advanced computer graphics week 02
Unity advanced computer graphics week 02Tri Thanh
 
Writing and using Hamcrest Matchers
Writing and using Hamcrest MatchersWriting and using Hamcrest Matchers
Writing and using Hamcrest MatchersShai Yallin
 
Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)
Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)
Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)Johan Andersson
 
Java 8 Date and Time API
Java 8 Date and Time APIJava 8 Date and Time API
Java 8 Date and Time APISualeh Fatehi
 
Appium Dockerization: from Scratch to Advanced Implementation - HUSTEF 2019
Appium Dockerization: from Scratch to Advanced Implementation - HUSTEF 2019Appium Dockerization: from Scratch to Advanced Implementation - HUSTEF 2019
Appium Dockerization: from Scratch to Advanced Implementation - HUSTEF 2019Sargis Sargsyan
 

La actualidad más candente (20)

Project meeting: Android Graphics Architecture Overview
Project meeting: Android Graphics Architecture OverviewProject meeting: Android Graphics Architecture Overview
Project meeting: Android Graphics Architecture Overview
 
Jetpack Compose beginner.pdf
Jetpack Compose beginner.pdfJetpack Compose beginner.pdf
Jetpack Compose beginner.pdf
 
Unit Testing Android Applications
Unit Testing Android ApplicationsUnit Testing Android Applications
Unit Testing Android Applications
 
Android Jetpack Compose - Turkey 2021
Android Jetpack Compose - Turkey 2021Android Jetpack Compose - Turkey 2021
Android Jetpack Compose - Turkey 2021
 
BKK16-315 Graphics Stack Update
BKK16-315 Graphics Stack UpdateBKK16-315 Graphics Stack Update
BKK16-315 Graphics Stack Update
 
Grails Connecting to MySQL
Grails Connecting to MySQLGrails Connecting to MySQL
Grails Connecting to MySQL
 
Tizen 3.0's Window System Integration Layer of OpenGLES/EGL & Vulkan Driver
Tizen 3.0's Window System Integration Layer of OpenGLES/EGL & Vulkan DriverTizen 3.0's Window System Integration Layer of OpenGLES/EGL & Vulkan Driver
Tizen 3.0's Window System Integration Layer of OpenGLES/EGL & Vulkan Driver
 
Supporting multiple screens on android
Supporting multiple screens on androidSupporting multiple screens on android
Supporting multiple screens on android
 
Compose Camp - Jetpack Compose for Android Developers Introduction Session De...
Compose Camp - Jetpack Compose for Android Developers Introduction Session De...Compose Camp - Jetpack Compose for Android Developers Introduction Session De...
Compose Camp - Jetpack Compose for Android Developers Introduction Session De...
 
Angular IO
Angular IOAngular IO
Angular IO
 
An Introduction to the Android Framework -- a core architecture view from app...
An Introduction to the Android Framework -- a core architecture view from app...An Introduction to the Android Framework -- a core architecture view from app...
An Introduction to the Android Framework -- a core architecture view from app...
 
OpenGL SC 2.0 Quick Reference
OpenGL SC 2.0 Quick ReferenceOpenGL SC 2.0 Quick Reference
OpenGL SC 2.0 Quick Reference
 
Android activities & views
Android activities & viewsAndroid activities & views
Android activities & views
 
Android Jetpack
Android Jetpack Android Jetpack
Android Jetpack
 
Unity advanced computer graphics week 02
Unity advanced computer graphics week 02Unity advanced computer graphics week 02
Unity advanced computer graphics week 02
 
Writing and using Hamcrest Matchers
Writing and using Hamcrest MatchersWriting and using Hamcrest Matchers
Writing and using Hamcrest Matchers
 
Spring User Guide
Spring User GuideSpring User Guide
Spring User Guide
 
Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)
Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)
Parallel Graphics in Frostbite - Current & Future (Siggraph 2009)
 
Java 8 Date and Time API
Java 8 Date and Time APIJava 8 Date and Time API
Java 8 Date and Time API
 
Appium Dockerization: from Scratch to Advanced Implementation - HUSTEF 2019
Appium Dockerization: from Scratch to Advanced Implementation - HUSTEF 2019Appium Dockerization: from Scratch to Advanced Implementation - HUSTEF 2019
Appium Dockerization: from Scratch to Advanced Implementation - HUSTEF 2019
 

Similar a OpenGL ES EGL Spec&APIs

Seminar presentation on OpenGL
Seminar presentation on OpenGLSeminar presentation on OpenGL
Seminar presentation on OpenGLMegha V
 
Advanced Graphics Workshop - GFX2011
Advanced Graphics Workshop - GFX2011Advanced Graphics Workshop - GFX2011
Advanced Graphics Workshop - GFX2011Prabindh Sundareson
 
13th kandroid OpenGL and EGL
13th kandroid OpenGL and EGL13th kandroid OpenGL and EGL
13th kandroid OpenGL and EGLJungsoo Nam
 
OpenGL ES 2.0 Programming and Cocos2d-x v3.3 Rendering System
OpenGL ES 2.0 Programming and Cocos2d-x v3.3 Rendering SystemOpenGL ES 2.0 Programming and Cocos2d-x v3.3 Rendering System
OpenGL ES 2.0 Programming and Cocos2d-x v3.3 Rendering Systemoasiskim
 
Gdc 14 bringing unreal engine 4 to open_gl
Gdc 14 bringing unreal engine 4 to open_glGdc 14 bringing unreal engine 4 to open_gl
Gdc 14 bringing unreal engine 4 to open_glchangehee lee
 
Minko - Flash Conference #5
Minko - Flash Conference #5Minko - Flash Conference #5
Minko - Flash Conference #5Minko3D
 
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdfJIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdfSamiraKids
 
System Support for OpenGL Direct Rendering
System Support for OpenGL Direct RenderingSystem Support for OpenGL Direct Rendering
System Support for OpenGL Direct RenderingMark Kilgard
 
OpenGL ES based UI Development on TI Platforms
OpenGL ES based UI Development on TI PlatformsOpenGL ES based UI Development on TI Platforms
OpenGL ES based UI Development on TI PlatformsPrabindh Sundareson
 
Why is EFL used on Tizen?
Why is EFL used on Tizen?Why is EFL used on Tizen?
Why is EFL used on Tizen?Ryo Jin
 
3 CG_U1_P2_PPT_3 OpenGL.pptx
3 CG_U1_P2_PPT_3 OpenGL.pptx3 CG_U1_P2_PPT_3 OpenGL.pptx
3 CG_U1_P2_PPT_3 OpenGL.pptxssuser255bf1
 
OpenGL Introduction.
OpenGL Introduction.OpenGL Introduction.
OpenGL Introduction.Girish Ghate
 
Embedded Graphics Drivers in Mesa (ELCE 2019)
Embedded Graphics Drivers in Mesa (ELCE 2019)Embedded Graphics Drivers in Mesa (ELCE 2019)
Embedded Graphics Drivers in Mesa (ELCE 2019)Igalia
 

Similar a OpenGL ES EGL Spec&APIs (20)

Seminar presentation on OpenGL
Seminar presentation on OpenGLSeminar presentation on OpenGL
Seminar presentation on OpenGL
 
Advanced Graphics Workshop - GFX2011
Advanced Graphics Workshop - GFX2011Advanced Graphics Workshop - GFX2011
Advanced Graphics Workshop - GFX2011
 
18csl67 vtu lab manual
18csl67 vtu lab manual18csl67 vtu lab manual
18csl67 vtu lab manual
 
Opengl basics
Opengl basicsOpengl basics
Opengl basics
 
13th kandroid OpenGL and EGL
13th kandroid OpenGL and EGL13th kandroid OpenGL and EGL
13th kandroid OpenGL and EGL
 
OpenGL ES 2.0 Programming and Cocos2d-x v3.3 Rendering System
OpenGL ES 2.0 Programming and Cocos2d-x v3.3 Rendering SystemOpenGL ES 2.0 Programming and Cocos2d-x v3.3 Rendering System
OpenGL ES 2.0 Programming and Cocos2d-x v3.3 Rendering System
 
Computer graphics workbook
Computer graphics workbookComputer graphics workbook
Computer graphics workbook
 
Gdc 14 bringing unreal engine 4 to open_gl
Gdc 14 bringing unreal engine 4 to open_glGdc 14 bringing unreal engine 4 to open_gl
Gdc 14 bringing unreal engine 4 to open_gl
 
Minko - Flash Conference #5
Minko - Flash Conference #5Minko - Flash Conference #5
Minko - Flash Conference #5
 
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdfJIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
 
Lesson 1 - OpenGL
Lesson 1 - OpenGLLesson 1 - OpenGL
Lesson 1 - OpenGL
 
System Support for OpenGL Direct Rendering
System Support for OpenGL Direct RenderingSystem Support for OpenGL Direct Rendering
System Support for OpenGL Direct Rendering
 
OpenGL ES based UI Development on TI Platforms
OpenGL ES based UI Development on TI PlatformsOpenGL ES based UI Development on TI Platforms
OpenGL ES based UI Development on TI Platforms
 
Data structures graphics library in computer graphics.
Data structures  graphics library in computer graphics.Data structures  graphics library in computer graphics.
Data structures graphics library in computer graphics.
 
Introduction to OpenGL.ppt
Introduction to OpenGL.pptIntroduction to OpenGL.ppt
Introduction to OpenGL.ppt
 
Why is EFL used on Tizen?
Why is EFL used on Tizen?Why is EFL used on Tizen?
Why is EFL used on Tizen?
 
3 CG_U1_P2_PPT_3 OpenGL.pptx
3 CG_U1_P2_PPT_3 OpenGL.pptx3 CG_U1_P2_PPT_3 OpenGL.pptx
3 CG_U1_P2_PPT_3 OpenGL.pptx
 
OpenGL Introduction.
OpenGL Introduction.OpenGL Introduction.
OpenGL Introduction.
 
Embedded Graphics Drivers in Mesa (ELCE 2019)
Embedded Graphics Drivers in Mesa (ELCE 2019)Embedded Graphics Drivers in Mesa (ELCE 2019)
Embedded Graphics Drivers in Mesa (ELCE 2019)
 
Android native gl
Android native glAndroid native gl
Android native gl
 

Más de Jungsoo Nam

AGDK tutorial step by step
AGDK tutorial step by stepAGDK tutorial step by step
AGDK tutorial step by stepJungsoo Nam
 
Android Grabber Module Proposal
Android Grabber Module ProposalAndroid Grabber Module Proposal
Android Grabber Module ProposalJungsoo Nam
 
Unity3D Audio Grabber design
Unity3D Audio Grabber designUnity3D Audio Grabber design
Unity3D Audio Grabber designJungsoo Nam
 
Android OpenGL ES Game ImageGrabber Final Report
Android OpenGL ES Game ImageGrabber Final ReportAndroid OpenGL ES Game ImageGrabber Final Report
Android OpenGL ES Game ImageGrabber Final ReportJungsoo Nam
 
Android RenderScript
Android RenderScriptAndroid RenderScript
Android RenderScriptJungsoo Nam
 
OpenGL Shading Language
OpenGL Shading LanguageOpenGL Shading Language
OpenGL Shading LanguageJungsoo Nam
 

Más de Jungsoo Nam (7)

NVIDIA CUDA
NVIDIA CUDANVIDIA CUDA
NVIDIA CUDA
 
AGDK tutorial step by step
AGDK tutorial step by stepAGDK tutorial step by step
AGDK tutorial step by step
 
Android Grabber Module Proposal
Android Grabber Module ProposalAndroid Grabber Module Proposal
Android Grabber Module Proposal
 
Unity3D Audio Grabber design
Unity3D Audio Grabber designUnity3D Audio Grabber design
Unity3D Audio Grabber design
 
Android OpenGL ES Game ImageGrabber Final Report
Android OpenGL ES Game ImageGrabber Final ReportAndroid OpenGL ES Game ImageGrabber Final Report
Android OpenGL ES Game ImageGrabber Final Report
 
Android RenderScript
Android RenderScriptAndroid RenderScript
Android RenderScript
 
OpenGL Shading Language
OpenGL Shading LanguageOpenGL Shading Language
OpenGL Shading Language
 

Último

Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 

Último (20)

Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 

OpenGL ES EGL Spec&APIs

  • 1. OpenGL ES EGL Spec & APIs SK planet/Mobile Platform Dept. Jungsoo Nam namjungsoo@gmail.com
  • 2. OpenGL ARB and Khronos Group • OpenGL ES – OpenGL ES is a lightweight graphics API which is designed for Embedded System from OpenGL which is designed for Work Station. – OpenGL is maintained by OpenGL ARB(Architecture Review Board), OpenGL ES is maintained Khronos Group.
  • 3. OpenGL Driver and Implementation • OpenGL Terminology(Link) Name Description ICD Installable Client Driver, contains the entire rendering pipeline of OpenGL. This solution, while providing the highest possible performance, was also daunting to IHVs. The Microsoft ICD kit required considerable effort to turn into a driver. SGI's DDK is also an ICD, but comes with a sample driver (for Virge/GX) as an example. IHV Independent Hardware Vendor, the manufacturers of 3D accelerators. MCD Mini Client Driver, designed as an abstraction of the rasterization layer of the rendering pipeline. The MCD promised to make developing OpenGL drivers for Windows easy for IHVs. Released for Windows/NT, it was promised, then never delivered for Win95. The MCD also gave up considerable performance due to it's design. PFD Pixel Format Descriptor, describes the pixel depth and buffers available.
  • 4. OpenGL Utility Libraries Prefix Name Functions gl OpenGL API glClear,glDrawArrays,… glu OpenGL Utility Library gluPerspective,gluLookAt glut OpenGL Utility Toolkit glutInitDisplayMode,glutSwapBuffers aux OpenGL Auxiliary Library auxDIBImageLoad,auxInitWindow glew OpenGL Extension Wrangler Library glewInit, glewIsSupported wgl/agl/cgl/glx/egl Native Interface for OpenGL wglCreateContext,wglMakeCurrent,eglCr eateContext,eglMakeCurrent
  • 5. GLU • OpenGL Utility Library – Matrix support • gluPerspective, gluOrtho, gluLookAt – Modeling support(GLUquadric) • gluDisk, gluPartialDisk, gluSphere, gluCylinder, gluCone
  • 6. GLAUX • OpenGL Auxiliary Library – which was a part of the GLUT library and is now obsolete. We need to rewrite the program using GLUT.
  • 7. GLUT • The OpenGL Utility Toolkit – GLUT (pronounced like the glut in gluttony) is the OpenGL Utility Toolkit, a window system independent toolkit for writing OpenGL programs. It implements a simple windowing application programming interface (API) for OpenGL. GLUT makes it considerably easier to learn about and explore OpenGL programming. GLUT provides a portable API so you can write a single OpenGL program that works across all PC and workstation OS platforms. • Usage – Window system support – Modeling support • glutSolid/WireCube • glutSolid/WireSphere • glutSolid/WireTorus • glutSolid/WireTeapot • glutSolid/WireDodecahedron(12면체)
  • 8. GLEW • The OpenGL Extension Wrangler Library – http://glew.sourceforge.net/basic.html • Usage – Initializing – Checking extensions • How to get WGL extension
  • 9. WGL • OpenGL Native Interface for Windows – WGL or Wiggle is an API between OpenGL and the windowing system interface of Microsoft Windows. • http://nehe.gamedev.net/tutorial/creating_an_opengl_window_(win32)/13001/ ChoosePixelFormat() SetPixelFormat() wglCreateContext() wglMakeCurrent()
  • 10. EGL (Native Platform Graphics Interface) Overview • Native Platform Interface – EGL™ is an interface between Khronos rendering APIs such as OpenGL ES or OpenVG and the underlying native platform window system. It handles graphics context management, surface/buffer binding, and rendering synchronization and enables high-performance, accelerated, mixed-mode 2D and 3D rendering using other Khronos APIs. EGL also provides interop capability between Khronos to enable efficient transfer of data between APIs – for example between a video subsystem running OpenMAX AL and a GPU running OpenGL ES. • Portable Layer for Graphics Resource Management – EGL can be implemented on multiple operating systems (such as Android and Linux) and native window systems (such as X and Microsoft Windows). Implementations may also choose to allow rendering into specific types of EGL surfaces via other supported native rendering APIs, such as Xlib or GDI. EGL provides: • Mechanisms for creating rendering surfaces (windows, pbuffers, pixmaps) onto which client APIs can draw and share • Methods to create and manage graphics contexts for client APIs • Ways to synchronize drawing by client APIs as well as native platform rendering APIs.
  • 11. EGL Features • Specifically EGL is a wrapper over the following subsystems; – WGL – Windows GL – the Windows-OpenGL interface (pronounced wiggle) – CGL – the Mac OS X-OpenGL interface (the AGL layer sits on top of CGL) – GLX – the equivalent X11-OpenGL interface • EGL not only provides a convenient binding between the operating system resources and the OpenGL subsystem, but also provides the hooks to the operating system to inform it when you require something, such as; 1. Iterating, selecting, and initializing an OpenGL context 2. This can be the OGL API level, software vs. hardware rendering, etc. 3. Requesting a surface or memory resource. 4. The OS services requests for system or video memory 5. Iterating through the available surface formats (to pick an optimal one) 6. You can find out properties of the video card(s) from the OS – the surfaces presented will resides on the video card(s) or software renderer interface. 7. Selecting the desired surface format 8. Informing the OS you are done rendering and it’s time to show the scene. 9. Informing the OS to use a different OpenGL context 10. Informing the OS you are done with the resources.
  • 12. EGLWindow, EGLDisplay, EGLSurface • EGLDisplay – Abstract display on which graphics are drawn – Single physical screen – Initialize by querying a default display – All EGL objects are associated with an EGLDisplay • EGLContext(Rendering Contexts) – EGLContext is a state machine defined by a client API – EGLContext is associated with EGLSurfaces • EGLSurface(Drawing Surfaces) – Types: windows, pbuffers, pixmaps • Windows, pixmaps: tied to native window system – Created with EGLConfig • Describes depth of color buffer component and types, quantities, and sizes of the ancillary buffers(depth, multisample, stencil buffers) – Ancillary buffers are associated with an EGLSurface • Not EGLContext
  • 13. EGL Operation • Interaction with native rendering – Native rendering will always be supported by pixmap surfaces • Pixmap surfaces have restricted capabilities and performance relative to window and pbuffer surfaces – Native rendering will not be supported by pbuffer surfaces, since the color buffers of pbuffers are allocated internally by EGL and are not accessible through any other means. – Native rendering may be supported by window surfaces, but only if the native window system has a compatible rendering model allowing it to share the back color buffer, or if single buffered rendering to the window surface is being done. – When both native rendering APIs and client APIs are drawing into the same underlying surface, no guarantees are placed on the relative order of completion of operations in the different rendering streams other than those provided by the synchronization primitives discussed in section 3.8 • Shared State – OpenGL and OpenGL ES Texture Objects • OpenGL and OpenGL ES makes no attempt to synchronize access to texture objects. If a texture object is bound to more than one context, then it is up to the programmer to ensure that the contents of the object are not being changed via one context while another context is using the texture object for rendering. The results of changing a texture object while another context is using it are undefined. – OpenGL and OpenGL ES Buffer Objects • hen it is up to the programmer to ensure that the contents of the object are not being changed via one context while another context is using the buffer object for rendering. The results of changing a buffer object while another context is using it are undefined. • Multiple Threads – EGL guarantees sequentially within a command stream for each of its client APIs , but not between these APIs and native APIs which may also be rendering into the same surface. – Client API commands are not guaranteed to be atomic. • Synchronization is in the hands of the client. • It can be maintained at moderate cost with the judicious use of commands such as glFinish, vgFinish, eglWaitClient, and eglWaitNative, as well as (if they exist) synchronization commands present in native rendering APIs.
  • 14. EGL Operation • Power Management – Power management events can occur synchronously while an application is running. When the system returns from the power management event the EGLContext will be invalidated, and all subsequent client API calls will have no effect (as if no context is bound). – Following a power management event, calls to eglSwapBuffers, eglCopyBuffers, or eglMakeCurrent will indicate failure by returning EGL_FALSE. The error EGL_CONTEXT_LOST will be returned if a power management event has occurred. • On detection of this error, the application must destroy all contexts (by calling eglDestroyContext for each context). To continue rendering the application must recreate any contexts it requires, and subsequently restore any client API state and objects it wishes to use. • Any EGLSurfaces that the application has created need not be destroyed following a power management event, but their contents will be invalid.
  • 15. EGL Basic Usage • The basic usage of EGL and similar API are the following; 1. (Android) Obtain the EGL interface. • So you can make EGL calls 2. Obtain a display that’s associated with an app or physical display 3. Initialize the display 4. Configure the display 5. Create surfaces • Front, back, offscreen buffers, etc. 6. Create a context associated with the display • This holds the “state” for the OpenGL calls 7. Make the context “current” • This selects the active state 8. Render with OpenGL (OpenGL not EGL calls, the OpenGL state is held by EGL context) 9. Flush or swap the buffers so EGL tells the OS to display the rendered scene. Repeat rendering till done. 10. Make the context “not current” 11. Clean up the EGL resources
  • 16. OpenGL Framebuffer(Ancillary buffer) • Framebuffer(Ancillary buffer) – A Framebuffer is a collection of buffers that can be used as the destination for rendering. Name Description Color Buffer Double buffering, stereo buffering glDrawBuffer,glReadBuffer,glClearColor Depth Buffer Shadow map, internal rendering glDepthFunc,glClearDepth Stencil Buffer Shadow volume, color masking, reflection glStencilFunc,glStencilOp,glClearStencil Accum Buffer Motion blur, anti-aliasing glAccum,glClearAccum Functions Parameters glClear GL_COLOR_BUFFER_BIT,GL_DEPTH_BUFFER_BIT,GL_STENCIL_BUFFER_BIT,GL_ACC UM_BUFFER_BIT glEnable GL_DEPTH_TEST, GL_STENCIL_TEST
  • 19. Initializing Funtion Description EGLDisplay eglGetDisplay(EGLNativeDisplayType display_id); EGL_DEFAULT_DISPLAY EGLBoolean eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor); the values of *major and *minor would be 1 and 2, respectively). major and minor are not updated if they are specified as NULL. EGLBoolean eglTerminate(EGLDisplay dpy); const char *eglQueryString(EGLDisplay dpy, EGLint name); EGL_CLIENT_APIS, EGL_EXTENSIONS, EGL_VENDOR, or EGL_ VERSION.
  • 20. Configuration Funtion Description EGLBoolean eglGetConfigs(EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config); Get configs EGLBoolean eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config); Choose configs by attrib_list EGLBoolean eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value); Get config attribs
  • 21. Surface Funtion Description EGLSurface eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list); Create surface for window rendering EGLSurface eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list); Create surface for offline rendering EGLSurface eglCreatePbufferFromClientBuffer(EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list); Create surface for offline rendering from client buffer EGLSurface eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint *attrib_list); Create surface for pixmap rendering EGLBoolean eglDestroySurface(EGLDisplay dpy, EGLSurface surface); Destroy a surface EGLBoolean eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value); Get surface attributes EGLBoolean eglQuerySurface(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value); Get surface attributes
  • 22. Rendering to Textures Funtion Description EGLBoolean eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer); Bind OpenGL ES Texture EGLBoolean eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer); Release OpenGL ES Texture
  • 23. Context Funtion Description EGLBoolean eglBindAPI(EGLenum api); EGL_OPENGL_API, EGL_OPENGL_ES_API, or EGL_OPENVG_API. EGLenum eglQueryAPI(void); The value returned will be one of the valid api parameters to eglBindAPI, or EGL_NONE. EGLContext eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list); Create a context EGLBoolean eglDestroyContext(EGLDisplay dpy, EGLContext ctx); Destroy a context EGLBoolean eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx); Set context to current context EGLContext eglGetCurrentContext(void); Get current context EGLSurface eglGetCurrentSurface(EGLint readdraw); Get current surface EGLDisplay eglGetCurrentDisplay(void); Get current display EGLBoolean eglQueryContext(EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value); Return attribute list
  • 24. Syncronization Funtion Description EGLBoolean eglWaitClient(void); The same result can be achieved using client API -specific calls such as glFinish or vgFinish. EGLBoolean eglWaitGL(void); EGLenum api = eglQueryAPI(); eglBindAPI(EGL_OPENGL_ES_API); eglWaitClient(); eglBindAPI(api);
  • 25. Posting the color buffer Funtion Description EGLBoolean eglSwapBuffers(EGLDisplay dpy, EGLSurface surface); Posting to a Window When native window resizing, called automatically EGLBoolean eglCopyBuffers(EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target); Copying to a Native Pixmap EGLBoolean eglSwapInterval(EGLDisplay dpy, EGLint interval); Control swap buffer interval
  • 26. EGL Extension Funtion Description void (*eglGetProcAddress(const char *procname))(void); eglQueryString(dpy, EGL_EXTENSIONS)
  • 27. GLSurfaceView • Features – Inherited from SurfaceView – EGL encapsulation • Functions – setRenderer() – setEGLConfigChooser() • Default egl config chooser included – setRenderMode() • RENDERMODE_WHEN_DIRTY • requestRender() – setDebugFlags() • DEBUG_CHECK_GL_ERROR • DEBUG_LOG_GL_CALLS
  • 28. GLSurfaceView.Renderer • Functions – onSurfaceCreate() • Create window surface – onSurfaceChanged() • Surface size changed – onDrawFrame() • Automatically eglSwapBuffers when non-dirty rendering