Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to change the size of the rendering surface in opengl/egl?

Tags:

opengl-es

egl

I am working in OpenGL ES 2.0 with C. (Not Android) I want to change the size of the egl surface so that i can render two different contexts on the screen at the same time.

Is it possible to resize the egl surface?

like image 257
Arun AC Avatar asked Nov 21 '25 03:11

Arun AC


1 Answers

What platform / window system is being used ? The windowsurface comes from the "window" - and hence depends on the windowsystem - for example, if using X, it will come from a client window. If using fullscreen "NULL" windowsystem, the size of the framebuffer. If Qt, a widgetsurface or similar.

Example using a NULL system is below:

https://github.com/prabindh/sgxperf/blob/master/sgxperf_gles20_vg.cpp

To answer - EGL only refers to a window already created, hence cannot resize it by itself. When a client window is resized, EGL then has to update its internals, not the other way round.

You can use glviewport to target different areas of the screen.

like image 112
Prabindh Avatar answered Nov 24 '25 01:11

Prabindh