BES is built without X, as it uses SGX OpenGL ES on the framebuffer. SDL
1.2 initializes for ALSA audio, input via the framebuffer (i.e. keyboard
input) and Linux joystick devices, and video using full-screen 16 BPP with
the framebuffer target. I fill the framebuffer with all black pixels and
then ignore it (so no SDL_Flip() or SDL_UpdateRect() calls). The emulators
render into SDL_Surfaces, and I take the pixel data of these surfaces,
copy them into GLES textures, and then map those textures onto a pair of
triangles covering the entire screen. This gives me scaling and bilinear
filtering to any size display without requiring a software scaler.
Whenever I'm going to process the SDL event loop, I first check the
BBB-specific inputs (PRU gamepads or GPIO inputs), generate the
appropriate SDL_Events to represent input events, and then add those key
events into the SDL event queue as key events. Then I do the SDL event
loop and process key and joystick events as I normally would. This makes
the hardware-specific inputs appear as keypresses to the emulators and
front-end GUI. The block of GPIOs I use for the 12 gamepad inputs (4
d-pad, 8 buttons, 1 pause button) are the pins on the P8 header that
aren't blocked by the LCD3 cape. If you want to change the GPIOs that are
used, the GPIO numbers are stored in BES's SQL database.
As for your EGL error, I suspect it is a change in datatype definitions.
I've had a few people mention similar things regarding EGL. Don't install
the Mesa headers. Or rather, the Mesa OpenGL headers should be OK, but the
EGL ones will not be. Instead, point to the reference implementation
headers from Khronos:
https://www.khronos.org/registry/EGL/api/EGL/
An apt-get of the Mesa EGL headers will get headers intended to run on an
X11-based system. Look at the Khronos API reference for
eglCreateWindowSurface():
https://www.khronos.org/registry/EGL/sdk/docs/man/html/eglCreateWindowSurface.xhtml
The third parameter is of type NativeWindowType, which is intended to be a
"placeholder" for the proper datatype. Now look at the Mesa and Khronos
reference headers:
https://github.com/mesa3d/mesa/blob/master/include/EGL/egl.h
https://www.khronos.org/registry/EGL/api/EGL/egl.h
These two list the third parameter as having the type EGLNativeWindowType.
As the API changes, it must remain binary compatible with older versions
of the GLES libraries. The actual datatype of EGLNativeWindowType varies a
lot depending upon the particular platform you are working on, and the
Mesa and Khronos reference implementations differ in that regard:
https://github.com/mesa3d/mesa/blob/master/include/EGL/eglplatform.h
https://www.khronos.org/registry/EGL/api/EGL/eglplatform.h
So, use the Khronos EGL headers, not the ones from Mesa, and you should
get a clean build. Alternatively, you can force a cast on that parameter
and it will probably work for you OK.
I've been meaning to get around to putting some fixes into BES and clean
up its code in the next month or two, so I'll pull in any patches that you
want to throw my way.
Andrew
> --
> You received this message because you are subscribed to the Google Groups
> "Beagle Alpha" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
beagle-alpha...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.
>
>