Page 1 of 1

GLX / OpenGL

Posted: Tue Jul 03, 2012 2:42 pm
by TimG
Has anybody got any OpenGL applications running on a Raspberry Pi? I'd like to run a simple slide-show, and the GLSlideshow screensaver seems my best bet.

Right now I'm running the Debian “Wheezy” public beta with mesa-utils installed, but get the following errors:

Code: Select all

$ glxgears
Error: couldn't get an RGB, Double-buffered visual
$ glxinfo
name of display: :0.0
Error: couldn't find RGB GLX visual or fbconfig
I read that OpenGL ES 2.0 is supported by the RPi, but couldn't find any details.

Re: GLX / OpenGL

Posted: Tue Jul 03, 2012 3:12 pm
by jmacey
Got quite a few demos, have a look at my blog posts (start here) ... onfig.html

There is a lot more in depth stuff here as well ( which is a full 3D OpenGL ES2.0 library.

If you just want to do simple image load and draw to quad this will be too much, I would suggest looking at ES1.x as it's much simpler.

By slide show do you mean open an image and display? If so I would split this into two sections, one loading the image (use imageMagic for this) then render a simple quad and texture map the image.

Hope this helps, If I have time I will try and write a simple demo for you but busy at work at present

Also there are a couple of simple demos in the /opt/vc/src directory to look at)

Re: GLX / OpenGL

Posted: Tue Jul 03, 2012 3:19 pm
by TimG
Thanks for the reply Jon. In fact yours is one of the webpages I read before posting.
I was hoping to avoid writing my own slideshow code (in which case I could probably avoid GL altogether). I've come across reports of glxgears et al. running on a Raspberry, so I'm probably missing something simple.

Re: GLX / OpenGL

Posted: Tue Jul 03, 2012 3:26 pm
by jmacey
the only problem with these demos is the fact that they will be running software OpenGL and be slow if they work at all.

For OpenGL ES 1.1 you don't need to write shaders etc, so it should be much easier as it uses the fixed function pipeline. The triangle.c demo in the /opt dir has a basic demo of this in action using basic raw image files at low res but is a good starting point

Re: GLX / OpenGL

Posted: Tue Jul 03, 2012 3:29 pm
by jmacey
another thought could be to use SDL, it does some basic blitting from bmp files and is good with 2D sprites etc and much simpler that OpenGL

Re: GLX / OpenGL

Posted: Sat Mar 05, 2016 7:49 pm
by raser
I get the same GLX Visual error :

Traceback (most recent call last):
File "/media/pi/USB/Python_Source_Code/World2.0.2/", line 19, in <module>
pygame.error: Couldn't find matching GLX visual

I am trying to learn OpenGL in Python so I can attempt to make a 3D game. So I downloaded an OpenGL program from the Pygame main site to have a look at and maybe play around with. It is a World 2.0.2 program like a spherical map of Earth. I get this GLX Visual when I try it. Is there a graphics driver or something needed for openGL? I have done very BASIC things with it like making a spinning cuboid frame but everythingelse just won't run.

PS >> I noticed when I inspected the code that at the very top just below the imports a reference to 'WIN32 and WIN64' now I'm a newbie....but isn't that relating to Windows systems??

heres what I mean - the beginning of the program in imports:

from OpenGL.GL import *
from OpenGL.GLU import *
import pygame
from pygame.locals import *
import sys, os, traceback
import gl_util, objects
if sys.platform == 'win32' or sys.platform == 'win64':
os.environ['SDL_VIDEO_CENTERED'] = '1'

Re: GLX / OpenGL

Posted: Sat Mar 05, 2016 8:04 pm
by raser
TimG - in response to you asking if anyone has got apps in OpenGL running on a Pi - Yes is my answer but with headaches. I am quite new to programming and wanted to try and learn Python / OpenGL. Did the download and install, it now will import into Python 3.4 (Raspian Jessie)

If your referring to the experimental Raspi-Config OpenGL setting to enable it within Raspbian - My whole OS crashed on me when I did this (activated GL in raspi-config) and I had to re install my OS on SD card. I have however installed it manually with a tar.gz download file, then ran the script in terminal to install it. if I open Python 3 and type " >>> import OpenGL " it works with no errors

I followed a tutorial to make a spinning cube and the very first example worked.... here is the exact page with the code: (scroll to the bottom to see it all written in full) ... -tutorial/

The cube span but I had to change something. If you need my exact code that runs and works let me know and I'll try and share it with you somehow

The next tutorial added colour to the cube - it didn't work on either of my Python versions. The problem is MOST of the PyOpenGL tutorials expect you to have a good knowledge of OpenGL and I don't even know Python that well yet. Plus most people don't tell you wether they are running Python and OpenGL on Windows Machines (with graphics cards and accelerators) or Mac, or Linux - Then there's the different versions of Python that want things fed to them differently. I want to make a 3D exploration game with a level to move around in and I am ready to give-up. I'm no genius but normally these technical differences will make a difference!

I got the cube to spin, but i couldn't add colour, or follow ANY of the following tutorials. Please let me know if You make any progress