Issue 22 in glumpy: Undefined GLUT callback function Scroll

115 views
Skip to first unread message

glu...@googlecode.com

unread,
Nov 6, 2012, 12:37:23 PM11/6/12
to Nicolas...@inria.fr
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 22 by thibault...@gmail.com: Undefined GLUT callback function
Scroll
http://code.google.com/p/glumpy/issues/detail?id=22

With the last git tarball:

>>> import numpy, glumpy
>>> fig = glumpy.figure( (512,512) )
freeglut glutSetOption(): missing enum handle 1
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/glumpy/__init__.py", line 68, in
figure
return Figure(size=size, position=position, parent=None)
File "/usr/lib/python2.7/site-packages/glumpy/figure.py", line 89, in
__init__
self._window = Window( size=(w,h), position=position, title='Figure')
File "/usr/lib/python2.7/site-packages/glumpy/window/backend_glut.py",
line 147, in __init__
glutScrollFunc( self._scroll)
File "/usr/lib/python2.7/site-packages/OpenGL/GLUT/special.py", line 138,
in __call__
self.wrappedOperation( cCallback, *args )
File "/usr/lib/python2.7/site-packages/OpenGL/GLUT/special.py", line 106,
in failFunction
typeName, 'glut%sFunc'%(typeName),
OpenGL.error.NullFunctionError: Undefined GLUT callback function Scroll,
check for bool(glutScrollFunc) before calling

Thanks!

glu...@googlecode.com

unread,
Nov 7, 2012, 1:49:17 AM11/7/12
to Nicolas...@inria.fr
Updates:
Status: Started

Comment #1 on issue 22 by Nicolas...@gmail.com: Undefined GLUT
Thanks for the report. What is your system ?


glu...@googlecode.com

unread,
Nov 7, 2012, 7:36:48 AM11/7/12
to Nicolas...@inria.fr

Comment #2 on issue 22 by thibault...@gmail.com: Undefined GLUT callback
function Scroll
http://code.google.com/p/glumpy/issues/detail?id=22

Hello,

I get this error with 2 different platforms:

1) Fedora 16 x86_64, with the proprietary NVidia driver, GeForce9800GTX+
2) Fedora 16 x86_64, with the proprietary AMD driver, HD5750

Python is 2.7.3, numpy 1.6.2, freeglut 2.6.0. Attached is the glxinfo for
each platform. (not sure what is relevant here)

Thanks!

Attachments:
amd.dat.gz 1.8 KB
nvidia.dat.gz 1.7 KB

glu...@googlecode.com

unread,
Nov 8, 2012, 9:54:27 AM11/8/12
to Nicolas...@inria.fr

Comment #3 on issue 22 by Nicolas...@gmail.com: Undefined GLUT
Thanks.

The glutScrollFunc is only relevant for osx and it should be null on other
platforms since it is not supposed to be available. I need to find another
way to test...

glu...@googlecode.com

unread,
Nov 8, 2012, 10:42:24 AM11/8/12
to Nicolas...@inria.fr

Comment #4 on issue 22 by thibault...@gmail.com: Undefined GLUT callback
function Scroll
http://code.google.com/p/glumpy/issues/detail?id=22

Thanks!
In the meantime, it can be disabled by commenting out the lines
if glutScrollFunc:
glutScrollFunc( self._scroll)
elif glut.glutMouseWheelFunc:
glutMouseWheelFunc( self._wheel)

Also, the glut.glutCheckLoop() of line 556 seems to be MacOS-specific.
Uncommenting line 554 fixes the problem.

glu...@googlecode.com

unread,
Dec 30, 2012, 6:50:05 PM12/30/12
to Nicolas...@inria.fr

Comment #5 on issue 22 by ianozsv...@gmail.com: Undefined GLUT callback
function Scroll
http://code.google.com/p/glumpy/issues/detail?id=22

I'm on Linux (Linux Mint 13 using Ubuntu 12.04) with Python 2.7. I
installed glumpy using a clone of the current repo, added pyopengl and
pyopengl_accelerate, then tried to run the histogram.py demo. It failed
with the error noted above.

Using Comment 4 I commented out the 4 lines and uncommented line 556 (both
were causing errors), then histogram.py generates a nice animation.

For reference I also had to install 'freeglut' (not 'freeglut-dev') else I
received the "OpenGL.error.NullFunctionError: Attempt to call an undefined
function glutGetWindow, check for bool(glutGetWindow) before calling" error.

My system is a Dell Latitude E6420 laptop:
$ uname -a
Linux ian-Latitude-E6420 3.2.0-23-generic #36-Ubuntu SMP Tue Apr 10
20:39:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

Graphics card is an NVIDIA NVS 4200M 512MB with Linux 64bit driver version
304.64.

glu...@googlecode.com

unread,
Dec 30, 2012, 6:55:35 PM12/30/12
to Nicolas...@inria.fr

Comment #6 on issue 22 by ianozsv...@gmail.com: Undefined GLUT callback
function Scroll
http://code.google.com/p/glumpy/issues/detail?id=22

For reference I'm running (via Comment 5) in a virtualenv, here's my
installed Python environment:
$ pip freeze
Pillow==1.7.8
PyOpenGL==3.0.2
PyOpenGL-accelerate==3.0.2
argparse==1.2.1
distribute==0.6.24
glumpy==0.2.1
numpy==1.6.2
scipy==0.11.0
wsgiref==0.1.2

If you included a requirements.txt with a similar set of libraries then the
PyOpenGL[-accelerate], scipy, numpy and PIL (I used Pillow) dependencies
for the demos would be satisfied with a "pip install -r requirements.txt".
HTH, Ian.

glu...@googlecode.com

unread,
Dec 31, 2012, 3:32:25 AM12/31/12
to Nicolas...@inria.fr

Comment #7 on issue 22 by Nicolas...@gmail.com: Undefined GLUT
@thibaut.north

I added some test to check for the presence of glutScrollFunc. Hopefully
it'll be enough but I'm not quite sure. I also modified the glutCheckLoop
part and I added glutMainLoopEvent when glutCheckLoop is not available
(glutMainLoopEvent is not available with old version of glut).

@ ianozsvald

What is the format for the requirements.txt file ?



glu...@googlecode.com

unread,
Dec 31, 2012, 6:58:35 AM12/31/12
to Nicolas...@inria.fr

Comment #8 on issue 22 by ianozsv...@gmail.com: Undefined GLUT callback
function Scroll
http://code.google.com/p/glumpy/issues/detail?id=22

I've pulled your changes, I get the original error:
----
demos $ python histogram.py
freeglut (histogram.py): glutSetOption(): missing enum handle 1
Traceback (most recent call last):
File "histogram.py", line 124, in <module>
fig = figure(size=(640,480))

File "/home/ian/workspace/virtualenvs/glumpy_testing/local/lib/python2.7/site-packages/glumpy/__init__.py",
line 69, in figure
return Figure(size=size, position=position, parent=None)

File "/home/ian/workspace/virtualenvs/glumpy_testing/local/lib/python2.7/site-packages/glumpy/figure.py",
line 90, in __init__
self._window = Window( size=(w,h), position=position, title='Figure')

File "/home/ian/workspace/virtualenvs/glumpy_testing/local/lib/python2.7/site-packages/glumpy/window/backend_glut.py",
line 149, in __init__
OSX_glutScrollFunc( self._scroll)

File "/home/ian/workspace/virtualenvs/glumpy_testing/local/lib/python2.7/site-packages/OpenGL/GLUT/special.py",
line 139, in __call__
self.wrappedOperation( cCallback, *args )

File "/home/ian/workspace/virtualenvs/glumpy_testing/local/lib/python2.7/site-packages/OpenGL/GLUT/special.py",
line 107, in failFunction
typeName, 'glut%sFunc'%(typeName),
OpenGL.error.NullFunctionError: Undefined GLUT callback function Scroll,
check for bool(glutScrollFunc) before calling
----

If I comment out lines 148-151:
#if OSX_glutScrollFunc is not None:
# OSX_glutScrollFunc( self._scroll)
#elif bool(glut.glutMouseWheelFunc):
# glutMouseWheelFunc( self._wheel)
then the code runs as expected (so your change on line 556 is good for me).

glu...@googlecode.com

unread,
Dec 31, 2012, 6:59:35 AM12/31/12
to Nicolas...@inria.fr

Comment #9 on issue 22 by ianozsv...@gmail.com: Undefined GLUT callback
function Scroll
http://code.google.com/p/glumpy/issues/detail?id=22

Regarding the requirements file - let me file a new feature request. Ian.

glu...@googlecode.com

unread,
Dec 31, 2012, 7:39:02 AM12/31/12
to Nicolas...@inria.fr

Comment #10 on issue 22 by ianozsv...@gmail.com: Undefined GLUT callback
function Scroll
http://code.google.com/p/glumpy/issues/detail?id=22

I've made some changes in backend_glut.py so it works on my Linux machine:

First - I've added a test for mac_ver(), on Linux it returns "", on a Mac
it returns a version number in a string:
# GLUT for Mac OS X fork with Core Profile and scroll wheel support
OSX_glutScrollFunc = None
try:
import platform
if platform.mac_ver()[0] != "":
OSX_glutScrollFunc = GLUTCallback(
'Scroll', (c_float,c_float), ('delta_x','delta_y'),)
except:
OSX_glutScrollFunc = None

On line 154 I had to fix a typo (added 'glut.'
to 'glut.glutMouseWheelFunc(self._wheel)):
if OSX_glutScrollFunc is not None:
OSX_glutScrollFunc( self._scroll)
elif bool(glut.glutMouseWheelFunc):
glut.glutMouseWheelFunc(self._wheel)

NOTE that these changes are tested on Linux Mint 13 but *not* on a Mac. I
just checked that the platform.mac_ver() command returns a sensible string
on the Mac (so these changes need a proper test on a working Mac
environment).

glu...@googlecode.com

unread,
Jan 19, 2013, 7:50:22 PM1/19/13
to Nicolas...@inria.fr

Comment #11 on issue 22 by m...@tomwhipple.com: Undefined GLUT callback
function Scroll
http://code.google.com/p/glumpy/issues/detail?id=22

I'm running OSX 10.7.5. I've had to comment out these lines to get it to
work... It seems that OSX_glutScrolFunction is defined, but somehow not
valid.

# if OSX_glutScrollFunc is not None:
# OSX_glutScrollFunc( self._scroll)
# elif bool(glut.glutMouseWheelFunc):
# glut.glutMouseWheelFunc( self._wheel)

glu...@googlecode.com

unread,
Feb 20, 2013, 4:56:25 AM2/20/13
to Nicolas...@inria.fr

Comment #12 on issue 22 by alan.briolat: Undefined GLUT callback function
Scroll
http://code.google.com/p/glumpy/issues/detail?id=22

Is there any reason you can't make it dependent on "if sys.platform
== 'darwin'"?

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

glu...@googlecode.com

unread,
Feb 20, 2013, 5:10:18 AM2/20/13
to Nicolas...@inria.fr

Comment #13 on issue 22 by Nicolas...@gmail.com: Undefined GLUT
Not at all. Thanks. I did just that hoping it will fix this annoying bug.

I keep the issue open until people report it works (or not).

glu...@googlecode.com

unread,
Mar 6, 2013, 5:42:46 PM3/6/13
to Nicolas...@inria.fr

Comment #14 on issue 22 by Thrantas...@gmail.com: Undefined GLUT callback
function Scroll
http://code.google.com/p/glumpy/issues/detail?id=22

Scrolling works for me on Linux, although a small patch is needed to the
current git version:

--- backend_glut.py~ 2013-03-06 12:48:24.640617293 -0800
+++ backend_glut.py 2013-03-06 12:48:24.653617764 -0800
@@ -148,7 +148,7 @@
if OSX_glutScrollFunc is not None:
OSX_glutScrollFunc( self._scroll)
elif bool(glut.glutMouseWheelFunc):
- glutMouseWheelFunc( self._wheel)
+ glut.glutMouseWheelFunc( self._wheel)
if size is not None:
width, height = size
glut.glutReshapeWindow( width, height )

glu...@googlecode.com

unread,
Apr 11, 2013, 2:11:35 AM4/11/13
to Nicolas...@inria.fr
Updates:
Status: Fixed

Comment #15 on issue 22 by Nicolas...@gmail.com: Undefined GLUT
Should be fixed now.
Reply all
Reply to author
Forward
0 new messages