| 1 |
#import <UIKit/UIKit.h> |
| 2 |
#import <OpenGLES/EAGL.h> |
| 3 |
#import <OpenGLES/ES1/gl.h> |
| 4 |
#import <OpenGLES/ES1/glext.h> |
| 5 |
#include <allegro5/allegro.h> |
| 6 |
#include <allegro5/internal/aintern_iphone.h> |
| 7 |
#include <allegro5/internal/aintern_list.h> |
| 8 |
|
| 9 |
/* |
| 10 |
This class wraps the CAEAGLLayer from CoreAnimation into a convenient UIView subclass. |
| 11 |
The view content is basically an EAGL surface you render your OpenGL scene into. |
| 12 |
Note that setting the view non-opaque will only work if the EAGL surface has an alpha channel. |
| 13 |
*/ |
| 14 |
@interface EAGLView : UIView { |
| 15 |
|
| 16 |
@private |
| 17 |
EAGLContext *context; |
| 18 |
ALLEGRO_DISPLAY *allegro_display; |
| 19 |
|
| 20 |
/* OpenGL names for the renderbuffer and framebuffers used to render to this view */ |
| 21 |
GLuint viewRenderbuffer, viewFramebuffer; |
| 22 |
|
| 23 |
/* OpenGL name for the depth buffer that is attached to viewFramebuffer, if it exists (0 if it does not exist) */ |
| 24 |
GLuint depthRenderbuffer; |
| 25 |
|
| 26 |
/* Stuff for managing ID's for touches. List held struct which connect UITouch with ID on Allegro site. |
| 27 |
* NSMutableIndexSet hold list of free id's which were used. 'next_free_touch_id' hold next unused ID. |
| 28 |
* |
| 29 |
* 'touch_list' serve actuall as dictionary which map UITouch do ID. |
| 30 |
*/ |
| 31 |
_AL_LIST* touch_list; |
| 32 |
NSMutableIndexSet* touch_id_set; |
| 33 |
UITouch* primary_touch; |
| 34 |
int next_free_touch_id; |
| 35 |
|
| 36 |
float scale; |
| 37 |
} |
| 38 |
|
| 39 |
@property (nonatomic, retain) EAGLContext *context; |
| 40 |
@property GLint backingWidth; |
| 41 |
@property GLint backingHeight; |
| 42 |
|
| 43 |
|
| 44 |
- (void)make_current; |
| 45 |
- (void)flip; |
| 46 |
- (void)reset_framebuffer; |
| 47 |
- (void)set_allegro_display:(ALLEGRO_DISPLAY *)display; |
| 48 |
- (BOOL) createFramebuffer; |
| 49 |
- (void) destroyFramebuffer; |
| 50 |
- (BOOL)orientation_supported:(UIInterfaceOrientation)o; |
| 51 |
@end |