Posts: 7
Joined: Wed Jul 18, 2012 2:30 pm
Location: Windsor, NC
Contact: Website


Wed Jul 18, 2012 3:02 pm

Disclaimer: Relative n00b here. I've worked with Linux for a few years (mainly Ubuntu, SliTaz, Slax, PinguyOS, etc) and feel *generally* comfortable. I'm a programmer by trade so I have no fear of the command line. However I haven't done any programming for a *nix environment (let alone arm) aside from some CircleMUDs back in the day.

Now with that out of the way, I have a question regarding the official Raspbian release and OpenGL/ES. I've got the image loaded up on the Pi and it's working great. Overclocked to arm_freq 930, gpu_freq 350, sdram_freq 500 and Linpack shows ~55,500 kflops on a fresh reboot with no X, running the 224/32 split.

That's all well and good, however I've installed mesa-utils and attempted to run glxinfo/gears (from bare terminal and from within LXDE) and always get errors along the lines of "GLimp() – could not load OpenGL subsystem" or "Error: couldn't find RGB GLX visual or fbconfig". Is this simply because it requires the 192/64 split (I'd test now, but I'm at work), or am I missing some GL/ES links somewhere? I get the same errors attempting to run ioquake3 as well, both from a bare terminal and from within LXDE. Or am I just being noobish and going about this completely wrong?

Is there a simple step-by-step process from a fresh Raspbian install to enable GL/ES to the point you could run glxinfo/gears/ioquake3, and perhaps start programming using the GL/ES libraries? I'll smack myself if it's as simple as just switching to the 192/64 split (which I've read can fix a few GL issues). I'm very interested in doing some 2D/3D programming using GL/ES as my education is in C/C++ game development. Should be fun to see what kind of games I could crank out on this little miracle.

Thanks in advance, and sorry if this is a noob question!

User avatar
Posts: 620
Joined: Fri Feb 03, 2012 7:18 pm
Location: San Carlos, CA
Contact: Website

Re: OpenGL

Wed Jul 18, 2012 11:47 pm

ReliC, I myself am interested in the much of the same information concerning OpenGL/ES. I'm working on porting the Gosu 2D game development library (utilizing GPU accelerated graphics via OpenGL/ES) to the Raspberry Pi under Raspbian. My 10-yr old son has had pretty good luck learning about gaming programming with Ruby and Gosu and I'm eager to get it ported to the Pi.

Unfortunately, I have very little experience with graphics programming so I'm just trying to get a handle on how to use the GL/ES libraries. Hopefully as I learn more I'll be able to help you or others with their questions in this regards, but until then, hopefully others will be able to answer your questions and I an learn from them as well.

Regarding Mesa libraries in the Raspbian repository, I believe it's basically an OpenGL ES emulator. Even if they work (I believe someone may have used them to port Quake3 to the Pi), I believe their performance would be pitifully slow on the Raspberry Pi. Instead, we'll need to figure out how to use the Broadcom videocore libraries under the /opt/vc directories which will offer GPU accelerated graphics. Unfortunately, these don't seem to cooperate to well with X Windows and applications using them seem to run from the command line (ie. XBMC).
Posts: 63
Joined: Sat Apr 07, 2012 6:26 am
Location: CZ
Contact: Website

Re: OpenGL

Thu Jul 19, 2012 7:44 am

While we wait for GPU accelerated X driver fo RasPi, here are some workarounds:
  • * Seems it is possible to "patch" EGL to use Broadcom libraries: link on merproject, video. The only info about this particular hack seems to be included on YT:
    This is a hack that enables you to re-use existing applications & frameworks built for the combination of X11+EGL+GLESv2 on Raspberry Pi without modification - tested on top of ARMv6 core (No warranty it breaks you get to keep both pieces) with Qt 4.8.0. GL ES accelerated Harmattan Qt Components demonstrated. The hack basically ignores any X window information given to it through EGL api and instead sets up a fullscreen window with the Raspberry Pi GPU display manager. With some adjustments it should be possible to do windowed GLES as well (though no compositor). Want to know more, come by #mer on (I'm Stskeeps there). In the future, people should really be using Qt5 and QPA plugins instead of this stuff :) Or, if possible, X11 support for the GLESv2/EGL drivers in Raspberry Pi, even fullscreen-only stuff would be absolutely fantastic.
  • * Of course cleaner solution is to patch and recompile the app in question. There is a great guide by Ben O'Steen here
  • * I was looking into patching glut/glut-es library, but just can't find free time right now. There is a bit outdated glut-es for linux, it is possible to compile it on Raspbian without any issue, but no patch for RasPi yet: see here

Posts: 7
Joined: Wed Jul 18, 2012 2:30 pm
Location: Windsor, NC
Contact: Website

Re: OpenGL

Thu Jul 19, 2012 1:34 pm

Thanks for the replies, some very useful information (and I'd like to check out Gosu when you get it ported, mpthompson!). Jerry, thanks for Ben's site, some very good stuff in there. I'll see if I can get all his examples functioning on the Pi over the weekend. If you haven't seen ... onfig.html, check it out. Looks like he's off to a great start as well.

I finally managed to get the hello_pi examples to compile and run on the official Wheezy, and I feel quite silly (read: noob-ish). I flashed a fresh copy of Wheezy onto my SD card, went to /opt/vc/src/hello_pi/, and actually read the README. After I compiled the libs first (duh!), no more issues. These examples definitely seem like a good base to start with as far as getting a non-X-based GL surface to work with.

Very exciting! I can't wait to see what the community comes up with, and what this little device is really capable of.

Thanks again!

Posts: 1
Joined: Tue Oct 09, 2012 7:24 am

Re: OpenGL

Tue Oct 09, 2012 7:28 am

I too I'm a bit of a noob. I'm trying to run qmlviewer with opengl like suggested by "nightwlk123" in his video .
I'm currently running Archlinux with X11 and Qt 4.8. I tried doing th x11-hack-libegl but I guess the archlinux image does not have the src for the VC. Can anyone help me get this to work?

Return to “Raspberry Pi OS”