PDA

View Full Version : Array CVx...



ReneMiner
28-10-2014, 12:05
This time it's the following:

I want to create stuff in 3d. OpenGL awaits Float-Type (Single) to be passed.

The problem here is, singles/floats are way too unprecise for calculations so i need the data at least as Double, else i would have to bother with unfitting seams and graphical glitches.

The Vertex-udt consists of 3 Singles but data is stored at heap, so i can place a straight virtual Array of Singles upon.

I would like to store the data as Double - because of the known reasons - but i have to pass the array as Single to OpenGL.

Now i have the option to place an array of Doubles onto my data, dim another array of Single with the same number of elements and assign them one by one, so my Double-Array becomes a Single-Array finally.

Now I wonder if there weren't a smarter and faster way to cast the whole array-content of Type Double into another array of Type Single...?