views:

88

answers:

2

I am trying to do some work with HopenGL and I need a Ptr that points to a array of floats. From what I have read uarray and storableArray seem to be the way to go, in some combination some way.

+1  A: 

You don't say whether you already have an array and need a pointer to it or you want to create one.

If you need to create an array and then get a pointer to it you can indeed use storable arrays. In order to create it, use the classes and helperfunctions defined Data.Array.MArray. StorableArray is an instance of the MArray class so all those function can be used to create and manipulate the array. When you want to get the Ptr to the array, use the withStorableArray function.

I hope that fits your usecase.

svenningsson
+1  A: 

If you use Storable arrays or Foreign arrays (in Foreign.*) you are able to get a pointer to pass to C or friends.

Don Stewart