559 views
in Platform Packages by
Several modern chipsets contain a powerful 3D core and provide an access to the 3D hardware via OpenGL ES 2.0. I'm wondering, if OpenGL shaders can be used for own applications in case that an EmWi Platform Package with OpenGL ES 2.0 is used.

1 Answer

0 votes
by
First of all, one of the most important goals of Embedded Wizard is the aspect of platform independence. This means, that one and the same GUI application can be run on a target with a simple 2D accelerator, or on a target with OpenGL ES 2.0 or even on a target which does not have any graphics acceleration at all.

The Platform Package concept is not intended to extend the set of graphical operations with new operations. With Embedded Wizard our main intension was to provide a platform independent graphical system with a fix constant set graphical operations. Accordingly, the OpenGL ES 2.0 Platform Package comes with a set of shaders optimized for the required graphical operations. An extension would mean, that the new graphical operation should be implemented in the Graphics Engine and be routed to the Mosaic library. Beside the complexity, the platform independence is lost in such case!

However, you could implement your own vertex and fragment shader code and your own Open GL code, in order to draw into your private GL framebuffer. This framebuffer can co-exist on the screen or it can serve as a texture for Embedded Wizard.
by
Hello,

Is there any example available to see how this could be incorporated in Embedded Wizard?

Especially when we want to incorporate this as an image used by embedded Wizard, how do we make sure the texture is created by the shader before the render cycle occurs in Embedded Wizard.

Thanks & Regards,

Kavya
by

Hello Kavya,

although some of our customers have already done similar adaptation, we don't have any example demonstrating how to incorporate an externally created texture in Embedded Wizard GUI application using OpenGL ES.

From technical point of view it would require an enhancement of the ewextgfx.c module containing the interface between the platform independent Graphics Engine and the OpenGL ES API. Such adaptation should at least wrap the external texture within a XOpenGLSurface surface. As starting point see the implementation of the function OpenGLCreateSurface(). Analog to it you would implement a function e.g. OpenGLCreateWrappedSurface() expecting an externally created texture as parameter and wrapping it within an XOpenGLSurface structure.

Such surface can then be used as any other surface created by Embedded Wizard. For example you can display the surface by using the function OpenGLCopyDriver(). Since the externally created texture is managed externally you would also need to invoke OpenGLCopyDriver() at the right moment during the screen update process.

Important: the OpenGL context used in your implementation and the context used by Embedded Wizard should be configured to share the resources. Otherwise Embedded Wizard will not be able to use any texture created outside Embedded Wizard.

Since the integration of externally created textures within Embedded Wizard GUI has been asked more frequently in recent times, we have enhanced the Embedded Wizard by new API to create such 'wrapped' bitmaps. This new functionality will be available in the next version that we plan to release in the fall.

Does it answer your question?

Best regards

Paul Banach

 

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...