[PyOpenGL-Users] glBufferSubData BUG REPORT
Brought to you by:
mcfletch
From: Hans W. <p-e...@we...> - 2012-01-23 11:36:14
|
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 |