WhirlyGlobe  1.1
A 3D interactive globe toolkit for ios
/Users/sjg/iPhone/WhirlyGlobe/WhirlyGlobeSrc/WhirlyGlobeLib/include/TextureAtlas.h
00001 /*
00002  *  TextureAtlas.h
00003  *  WhirlyGlobeLib
00004  *
00005  *  Created by Steve Gifford on 3/28/11.
00006  *  Copyright 2011 mousebird consulting
00007  *
00008  *  Licensed under the Apache License, Version 2.0 (the "License");
00009  *  you may not use this file except in compliance with the License.
00010  *  You may obtain a copy of the License at
00011  *  http://www.apache.org/licenses/LICENSE-2.0
00012  *
00013  *  Unless required by applicable law or agreed to in writing, software
00014  *  distributed under the License is distributed on an "AS IS" BASIS,
00015  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00016  *  See the License for the specific language governing permissions and
00017  *  limitations under the License.
00018  *
00019  */
00020 
00021 #import <vector>
00022 #import <UIKit/UIKit.h>
00023 #import <OpenGLES/ES1/gl.h>
00024 #import <OpenGLES/ES1/glext.h>
00025 #import <OpenGLES/ES2/gl.h>
00026 #import <OpenGLES/ES2/glext.h>
00027 
00028 #import "Identifiable.h"
00029 #import "WhirlyVector.h"
00030 #import "Texture.h"
00031 
00039 @interface TextureAtlas : NSObject
00040 {
00042     unsigned int texSizeX,texSizeY;
00044     unsigned int gridSizeX,gridSizeY;
00046     unsigned int cellSizeX,cellSizeY;
00048     bool *layoutGrid;  
00049     
00051     NSMutableArray *images;
00052 }
00053 
00056 - (id)inithWithTexSizeX:(unsigned int)texSizeX texSizeY:(unsigned int)texSizeY cellSizeX:(unsigned int)cellSizeX cellSizeY:(unsigned int)cellSizeY;
00057     
00061 - (BOOL)addImage:(UIImage *)image texOrg:(WhirlyGlobe::TexCoord &)org texDest:(WhirlyGlobe::TexCoord &)dest;
00062 
00064 - (BOOL)getImageLayout:(UIImage *)image texOrg:(WhirlyGlobe::TexCoord &)org texDest:(WhirlyGlobe::TexCoord &)dest;
00065 
00067 - (WhirlyGlobe::Texture *)createTexture;
00068 
00069 @end