473,414 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

python and glut

hi there.

i installed python2.3-opengl, then i tried one of those demos:

----

#!/usr/bin/python2.3

# This is statement is required by the build system to query build info
if __name__ == '__build__':
raise Exception

import sys
from OpenGL.GL import *
from OpenGL.GLE import *
from OpenGL.GLUT import *
class GLE_demo:

def __init__(self):
# initial mouse position
self.lastx = 121
self.lasty = 121

# set the display mode and create the window
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH)
glutCreateWindow("GLE demo")

# setup the callbacks
glutDisplayFunc(self.on_display)
glutMotionFunc(self.on_motion)
glutReshapeFunc(self.on_reshape)

#
glClearDepth(1.0)
glEnable(GL_DEPTH_TEST)
glClearColor(0.0, 0.0, 0.0, 0.0)
glShadeModel(GL_SMOOTH)

glMatrixMode(GL_MODELVIEW)
# initialize lighting */
glLightfv(GL_LIGHT0, GL_POSITION, (40.0, 40, 100.0, 0.0))
glLightfv(GL_LIGHT0, GL_DIFFUSE, (0.99, 0.99, 0.99, 1.0))
glEnable(GL_LIGHT0)
glLightfv(GL_LIGHT1, GL_POSITION, (-40.0, 40, 100.0, 0.0))
glLightfv(GL_LIGHT1, GL_DIFFUSE, (0.99, 0.99, 0.99, 1.0))
glEnable(GL_LIGHT1)
glEnable(GL_LIGHTING)
glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE)
glEnable(GL_COLOR_MATERIAL)
def on_motion(self, x, y):
# store the mouse coordinate
self.lastx = x
self.lasty = y
# redisplay
glutPostRedisplay()
def on_reshape(self, width, height):
# setup the viewport
glViewport(0, 0, width, height)
# setup the projection matrix
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
# calculate left/right and top/bottom clipping planes
based the
smallest square viewport
a = 9.0/min(width, height)
clipping_planes = (a*width, a*height)
# setup the projection
glFrustum(-clipping_planes[0], clipping_planes[0],
-clipping_pla
nes[1], clipping_planes[1], 50.0, 150.0)
def on_display(self):
# clear the buffer
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)

# Set up the model view matrix
glMatrixMode(GL_MODELVIEW)
glLoadIdentity()
glTranslatef(0.0, 0.0, -80.0)
glRotatef(self.lastx, 0.0, 1.0, 0.0)
glRotatef(self.lasty, 1.0, 0.0, 0.0)

# a nice pale lime green
glColor3f(0.6, 0.8, 0.3)

# set the join styles for GLE
gleSetJoinStyle(TUBE_NORM_EDGE | TUBE_JN_ANGLE |
TUBE_JN_CAP)
gleHelicoid(1.0, 6.0, 2.0, -3.0, 4.0, None, None, 0.0,
1080.0)

# swap the buffer
glutSwapBuffers()

if __name__ == '__main__':
# initialize GLUT
glutInit(sys.argv)
# create the demo window
GLE_demo()
# enter the event loop
glutMainLoop ()

----

(sorry for some line breaks, some day i'll repair my newsreader)

but when i try to run it:

$ python GLE.py
freeglut (GLE.py): OpenGL GLX extension not supported by display ':0.0'

what's up? what's missing?

i use a standard debian installation.

thanks for your attention

bye

max
Jul 19 '05 #1
9 4744
"max(01)*" <ma**@fisso.casa> writes:
$ python GLE.py
freeglut (GLE.py): OpenGL GLX extension not supported by display ':0.0'

what's up? what's missing?
The GLX extension to your X server.
i use a standard debian installation.


I don't know which X debian uses, and it may have changed over time,
so you'll want to specify the name of the distribution. You'd be
better off asking in a support group for the X distribution you're
using.

<mike
--
Mike Meyer <mw*@mired.org> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
Jul 19 '05 #2
See if you can run `glxgears`, and read the output of `glxinfo`. If
neither of those work, you will probably have better luck on a debian
or XFree86/xorg forum than on c.l.py

Jul 19 '05 #3
Mike Meyer wrote:
"max(01)*" <ma**@fisso.casa> writes:

$ python GLE.py
freeglut (GLE.py): OpenGL GLX extension not supported by display ':0.0'

what's up? what's missing?

The GLX extension to your X server.

i use a standard debian installation.

I don't know which X debian uses, and it may have changed over time,


mine uses XFree86, Version 4.3.0.1 (from the man page)
so you'll want to specify the name of the distribution.


woody.

thanks

max
Jul 19 '05 #4
Lonnie Princehouse wrote:
See if you can run `glxgears`, and read the output of `glxinfo`.


$ glxgears
Xlib: extension "GLX" missing on display ":0.0".
Error: couldn't get an RGB, Double-buffered visual
$ glxinfo
name of display: :0.0
Xlib: extension "GLX" missing on display ":0.0".
Xlib: extension "GLX" missing on display ":0.0".
Xlib: extension "GLX" missing on display ":0.0".
Error: couldn't find RGB GLX visual

visual x bf lv rg d st colorbuffer ax dp st accumbuffer ms cav
id dep cl sp sz l ci b ro r g b a bf th cl r g b a ns b eat
----------------------------------------------------------------------
Xlib: extension "GLX" missing on display ":0.0".
Xlib: extension "GLX" missing on display ":0.0".
0x21 16 tc 1 0 0 c . . 0 0 0 0 0 0 0 0 0 0 0 0 0 None

----

now what?

bye

max
Jul 19 '05 #5
Lonnie Princehouse wrote:
See if you can run `glxgears`, and read the output of `glxinfo`. If
neither of those work, you will probably have better luck on a debian
or XFree86/xorg forum than on c.l.py


your hints were helpful anyway. thanks!

ok, i uncommented the line:

Load "glx"

in my /etc/X11/XF86Config file.

now glxgears seems to work...

except for the following message:

Xlib: extension "XFree86-DRI" missing on display ":0.0".

can you give some more help? (sorry again for being offtopic)

max
Jul 19 '05 #6
Welcome to the exciting world of trying to make graphics work on Linux
=)

DRI is direct rendering. The Module section of your XF8Config should
have:

Load "glx"
Load "dri"
Load "GLCore"

That probably won't solve things.
Google for some combination of ("debian" + "xfree86" + your video
card), and also Google the error messages you get (e.g. "XFree86-DRI
missing on display" )

DRI not working could also be a permissions issue; check to see if it
works as root.

Once your XFree86 is set up properly, the Python OpenGL bindings should
work just fine.

Jul 19 '05 #7
Lonnie Princehouse wrote:
DRI not working could also be a permissions issue; check to see if it
works as root.


that's it! :-)

now, how can i make it work as "joe user"?

bye

max
Jul 19 '05 #8
Lonnie Princehouse wrote:
Welcome to the exciting world of trying to make graphics work on Linux
=)

DRI is direct rendering. [...] DRI not working could also be a permissions issue; check to see if it
works as root.


that's it! :-)

now, how can i make it work as "joe user"?

bye

max

Jul 19 '05 #9
In <q0***********************@news4.tin.it>, max(01)* wrote:
Lonnie Princehouse wrote:
DRI not working could also be a permissions issue; check to see if it
works as root.


that's it! :-)

now, how can i make it work as "joe user"?


I have this in my XF86Config and I'm in the `video` group::

Section "DRI"
Group "video"
Mode 0660
EndSection

Ciao,
Marc 'BlackJack' Rintsch
Jul 19 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

57
by: John Howard | last post by:
I've sent several messages over the last year asking about python - Who teaches python? Is python losing steam? etc. I have noticed, eg, the declinng number of books at my local borders. The last...
0
by: Fulko van Westrenen | last post by:
Hello, A few days ago I asked help with GLUT/Tk. This combination seems to be difficult. Is there another combination with GLUT, like GTK or Qt, or a true GLUT widget-set that I can use to make...
0
by: Bushido Hacks | last post by:
What's that? I've go GCC working for Windows? Well, sort of. But I'm not using a Unix Emulator. The trick is to install Dev-C++, but do not use the Dev-C++ IDE unless you feel like it. I...
1
by: Scott Chang | last post by:
Hi All I tried to use the attached OpenGL code to draw a Star-shaped figure on my Microsoft Visual C++ .NET 2002-Windows XP Pro PC. When I did 'Build' in Debug Mode, I got an error C2065:...
5
by: Michael Kipper | last post by:
Hi, I'm having a problem moving from C to C++. In C, I have a function: void display(void) {} that I can register with OpenGL as a callback using: GLUTAPI void glutDisplayFunc( void...
3
by: jg.campbell.ng | last post by:
I'm beginning learning Python and OpenGL in Python. Python fine. But difficulties with OpenGL; presumably with the installation of OpenGL. OS = Linux FC5. Python program gl_test.py: from...
1
by: Advait | last post by:
Hello everyone, I am using GCC through DevC++ & Code Block Studio IDEs. I got libraries "gl" & "glu" with these IDEs. Programs based on these two libs gl & glu are executing well. I want...
2
by: Advait | last post by:
Hello everyone, I am using GCC through DevC++ & Code Block Studio IDEs. I got libraries "gl" & "glu" with these IDEs. Programs based on these two libs gl & glu are executing well. I want to...
0
by: shortyzms | last post by:
I have been trying to write a small glut program that uses popup context menus on right clicks to draw objects. However, every time I do this, the area underneath the submenu item I clicked does not...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.