the forgotten struct of my reading function to complete it:
typedef struct _RGBIMG {
GLuint w;
GLuint h;
GLubyte* data;
} RGBIMG;
i don’t have to change this - right?
i create the texture with:
glTexImage2D(GL_TEXTURE_2D, 0, 3, img.w, img.h, 0, GL_RGB, GL_UNSIGNED_BYTE, img.data);
to make sure i understood all your posts - a summary of the changes:
glTexImage2D(GL_TEXTURE_2D, 0, 3, img.w, img.h, 0, GL_RGB, GL_UNSIGNED_BYTE, img.data);
to
glTexImage2D(GL_TEXTURE_2D, 0, 4, img.w, img.h, 0, GL_RGBA, GL_UNSIGNED_BYTE, img.data);
and in the reading function:
sz = (((3*refimg->w+3)>>2)<<2)*refimg->h;
to:
sz = (((4*refimg->w+4)>>3)<<3)*refimg->h;
i think in this loop i will have to change something (how should i modify this exactly?):
while (fsize > 0) {
fread(p, 1, 1, file);
p++;
fsize--;
}
–> is this everything?
another question: what are the advanteges to use gluBuild2DMipmaps instead of glTexImage2D …
sorry for the stupid questions
thank you very much!!!