![]() |
WhirlyGlobe
1.2
A 3D interactive globe toolkit for iOS
|
#import <TextureAtlas.h>
Public Member Functions | |
(id) | - inithWithTexSizeX:texSizeY:cellSizeX:cellSizeY: |
(BOOL) | - addImage:texOrg:texDest: |
(BOOL) | - getImageLayout:texOrg:texDest: |
We cache the images and their coordinates. Query the cache. | |
(WhirlyGlobe::Texture *) | - createTexture: |
Protected Attributes | |
unsigned int | texSizeX |
Texture size. | |
unsigned int | texSizeY |
unsigned int | gridSizeX |
Grid sizes (for sorting) | |
unsigned int | gridSizeY |
unsigned int | cellSizeX |
Cell sizes. | |
unsigned int | cellSizeY |
bool * | layoutGrid |
Used for sorting new images. | |
NSMutableArray * | images |
Images we've rendered so far (for lookup) | |
Properties | |
WhirlyGlobe::SimpleIdentity | texId |
The ID for the texture we're going to create. |
A Texture Atlas is an object used to consolidate textures for performance. OpenGL doesn't like having a lot of little textures and would much prefer one big one. This is how we do that. Texture Atlases are typically built on the fly with images that come in from other sources.
- (BOOL) addImage: | (UIImage *) | image | |
texOrg: | (WhirlyGlobe::TexCoord &) | org | |
texDest: | (WhirlyGlobe::TexCoord &) | dest | |
Add the image to this atlas and return texture coordinates to map into. Returns false if there wasn't room
- WhirlyGlobe: | (UIImage **) | retImage |
Generate a texture from the images If the retImage pointer is set, you get that back. It's autreleased.
- (id) inithWithTexSizeX: | (unsigned int) | texSizeX | |
texSizeY: | (unsigned int) | texSizeY | |
cellSizeX: | (unsigned int) | cellSizeX | |
cellSizeY: | (unsigned int) | cellSizeY | |
Construct with texture size (needs to be a power of 2). We sort images into buckets (sizeX/gridX,sizeY/gridY)
- WhirlyGlobe: [read, assign] |
The ID for the texture we're going to create.
This is the texture ID that will be assigned when the texture is created.