I've been working on http://unrealvoodoo.org/git/glesport.git/ GLESPort, that translates OpenGL Calls to OpenGL ES by way of Mesa.
I don't have a Pi yet, I'm working on an Arm Chromebook running Ubuntu with the Mali OpenGL ES Driver Binaries Copied over from the Chrome OS.
Anyway, I thought some Pi owners my want to look at this code as a way of getting older OpenGL games running. When the code was fresh it supported Quake2 so games of that era should be made to work, I know there's an OpenGL ES port of YQuake2 for the Pi, but I've had some luck getting Quake 1 DarkPlaces to run under GLESPort, yet not very well.
The source code looks good, only it includes an outdated Mesa, tho I'm not sure that's an issue. It should be simple to add GLESv2 Calls if any programmer wants to pick up the project. It seems like it would be simpler than porting older titles one by one.
It's a bit confusing to compile, clone it from the git repo, then you'll want to edit:
/mesa-7.0.1~rc2/src/mesa/drivers/gles/glesdrv.h
Around Line #64:
Code: Select all
/* FIXME: Make this configurable */
#define EGL_LIBRARY_NAME "libEGL.so"
#define GLES_LIBRARY_NAME "libGLESv1_CM.so"You can also add:
Code: Select all
#define GLESv2 LIBRARY_NAME "libGLESv2.so" Now you'll want to edit the /mesa-7.0.1~rc2/src/mesa/Makefile:
Around Line #95:
Code: Select all
$(COMMON_DRIVER_OBJECTS) $(GL_LIB_DEPS) -LGLES_CMCode: Select all
$(COMMON_DRIVER_OBJECTS) $(GL_LIB_DEPS) -lGLESv1_CM -lEGLCode: Select all
$(COMMON_DRIVER_OBJECTS) $(GL_LIB_DEPS) -lGLESv1_CM -lEGL -lGLESv2Now you're ready to try and compile, here comes the tricky part.
cd to the /mesa-7.0.1~rc2/ dir and run:
Code: Select all
make realcleanCode: Select all
make linuxNext cd to the /mesa-7.0.1~rc2/src/mesa/
Code: Select all
cd /mesa-7.0.1~rc2/src/mesa/Code: Select all
make glesThis will take a while, so go get a cup of coffee, once it's done cd back to the /mesa-7.0.1~rc2/ dir
Code: Select all
cd ../Code: Select all
cd ../Code: Select all
makeCode: Select all
ln -fs /mesa-7.0.1~rc2/lib/libGL.so.7.0.1 /mesa-7.0.1~rc2/lib/libGL.so.1Now that we're done with that, run make again:
Code: Select all
makeSome targets are not going to get built, but that's ok, they're just some of the demos. Once make has finished you should have /mesa-7.0.1~rc2/lib/
Code: Select all
libGL.so libGLU.so libglut.so.3.7.1 libOSMesa.so.6
libGL.so.1 libGLU.so.1 libGLw.so libOSMesa.so.6.5.3
libGL.so.1.5.070001 libGLU.so.1.3.070001 libGLw.so.1
libGL.so.7 libglut.so libGLw.so.1.0.0
libGL.so.7.0.1 libglut.so.3 libOSMesa.soCode: Select all
LD_LIBRARY_PATH=full/path/to/mesa-7.0.1~rc2/lib/Code: Select all
export LD_LIBRARY_PATHIf you have glxgears installed you can try that, it works for me, but only in black and white wire-frame.
Otherwise you may want to checkout the demos in /mesa-7.0.1~rc2/progs/demos/
Some of them work, some, most, don't. Bounce and Geartrain work the best, as proof of concept. They run about 20x as fast in GLES/GL as the do in SoftWare Rendering. So there is really no speed hit in the translation calls.
Well, that's it, I hope some Pi owner tries this out and let's us know how it runs.