PICT rsrc texture source/demo/help

Olhm
Unregistered
 
Post: #1
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);
}
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
QTValuePak (http://homepage.mac.com/onesadcookie) shows texturing from a GWorld, so you could draw your picture into a GWorld and texture from that. It's probably the easiest way...

If you're not dead-set on using PICT resources, you could use QuickTime to load your texture from an image file straight into a GWorld. QTValuePak also demonstrates this technique.
Quote this message in a reply
Post Reply