1 / 11

GUI thinking and testing ideas OpenGL GUI

GUI thinking and testing ideas OpenGL GUI. Root Team meeting 01/10/2010. Introduction.

ince
Download Presentation

GUI thinking and testing ideas OpenGL GUI

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. GUI thinking and testing ideasOpenGL GUI Root Team meeting 01/10/2010

  2. Introduction Implementing TVirtualX with OpenGL could allow a better portability and could probably allow to quickly port it on new platforms (e.g. Native Mac OSX) or even small devices (e.g. iPhone, iPad, Android, ...).

  3. Reminder: OpenGL Quoting OpenGL Red Book: "OpenGL is designed as a streamlined, hardware-independent interface to be implemented on many different hardware platforms. To achieve these qualities, no commands for performing windowing tasks or obtaining user input are included in OpenGL; instead, you must work through whatever windowing system controls the particular hardware you're using." Quoting MSDN: "An OpenGL application with Windows uses either the windowing system of the target platform (X Windows or Windows), or a cross-platform library such as the OpenGL Graphics Library Utility Kit (GLUT)…"

  4. GLUT • OpenGL Utility Toolkit. It supports, among others: • Multiple windows for OpenGL rendering • Callback driven event processing • Support for bitmap and stroke fonts • Miscellaneous window management functions • …. • But, as specified on the OpenGL web page (http://www.opengl.org/resources/libraries/glut/): GLUT is designed for constructing small to medium sized OpenGL programs. While GLUT is well-suited to learning OpenGL and developing simple OpenGL applications, GLUT is not a full-featured toolkit so large applications requiring sophisticated user interfaces are better off using native window system toolkits. GLUT is simple, easy, and small. • Quick implementation of TVirtualX based on GLUT: It works!

  5. Examples Gui.Backend: native

  6. Examples Gui.Backend: glut

  7. Examples

  8. Issues • Major drawback: glut creates one Window and its GL Context per widget! This implies a lot of context switching when drawing / updating each GUI element (see next slide) • Glut has its own main event loop • Some events are missing (e.g. enter/leave mouse event on Windows) • Vents are not propagated across sub-windows (e.g. the canvas menu doesn't work) • No real font (e.g. FTGL) support, only fixed (hard-coded) font • No image support

  9. Issues • Performance issue (probably due to context switching – to be investigated): • Comparing with the native (win32) one: • So they are right, GLUT is not a full-featured toolkit... root [2] new TCanvas (class TCanvas*)0x3533218 Real time 0:00:15.632000, CP time 0.406 root [2] new TCanvas (class TCanvas*)0x34ba5e0 Real time 0:00:00.253000, CP time 0.218

  10. Other options • Using an already existing toolkit is difficult, since we have to: • Use a X11 (Xlib) like API (TVirtualX is almost a one to one bridge to xlib) • Be backward compatible with the ROOT GUI • Existing packages have been designed and optimized to be used with OpenGL

  11. What Next • If glut is really not an option, and if there is no alternative (i.e. no other toolkit), then start from scratch and implement a full Window manager in OpenGL, including: • Window management, with their relationship (parent/children) and their properties, keeping also the z-order • Graphics Context (GC) management • Pixmap management (conversion to OpenGL textures for rendering) • Font management (using FTGL) – how to get font properties? • Event handling mechanism with proper propagation among windows • The platform (WM) dependent part being only the creation of the top level Windows (containers) and the event handling

More Related