Typical UI development with OpenGL ES
作者:
刘鹏
刘鹏
日期:
2010-05-10
本文介绍了使用 OpenGL ES 开发 UI 需要考虑的问题和基本开发思路。
需要考虑的问题
Shapes
- Convert to meshes based on primitives (ex, using 3DStudio plugins)
Artwork
- Texture, Mip Maps, filtering modes, lighting (in compressed or uncompressed formats)
Animation
- Path description, timing, dynamic changes, rotation (Write shader logic)
Transparency
- Alpha setting
- Alpha blending
Programming the display path
- Display driver interfaces and HW
Performance tuning
- Pipelining
- Compressed textures
Getting the final image to the display
Case 1 (Full ownership mode)
The final image can be directly written to the framebuffer in full
screen mode by EGL itset.
Case 2 (Partner mode - work with other applications)
- OpenGL allows reading back the composited image from the gl frame
buffer. glReadPixels (xpos, ypos, xwidth, yheight, format, type, dataptr); - Caveat: This flushes the pipeline.Benchmark for your target app.
- Now the data is in the external application/driver
- Regular alpha blending/compositing operations can be performed on
this data.
Application Integration
- Write separate application, directly use EGL for display to frame buffer
- Use application framework like Clutter
to build
applications. Configure Clutter
to use OpenGL ES backend - Use GTK
/QT
to manage the Graphics
output.