Olhm
2002.07.17, 10:49 PM
Does anyone know where i could find some simple source code (or demo, toutoral, etc.) demonstrating the loading of PICT resources and mapping them as textures? I know the basics, but ive been having trouble.
this is what i have so far, im not very clear on what gentextures can read, i think:
static void loadpictfile(int id)
{
texture[0].imageData=GetPicture(id);
texture[0].width=256;
texture[0].height=256;
}
static void LoadGLTextures(void)
{
loadpictfile(700);
glGenTextures(1, &texture[0].texID);
glBindTexture(GL_TEXTURE_2D, texture[0].texID);
glTexImage2D(GL_TEXTURE_2D, 0, 3, texture[0].width, texture[0].height, 0, GL_RGB, GL_UNSIGNED_BYTE, texture[0].imageData);
}
this is what i have so far, im not very clear on what gentextures can read, i think:
static void loadpictfile(int id)
{
texture[0].imageData=GetPicture(id);
texture[0].width=256;
texture[0].height=256;
}
static void LoadGLTextures(void)
{
loadpictfile(700);
glGenTextures(1, &texture[0].texID);
glBindTexture(GL_TEXTURE_2D, texture[0].texID);
glTexImage2D(GL_TEXTURE_2D, 0, 3, texture[0].width, texture[0].height, 0, GL_RGB, GL_UNSIGNED_BYTE, texture[0].imageData);
}