Enable OpenGL ES 2.0 on RPi

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;
    return ofRunApp(new ofApp);

i tried (like in customEGLWindowSettings example)

ofAppEGLWindow window;
ofAppEGLWindow::Settings settings;
settings.glesVersion = 2;
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;
ofSetupOpenGL(&window, 1280, 720, OF_FULLSCREEN);


[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
i thought it was related, but i am not sure…

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

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…

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 !