change node children from unique to shared ptr, rename Canvas2D to StrokePreview, add panel toolbar with icon buttons to toggle
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
xcopy /I /D /Y /S /E ..\data src\main\assets\data
|
||||
call gradlew installDebug
|
||||
call adb shell am start -n com.omigamedev/android.app.NativeActivity
|
||||
pause
|
||||
@@ -116,7 +116,7 @@ static int engine_init_display(struct engine* engine) {
|
||||
surface = eglCreateWindowSurface(display, config, engine->app->window, NULL);
|
||||
|
||||
const EGLint attribs_test[] = {
|
||||
EGL_CONTEXT_CLIENT_VERSION, 3,
|
||||
EGL_CONTEXT_CLIENT_VERSION, 2,
|
||||
EGL_NONE
|
||||
};
|
||||
|
||||
@@ -199,26 +199,34 @@ static int32_t engine_handle_input(struct android_app* app, AInputEvent* event)
|
||||
struct engine* engine = (struct engine*)app->userData;
|
||||
float x = AMotionEvent_getX(event, 0);
|
||||
float y = AMotionEvent_getY(event, 0);
|
||||
LOG("event source: %d", AInputEvent_getSource(event));
|
||||
MouseEvent e;
|
||||
int32_t eventType = AInputEvent_getType(event);
|
||||
switch (eventType) {
|
||||
case AINPUT_EVENT_TYPE_MOTION:
|
||||
switch (AInputEvent_getSource(event)) {
|
||||
case AINPUT_SOURCE_TOUCHSCREEN:
|
||||
int action = AKeyEvent_getAction(event) & AMOTION_EVENT_ACTION_MASK;
|
||||
switch (action) {
|
||||
case AMOTION_EVENT_ACTION_DOWN:
|
||||
App::I.mouse_down(0, x, y);
|
||||
return 1;
|
||||
case AMOTION_EVENT_ACTION_UP:
|
||||
App::I.mouse_up(0, x, y);
|
||||
return 1;
|
||||
case AMOTION_EVENT_ACTION_MOVE:
|
||||
App::I.mouse_move(x, y);
|
||||
return 1;
|
||||
}
|
||||
// switch (AInputEvent_getSource(event)) {
|
||||
// case AINPUT_SOURCE_STYLUS:
|
||||
// case AINPUT_SOURCE_TOUCHSCREEN:
|
||||
{
|
||||
int action = AKeyEvent_getAction(event) & AMOTION_EVENT_ACTION_MASK;
|
||||
switch (action) {
|
||||
case AMOTION_EVENT_ACTION_DOWN:
|
||||
App::I.mouse_down(0, x, y);
|
||||
return 1;
|
||||
case AMOTION_EVENT_ACTION_UP:
|
||||
App::I.mouse_up(0, x, y);
|
||||
return 1;
|
||||
case AMOTION_EVENT_ACTION_HOVER_MOVE: // pen move before touching
|
||||
case AMOTION_EVENT_ACTION_MOVE:
|
||||
App::I.mouse_move(x, y);
|
||||
return 1;
|
||||
default:
|
||||
LOG("motion action: %d", action);
|
||||
break;
|
||||
} // end switch
|
||||
}
|
||||
}
|
||||
// break;
|
||||
// } // end switch
|
||||
break;
|
||||
case AINPUT_EVENT_TYPE_KEY:
|
||||
// handle key input...
|
||||
@@ -260,6 +268,7 @@ static void engine_handle_cmd(struct android_app* app, int32_t cmd) {
|
||||
engine->accelerometerSensor,
|
||||
(1000L/60)*1000);
|
||||
}
|
||||
engine->animating = 1;
|
||||
break;
|
||||
case APP_CMD_LOST_FOCUS:
|
||||
// When our app loses focus, we stop monitoring the accelerometer.
|
||||
|
||||
Reference in New Issue
Block a user