I am currently working on images and procedurally generate images then convert them into dds or rtc1. Due to constrains of my program, I cannot open external files so I want them embedded with the code.
I found out GIMP has a "c header" exporter but i'd like to do that myself for my generated textures.
Using void* would allow this to be used for any types of data.
UPDATE: To clarify things, I was thinking about outputting as unsigned int like this:
void exportToHeader(const void* data, const uin32_t size, const char* name)
{
uint32_t* pData = (uint32_t*)data;
printf("void* %s = {\n");
// TODO: handle last case
for (int i = 0; i < size; ++i) {
printf("%s, ", pData[i]);
}
printf("};\n");
}
Will the compiler be able to understand this ?