openframeworks / openframeworks/openFrameworks
creating ofxGestures
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 10.4k
- Forks
- 2.6k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 9
Description
I'm starting work on making a unified gestures handler addon that works on iOS and Android alike.
- The iOS part will be based on the work found here:
https://github.com/rjraffa/ofxGestureRecognizer - I'm going to write the android part from scratch.
It's going to have some common cpp files, with inheritance to iOS specific classes and Android specific classes that talk through JNI to OFAndroid or OFActivity.
Regarding the interface, I'm wondering if using ofEvents is the logical move here, since I'm kinda new to it.
I would like to hear some opinions regarding which option sounds like a more useful interface to you:
-
ofxGestures is a class which contains ofEvent objects. You instantiate the class, and register the events you want to methods in your app class.
-
The ofEvents objects do exist in order to pass control to the UI thread, but are private and not part of the interface. Instead ofxGestures can have an observer of type IofxGesturesObserver. The app class inherits from the observer, and implements whatever methods it want.
I was also thinking that I should hide from the user which view is registered to the gestures and automatically register it on the GLView. I don't think there's a reason for it to be on any other view. Sounds ok?
Should there be a "null implementation" for non iOS/Android systems? Or it's simply resolved by not including the addon in such systems?
If there are any other points you would like to raise, I'll be more than happy to read them.
Thanks,
Tal
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the linked ofxGestureRecognizer project and the proposed common C++ files, platform-specific classes, JNI interaction with OFAndroid or OFActivity, and GLView registration. Before implementation, resolve the event or observer interface and behavior on non-iOS/Android systems. Done means the addon design and scope are agreed and the cross-platform gesture handler is implemented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- mobile
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100