Cinder  0.8.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CinderViewCocoaTouch.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2010, The Barbarian Group
3  All rights reserved.
4 
5  Redistribution and use in source and binary forms, with or without modification, are permitted provided that
6  the following conditions are met:
7 
8  * Redistributions of source code must retain the above copyright notice, this list of conditions and
9  the following disclaimer.
10  * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
11  the following disclaimer in the documentation and/or other materials provided with the distribution.
12 
13  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
14  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
15  PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
16  ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
17  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
18  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
19  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
20  POSSIBILITY OF SUCH DAMAGE.
21 */
22 
23 #pragma once
24 
25 #import <UIKit/UIKit.h>
26 
27 #include "cinder/gl/gl.h"
29 #include "cinder/app/Renderer.h"
30 
31 #include <map>
32 
34 @required
35 - (void)resize;
36 - (void)draw;
37 - (void)mouseDown:(cinder::app::MouseEvent*)event;
38 - (void)mouseDrag:(cinder::app::MouseEvent*)event;
39 - (void)mouseUp:(cinder::app::MouseEvent*)event;
40 - (void)touchesBegan:(cinder::app::TouchEvent*)event;
41 - (void)touchesMoved:(cinder::app::TouchEvent*)event;
42 - (void)touchesEnded:(cinder::app::TouchEvent*)event;
43 - (cinder::app::WindowRef)getWindowRef;
44 @end
45 
46 
47 @interface CinderViewCocoaTouch : UIView
48 {
49  ci::app::AppCocoaTouch *mApp;
51 
53  std::map<UITouch*,uint32_t> mTouchIdMap;
54  std::vector<cinder::app::TouchEvent::Touch> mActiveTouches;
55 }
56 
57 - (id)initWithFrame:(CGRect)frame app:(cinder::app::AppCocoaTouch*)app renderer:(cinder::app::RendererRef)renderer sharedRenderer:(cinder::app::RendererRef)sharedRenderer contentScale:(float)contentScale;
58 - (void)setDelegate:(id<CinderViewCocoaTouchDelegate>)delegate;
59 - (ci::app::RendererRef)getRenderer;
60 
61 - (void)drawView;
62 
63 - (uint32_t)addTouchToMap:(UITouch*)touch;
64 - (void)removeTouchFromMap:(UITouch*)touch;
65 - (uint32_t)findTouchInMap:(UITouch*)touch;
66 - (void)updateActiveTouches;
67 - (void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event;
68 - (const std::vector<cinder::app::TouchEvent::Touch>&)getActiveTouches;
69 
70 @end
Definition: CinderViewCocoaTouch.h:47
ci::app::AppCocoaTouch * mApp
Definition: CinderViewCocoaTouch.h:49
Definition: CinderViewCocoaTouch.h:33
ci::app::RendererRef mRenderer
Definition: CinderViewCocoaTouch.h:52
typedef void(APIENTRYP GLEEPFNGLBLENDCOLORPROC)(GLclampf red
void resize()
Definition: AppCocoaTouch.mm:1075
std::shared_ptr< class Renderer > RendererRef
Definition: Renderer.h:85
std::map< UITouch *, uint32_t > mTouchIdMap
Definition: CinderViewCocoaTouch.h:53
id< CinderViewCocoaTouchDelegate > mDelegate
Definition: CinderViewCocoaTouch.h:50
GLXDrawable draw
Definition: GLee.h:16766
std::vector< cinder::app::TouchEvent::Touch > mActiveTouches
Definition: CinderViewCocoaTouch.h:54
GLuint id
Definition: GLee.h:2035