glBufferSubData BUG REPORT
Hans Wurst <[email protected]>
| Newsgroups | gmane.comp.python.opengl.user |
|---|---|
| Message-ID | <[email protected]> |
Hello list,
I found a bug in glBufferSubData while doing the following call:
glBufferSubData(target, offset, np.array((0.5,), dtype=float32))
The reason lies within these lines:
try:
if size is not None:
# !!error is here:!!
size = int( size )
except TypeError, err:
if data is not None:
raise TypeError(
"""Expect an integer size *or* a data-array, not both"""
)
My data arrives at the size parameter. But int(np.array((0.5,),
dtype=float32) does not raise an error and returns the containing data
converted to an integer (which is later used for the size parameter of
baseOperation and leads to an error within GL).
Workaround for users: Just give the size on your own (np.array.nbytes)
Solution: I recommend adding these 3 lines right before the try-block:
if data is None:
data = size
size = None
I hope this helps making PyOpenGL better.
[Sorry if I got the wrong mailing list :(]
Best regards
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
PyOpenGL Homepage
http://pyopengl.sourceforge.net