ios stuff
This commit is contained in:
parent
b11dfc412f
commit
ccdabd60b7
@ -49,14 +49,18 @@ CGPoint prev_loc;
|
|||||||
touchMoved = true;
|
touchMoved = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
AppOnScroll(prevLocation.x - location.x, prevLocation.y - location.y);
|
AppOnScroll(prevLocation.x - location.x, -(prevLocation.y - location.y));
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
|
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
|
||||||
{
|
{
|
||||||
CGPoint location = [[[touches allObjects] objectAtIndex:0] locationInView:self];
|
CGPoint location = [[[touches allObjects] objectAtIndex:0] locationInView:self];
|
||||||
|
|
||||||
if (!touchMoved)
|
if (touchMoved)
|
||||||
|
{
|
||||||
|
AppOnTapUpAfterScroll(location.x, self.bounds.size.height - location.y);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
AppOnTapUp(location.x, self.bounds.size.height - location.y);
|
AppOnTapUp(location.x, self.bounds.size.height - location.y);
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,9 @@
|
|||||||
#import "ViewController.h"
|
#import "ViewController.h"
|
||||||
#import "ios_api.h"
|
#import "ios_api.h"
|
||||||
|
|
||||||
|
|
||||||
|
extern GLKView* defaultView;
|
||||||
|
|
||||||
@interface ViewController () {
|
@interface ViewController () {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -39,6 +42,7 @@
|
|||||||
view.context = self.context;
|
view.context = self.context;
|
||||||
view.drawableDepthFormat = GLKViewDrawableDepthFormat24;
|
view.drawableDepthFormat = GLKViewDrawableDepthFormat24;
|
||||||
|
|
||||||
|
defaultView = view;
|
||||||
|
|
||||||
[self setupGL];
|
[self setupGL];
|
||||||
}
|
}
|
||||||
|
@ -32,16 +32,21 @@ extern "C" void AppDraw()
|
|||||||
|
|
||||||
extern "C" void AppOnTapDown(int posx, int posy)
|
extern "C" void AppOnTapDown(int posx, int posy)
|
||||||
{
|
{
|
||||||
//App.OuterOnTapDown(vec2(posx, posy));
|
App.OuterOnTapDown(vec2(posx, posy));
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" void AppOnTapUp(int posx, int posy)
|
extern "C" void AppOnTapUp(int posx, int posy)
|
||||||
{
|
{
|
||||||
//App.OuterOnTapUp(vec2(posx, posy));
|
App.OuterOnTapUp(vec2(posx, posy));
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" void AppOnTapUpAfterScroll(int posx, int posy)
|
||||||
|
{
|
||||||
|
App.OuterOnTapUpAfterShift(vec2(posx, posy));
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" void AppOnScroll(int shiftx, int shifty)
|
extern "C" void AppOnScroll(int shiftx, int shifty)
|
||||||
{
|
{
|
||||||
//App.OuterOnMove(vec2(shiftx, shifty));
|
App.OuterOnMove(vec2(shiftx, shifty));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,4 +12,5 @@ void AppUpdate(int dt);
|
|||||||
void AppDraw();
|
void AppDraw();
|
||||||
void AppOnTapDown(int posx, int posy);
|
void AppOnTapDown(int posx, int posy);
|
||||||
void AppOnTapUp(int posx, int posy);
|
void AppOnTapUp(int posx, int posy);
|
||||||
|
void AppOnTapUpAfterScroll(int posx, int posy);
|
||||||
void AppOnScroll(int shiftx, int shifty);
|
void AppOnScroll(int shiftx, int shifty);
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user