devkitPro / citro3d

Homebrew PICA200 GPU wrapper library for Nintendo 3DS
zlib License
248 stars 35 forks source link

Texture init fails when default data pointer is not null #31

Closed Cruel closed 7 years ago

Cruel commented 7 years ago

I'm referring to this line. This is what I expect to work:

C3D_Tex tex;
C3D_TexInit(&tex, 64, 64, GPU_RGB8);

However it will fail depending on the initial value of the data pointer. At the moment, I just use tex.data = NULL; before it. Perhaps it's better to trust the user won't initialize multiple times instead of requiring the struct to be zero'd?

fincs commented 7 years ago

Noted. Currently you are supposed to memset C3D_Tex structures on the stack before initializing them.

fincs commented 7 years ago

See 033c600.