Enable OpenGL ES 2.0 on RPi

Hi,
my OF APP on RPi says GL_VERSION=‘OpenGL ES-CM 1.1’
but i’d like to use OpenGL ES 2.0 which is available on RPi…
is there a way to enable it ?
Thanks !

yes you can change main.cpp to:

#include "ofMain.h"
#include "ofApp.h"

int main(){
    ofGLESWindowSettings settings;
    settings.setGLESVersion(2);
    ofCreateWindow(settings);
    return ofRunApp(new ofApp);
}

i tried (like in customEGLWindowSettings example)

ofAppEGLWindow window;
ofAppEGLWindow::Settings settings;
settings.glesVersion = 2;
window.setup(settings);
ofSetupOpenGL(&window, 1280, 720, OF_FULLSCREEN);

but i end up with a SegFault.
The customEGLWindowSettings example fails too.

i was actually preparing an issue on github about that:
even without the specific gles version, it fails:

ofAppEGLWindow window;
ofAppEGLWindow::Settings settings;
//settings.glesVersion = 2;
window.setup(settings);
ofSetupOpenGL(&window, 1280, 720, OF_FULLSCREEN);

with

[notice ] ofAppEGLWindow: setupRPiNativeWindow(): screenRect: 720x480
[notice ] ofAppEGLWindow: setupRPiNativeWindow(): windowRect: 720x480
[notice ] ofAppEGLWindow: createSurface(): setting up EGL Display
[notice ] ofAppEGLWindow: createSurface(): EGL Display correctly set 0x1
Segmentation fault

So the SegFault seems to happen at line 535 of ofAppEGLWindow.cpp

I found another typo issue on the way in this investigation
(https://github.com/openframeworks/openFrameworks/issues/5305)
i thought it was related, but i am not sure…

Anyway, i will try your way, while you check this…
Thanks

Hi again,

your way works to enable OpenGL ES 2

but i end up with glGetError 0x502

i read somewhere that it might be a memory exhaust,
but i tried on a Rpi 3 with 256 and 512MB of memory allocated to the GPU…

EDIT: glGetError 0x502 is GL_INVALID_OPERATION
I try to draw in a framebuffer (or directly, same result) at draw time…
Any idea how i could fruther debug this ?

Thanks !

Ok that is another issue (and actually not one): i tried to draw an incomplete buffer.

Thanks for the initial answer !