PDA

View Full Version : Problem Loading Part Of Texture



steadi
01-26-2013, 08:04 AM
Hello There,

I am currently creating a game in OpenGl and GLUT on xCode. At the moment, I have gotten the game to load whole textures and display them perfectly. However, I wish to only display part of the texture.

I have various sprite sheets that vary in size and I want to load a sprite from one, how would i do this?

Thanks In Advance,
Matt

P.S - Sorry if the question was not too detailed, if you need more information then please ask. The jist of the question is: how do i load only part of a texture?

tonyo_au
01-26-2013, 11:38 PM
Most texture formats do not readly lend themselves to partial loads. The most partical is probably to load the whole image, copy the bit you want and discard the original image. If you don't want to do this you will need to write a customised loader.