![]() |
WhirlyGlobe
1.2
A 3D interactive globe toolkit for iOS
|
#import <TextureAtlas.h>
Public Member Functions | |
(id) | - initWithTexSizeX:texSizeY: |
(WhirlyGlobe::SimpleIdentity) | - addImage: |
(void) | - processIntoScene:texIDs: |
Protected Attributes | |
unsigned int | texSizeX |
Texture sizes we're aiming for. | |
unsigned int | texSizeY |
unsigned int | cellSizeX |
Size of the cells used for places images in the texture atlases. | |
unsigned int | cellSizeY |
NSMutableArray * | atlases |
Texture atlases built so far. | |
std::vector < WhirlyGlobe::SubTexture > | mappings |
Mappings from the various images to the texture atlases. |
Texture Atlas Builder This object is used to build up a list of texture atlases which will be used to speed up rendering related to textures. You give this object UIImages and it will sort them into appropriate texture atlases. In return you get an ID which you can use to uniquely identify your texture subset and a mapping into the target texture atlas. These IDs can be used in place of texture IDs with most layers. Lastly, you'll need to add all the textures and sub texture mappings into the scene.
- WhirlyGlobe: | (UIImage *) | image |
Add the given image to a texture atlas. You'll get a sub texture mapping back. Check the ID of SubTexture. It will be EmptyIdentity on failure.
- (id) initWithTexSizeX: | (unsigned int) | texSizeX | |
texSizeY: | (unsigned int) | texSizeY | |
Construct with the size of the texture atlases to be produced. Must be a power of two.
- (void) processIntoScene: | (WhirlyGlobe::GlobeScene *) | scene | |
texIDs: | (std::set< WhirlyGlobe::SimpleIdentity > *) | texIDs | |
Runs through the altases created and adds the resulting textures to the scene. Also puts the sub texture mappings in to the scene for use on the layer side.