BView.h
Go to the documentation of this file.
1 #ifndef B_BVIEW_H
2 #define B_BVIEW_H
3 
4 #include "headers/OSdetect.h"
5 #ifdef B_OS_IOS
6 
7 #import <UIKit/UIKit.h>
8 
9 #include "headers/Renderer_GL.h"
10 #include "Touch.h"
11 
12 @class EAGLContext;
13 
14 /* This is a UIView specifically designed for bRenderer and needs to be added to a window in your project */
15 @interface BView : UIView
16 {
17  @private
18  GLint _width;
19  GLint _height;
20 
21  GLuint _defaultFramebuffer, _colorRenderbuffer, _depthRenderbuffer;
22 
23  // The display link is used to create a render loop
24  CAEAGLLayer *_eaglLayer;
25 
26  // OpenGL context
27  EAGLContext *_context;
28 
29  // Touch handling
30  bool _singleTapRecognized;
31  bool _doubleTapRecognized;
32  CGPoint _lastDoubleTapLocation;
33  CGPoint _lastSingleTapLocation;
34  TouchMap _touches;
35 
36 }
37 
38 -(void)bindFramebuffer;
39 -(void)presentRenderbuffer;
40 -(bool)setContextCurrent;
41 
42 -(int)getViewWidth;
43 -(int)getViewHeight;
44 -(int)getViewPositionX;
45 -(int)getViewPositionY;
46 
47 -(void)setFullscreen;
48 -(void)setViewWidth:(GLint)w setViewHeight : (GLint)h;
49 -(void)setViewPositionX:(GLint)x setViewPositionY : (GLint)y;
50 
51 
52 -(TouchMap)getTouches;
53 -(bool)singleTapRecognized;
54 -(bool)doubleTapRecognized;
55 -(Touch)getLastSingleTapLocation;
56 -(Touch)getLastDoubleTapLocation;
57 
58 @end
59 
60 #endif
61 
62 #endif /* defined(B_BVIEW_H) */
An object that holds the characteristics of a touch on a touch screen.
Definition: Touch.h:9
std::map< int, Touch > TouchMap
Definition: Touch.h:20