ArDrone SDK 1.8 added
[mardrone] / mardrone / ARDrone_SDK_Version_1_8_20110726 / ControlEngine / iPhone / Classes / OpenGLSprite.h
1 /**
2  *  @file OpenGLSprite.h
3  *
4  * Copyright 2009 Parrot SA. All rights reserved.
5  * @author D HAEYER Frederic
6  * @date 2009/10/26
7  */
8 #include "ConstantsAndMacros.h"
9
10 typedef enum
11 {
12         NO_SCALING,
13         FIT_X,
14         FIT_Y,
15         FIT_XY
16 } eSCALING;
17
18 typedef struct
19 {
20         GLuint widthImage;
21         GLuint widthTexture;
22         GLuint heightImage;
23         GLuint heightTexture;
24         GLfloat scaleModelX;
25         GLfloat scaleModelY;
26         GLfloat scaleTextureX;
27         GLfloat scaleTextureY;
28         GLuint bytesPerPixel;
29         GLenum format;
30         GLenum type;
31         void* data;
32         GLuint identifier;
33         enum {INVALID, GENERATED, SENT_TO_GPU} state;
34 } Texture;
35
36 @interface OpenGLSprite : NSObject {
37 @private
38         CGSize          screenSize;
39         Vertex3D        position;
40         Rotation3D      rotation;
41         Scale3D         scale;
42         CGSize          oldSize;
43         unsigned int oldBytesPerPixel;
44         
45 @protected
46         UIImage*        image;
47         void            *default_image;
48         eSCALING        scaling;
49         Texture         texture;
50 }
51 @property (nonatomic, assign) Vertex3D  position;
52 @property (nonatomic, assign) Rotation3D rotation;
53 @property (nonatomic, assign) Scale3D   scale;
54
55 - (id)initWithPath:(NSString *)path withScaling:(eSCALING)_scaling withScreenSize:(CGSize)size;
56 - (BOOL)ResetTexture;
57 - (void)drawSelfIfNeeded:(BOOL)needed;
58
59 @end