Quote:
Originally Posted by kingbombs
Hey,
I was wondering if theres a way to use textures which don't have a size that is a power of 2
I have been looking at quite a few sites, and how to 'pad' out an image so the original image isn't a power of 2 but when it gets loaded into the program to become a texture it is padded out (with what i seem to be reading) with black pixels.
|
Should be transparent pixels. If allocating memory for a pad space use calloc not malloc for obvious reasons...
Quote:
Originally Posted by kingbombs
What i assume from this is that i must set up the texture co-ordinates to be something like 0.5,0.6, 0.5, 0.8, .... etc not the standard 1,1....0,1 etc
The problem with me taking this route is that i use other textures that require the texture co-ordinates to be 1,1 0,0 0,1 1,0 etc
|
Look, there really isn't a way around this. That's just one of the things you need to deal with and it's difficult to "force" everything into the one little box or method. If your textures are different, then they need to be handled differently.
I'd definitely re-look at your drawing code and allow for some flexibility for the ST co-ordinates. Even if they were just in an array matching an array of the GL texture indexes, that would be enough.