Memory problem

is there anything better than this code below? typedef struct color { uint8_t R; uint8_t G; uint8_t B; } typedef struct Voxel { PxMaterial mVmat; bool vxl_mask[4096]; color vxl_color[4096]; };

note: im useing nividia PhysX

Reply to
braden nelson
Loading thread data ...

Don't know if you're in the wrong place or you think someone here can help you? Maybe you're working with a graphics controller?

As with my knowledge, I do think most graphic controllers today use 32 bit once you hit 24 bit mode, they are mapping a full 32 bit DWORD in memory. Also, I seem to remember depending on whom made the graphics card, it maybe in big endian mode, too.

So something to think about. Any way, if you are to find you are dealing with 32 data, then maybe you want to use a Struct like you have now inside a UNION so that you can also define a

32 bit field.. This will make moving data natural and much faster.

In the end, you can access this field as a whole or in byte sections

Jamie

Reply to
Maynard A. Philbrook Jr.

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.