Someone on IRC finally helped me !
(Sorry I don't remember who exactly, there were a lot of people trying to help)
I used this :
#include <fstream>
#include <assert.h>
int main(int argc, char* argv[]) {
assert(argc == 2);
char* fn = argv[1];
std::ifstream f(fn,std::ios::binary);
FILE* out = fopen("out.cpp", "w");
fprintf(out,"char a[] = {\n");
unsigned long n = 0;
while (!f.eof())
{
char c;
f.read(&c, 1);
unsigned char uc = c;
fprintf(out,"0x%.2X,", (int)uc);
++n;
if (n % 10 == 0) fprintf(out,"\n");
}
f.close();
fprintf(out,"};\n");
fclose(out);
}
and in my code :
texture.loadFromMemory(&a, sizeof(a));