I've tried to access my Raspberry Pi(running Raspbian) using SSH with -X
flag. On my host machine(Ubuntu 14.04 x64), I can run graphic programs like browser, however, when I want to execute the sample program of OpenGL ES with EGL from /opt/vc/src/hello_pi/hello_triangle
, it cannot display the window. I tried to use HDMI with Raspberry Pi and run it on itself, it works.
Could anyone tell me why? Is EGL here using X11 to get the native window or not?
1 Answer 1
ssh's -X sets the DISPLAY environment variable such that all X requests are sent to the host. EGL has no X11 wire protocol, so EGL can't be forwarded to your host's X Server. For EGL, you'd need to run the application on an X Server on the Pi, then use something like lightpipe to scrape the pixels on the Pi's X Server and forward them to your host. It'll be terribly slow, because reading pixels back is hard.
If you were running a GLX application instead it might work (though GLX is fairly crippled relative to direct rendering). Note that this may not do what you were expecting -- it seems like you want to be using the Pi's hardware rendering and just see its output, which is not how X11 forwarding works and a lightpipe-like application is the solution.
EGLGetDisplay
failed since there's no monitor connecting with it directly, but not try yet. I'll update after this trial later tonight.libGLES
-- Mesa is the non-hardware accelerated OGL. I'm sure the pi doesn't use it by default though. It just uses mesa for non-ES stuff, I think.