forked from not-fl3/miniquad
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuadNative.java
More file actions
22 lines (19 loc) · 1003 Bytes
/
QuadNative.java
File metadata and controls
22 lines (19 loc) · 1003 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package quad_native;
import android.view.Surface;
// Java force the MainActivity class belongs to a specially named package
// this package name is forced to be different for each app
// and Java do not have any way to specify a native symbol lookup name..
// To workaround this - native callbacks can't be defined in dynamically named
// MainActivity package
public class QuadNative {
// belongs to MainActivity class
public native static void activityOnCreate(Object activity);
public native static void activityOnResume();
public native static void activityOnPause();
public native static void activityOnDestroy();
// belongs to QuadSurface class
public native static void surfaceOnSurfaceCreated(Surface surface);
public native static void surfaceOnSurfaceDestroyed(Surface surface);
public native static void surfaceOnTouch(int id, int phase, float x, float y);
public native static void surfaceOnSurfaceChanged(Surface surface, int width, int height);
}