-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from rincew1nd/Development
Options and gestures
- Loading branch information
Showing
17 changed files
with
373 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,43 @@ | ||
#pragma once | ||
|
||
#include <switch.h> | ||
#include <SDL2/SDL.h> | ||
|
||
enum InputType | ||
{ | ||
None, | ||
Press, | ||
Drag, | ||
Pinch | ||
}; | ||
|
||
typedef struct TouchInfo | ||
{ | ||
InputType Type; | ||
int ValueOne; | ||
int ValueTwo; | ||
} TouchInfo; | ||
|
||
class Input | ||
{ | ||
public: | ||
int Scan(); | ||
touchPosition* GetPointPosition(int); | ||
TouchInfo* GetTouchInfo(); | ||
|
||
private: | ||
touchPosition _touchPoints[10]; | ||
int _touchCount; | ||
bool _released; | ||
|
||
InputType _touchType = None; | ||
int _lastDragX = 0; | ||
int _lastDragY = 0; | ||
int _lastPinchDelta = 0; | ||
|
||
TouchInfo* _lastTouchInfo = new TouchInfo(); | ||
|
||
int _touchCount = 0; | ||
bool _touchPressed = false; | ||
bool _firstPinch = true; | ||
bool _firstDrag = true; | ||
Uint32 _touchPressTime = 0; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.