numarray and NumarrayType

M

Marco Bubke

Hi

I have a little problem mit numarrays type. I want to get the Type but its
noch the right one. If I array.typecode() I get the right one but there is
not a typecode for all types. I geht the same type fer float and double?

Thats wrong. Its a bug by me or numarray?

Here is the code. The array is of type 'Float32" but I get tFloat64.

cdef int numarray_type
numarray_type = NA_NumarrayType(flat_array)
if numarray_type == tFloat32:
self.type = GL_FLOAT
elif numarray_type == tFloat64:
self.type = GL_DOUBLE
elif numarray_type == tUInt32:
self.type = GL_UNSIGNED_INT
elif numarray_type == tInt32:
self.type = GL_INT
elif numarray_type == tUInt16:
self.type = GL_UNSIGNED_SHORT
elif numarray_type == tInt16:
self.type = GL_SHORT
elif numarray_type == tUInt8:
self.type = GL_UNSIGNED_BYTE
elif numarray_type == tInt8:
self.type = GL_BYTE
else:
assert 0, "can't convert numarray type to opengl type"

regards

Marco
 
S

Simon Burton

Hi

I have a little problem mit numarrays type. I want to get the Type but its
noch the right one. If I array.typecode() I get the right one but there is
not a typecode for all types. I geht the same type fer float and double?

Thats wrong. Its a bug by me or numarray?

I don't know but I used NA_nameToTypeNo on theArray.type().name

Seems to work OK.

Simon.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,120
Latest member
ShelaWalli
Top