From: <be...@us...> - 2012-04-15 18:46:44
|
Revision: 1240 http://freeglut.svn.sourceforge.net/freeglut/?rev=1240&view=rev Author: beuc Date: 2012-04-15 18:46:38 +0000 (Sun, 15 Apr 2012) Log Message: ----------- Remove a couple printf's Modified Paths: -------------- trunk/freeglut/freeglut/src/android/fg_runtime_android.c trunk/freeglut/freeglut/src/android/fg_window_android.c Modified: trunk/freeglut/freeglut/src/android/fg_runtime_android.c =================================================================== --- trunk/freeglut/freeglut/src/android/fg_runtime_android.c 2012-04-15 18:45:54 UTC (rev 1239) +++ trunk/freeglut/freeglut/src/android/fg_runtime_android.c 2012-04-15 18:46:38 UTC (rev 1240) @@ -23,7 +23,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* Parts taken from Android NDK's 'native-activity' sample : */ +/* Parts taken from Android NDK's 'native-activity' sample: */ /* * Copyright (C) 2010 The Android Open Source Project * Modified: trunk/freeglut/freeglut/src/android/fg_window_android.c =================================================================== --- trunk/freeglut/freeglut/src/android/fg_window_android.c 2012-04-15 18:45:54 UTC (rev 1239) +++ trunk/freeglut/freeglut/src/android/fg_window_android.c 2012-04-15 18:46:38 UTC (rev 1240) @@ -40,14 +40,14 @@ GLboolean sizeUse, int w, int h, GLboolean gameMode, GLboolean isSubWindow ) { - printf("fgPlatformOpenWindow %p ID=%d\n", (void*)window, window->ID); + // printf("fgPlatformOpenWindow %p ID=%d\n", (void*)window, window->ID); /* TODO: only one full-screen window possible? */ static int nb_windows = 0; if (nb_windows == 0) { nb_windows++; fgDisplay.pDisplay.single_window = window; - printf("=> %p ID=%d\n", (void*)fgDisplay.pDisplay.single_window, fgDisplay.pDisplay.single_window->ID); + // printf("=> %p ID=%d\n", (void*)fgDisplay.pDisplay.single_window, fgDisplay.pDisplay.single_window->ID); } else { return; } @@ -76,8 +76,8 @@ EGLint vid; eglGetConfigAttrib(display, window->Window.pContext.egl.Config, EGL_NATIVE_VISUAL_ID, &vid); + ANativeWindow_setBuffersGeometry(window->Window.Handle, 0, 0, vid); - ANativeWindow_setBuffersGeometry(window->Window.Handle, 0, 0, vid); fghPlatformOpenWindowEGL(window); window->State.Visible = GL_TRUE; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <be...@us...> - 2012-05-03 07:58:06
|
Revision: 1288 http://freeglut.svn.sourceforge.net/freeglut/?rev=1288&view=rev Author: beuc Date: 2012-05-03 07:58:00 +0000 (Thu, 03 May 2012) Log Message: ----------- Android: implement fgPlatformDeinitialiseInputDevices Modified Paths: -------------- trunk/freeglut/freeglut/src/android/fg_init_android.c trunk/freeglut/freeglut/src/android/fg_main_android.c trunk/freeglut/freeglut/src/android/fg_main_android.h Modified: trunk/freeglut/freeglut/src/android/fg_init_android.c =================================================================== --- trunk/freeglut/freeglut/src/android/fg_init_android.c 2012-05-03 07:55:19 UTC (rev 1287) +++ trunk/freeglut/freeglut/src/android/fg_init_android.c 2012-05-03 07:58:00 UTC (rev 1288) @@ -37,3 +37,13 @@ { fghPlatformCloseDisplayEGL(); } + +/** + * Close joystick and serial input devices + */ +void fgPlatformDeinitialiseInputDevices ( void ) +{ + fghCloseInputDevices (); + fgState.JoysticksInitialised = GL_FALSE; + fgState.InputDevsInitialised = GL_FALSE; +} Modified: trunk/freeglut/freeglut/src/android/fg_main_android.c =================================================================== --- trunk/freeglut/freeglut/src/android/fg_main_android.c 2012-05-03 07:55:19 UTC (rev 1287) +++ trunk/freeglut/freeglut/src/android/fg_main_android.c 2012-05-03 07:58:00 UTC (rev 1288) @@ -401,8 +401,3 @@ /* JNI entry points need to be bundled even when linking statically */ app_dummy(); } - -void fgPlatformDeinitialiseInputDevices ( void ) -{ - fprintf(stderr, "fgPlatformDeinitialiseInputDevices: STUB\n"); -} Modified: trunk/freeglut/freeglut/src/android/fg_main_android.h =================================================================== --- trunk/freeglut/freeglut/src/android/fg_main_android.h 2012-05-03 07:55:19 UTC (rev 1287) +++ trunk/freeglut/freeglut/src/android/fg_main_android.h 2012-05-03 07:58:00 UTC (rev 1288) @@ -32,6 +32,5 @@ extern unsigned long fgPlatformSystemTime(void); extern void fgPlatformSleepForEvents(long msec); extern void fgPlatformMainLoopPreliminaryWork(void); -extern void fgPlatformDeinitialiseInputDevices(void); #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <be...@us...> - 2012-05-03 14:12:46
|
Revision: 1291 http://freeglut.svn.sourceforge.net/freeglut/?rev=1291&view=rev Author: beuc Date: 2012-05-03 14:12:35 +0000 (Thu, 03 May 2012) Log Message: ----------- android: make code 're-entrant' - i.e. NativeActivity can restart the program without unloading it Modified Paths: -------------- trunk/freeglut/freeglut/src/android/fg_init_android.c trunk/freeglut/freeglut/src/android/fg_internal_android.h trunk/freeglut/freeglut/src/android/fg_main_android.c trunk/freeglut/freeglut/src/android/fg_runtime_android.c trunk/freeglut/freeglut/src/android/fg_structure_android.c trunk/freeglut/freeglut/src/android/fg_window_android.c Modified: trunk/freeglut/freeglut/src/android/fg_init_android.c =================================================================== --- trunk/freeglut/freeglut/src/android/fg_init_android.c 2012-05-03 13:32:06 UTC (rev 1290) +++ trunk/freeglut/freeglut/src/android/fg_init_android.c 2012-05-03 14:12:35 UTC (rev 1291) @@ -25,6 +25,7 @@ #include <GL/freeglut.h> #include "fg_internal.h" +#include "fg_init.h" #include "egl/fg_init_egl.h" void fgPlatformInitialize() Modified: trunk/freeglut/freeglut/src/android/fg_internal_android.h =================================================================== --- trunk/freeglut/freeglut/src/android/fg_internal_android.h 2012-05-03 13:32:06 UTC (rev 1290) +++ trunk/freeglut/freeglut/src/android/fg_internal_android.h 2012-05-03 14:12:35 UTC (rev 1291) @@ -104,7 +104,8 @@ typedef struct tagSFG_PlatformWindowState SFG_PlatformWindowState; struct tagSFG_PlatformWindowState { - int unused; + int32_t LastHeight; + int32_t LastWidth; }; #endif /* FREEGLUT_INTERNAL_ANDROID_H */ Modified: trunk/freeglut/freeglut/src/android/fg_main_android.c =================================================================== --- trunk/freeglut/freeglut/src/android/fg_main_android.c 2012-05-03 13:32:06 UTC (rev 1290) +++ trunk/freeglut/freeglut/src/android/fg_main_android.c 2012-05-03 14:12:35 UTC (rev 1291) @@ -318,6 +318,7 @@ /* The window is being hidden or closed, clean it up. */ LOGI("handle_cmd: APP_CMD_TERM_WINDOW"); fgDestroyWindow(fgDisplay.pDisplay.single_window); + fgDisplay.pDisplay.single_window = NULL; break; case APP_CMD_DESTROY: LOGI("handle_cmd: APP_CMD_DESTROY"); @@ -347,9 +348,6 @@ void fgPlatformProcessSingleEvent ( void ) { - static int32_t last_width = -1; - static int32_t last_height = -1; - /* When the screen is resized, the window handle still points to the old window until the next SwapBuffer, while it's crucial to set the size (onShape) correctly before the next onDisplay callback. @@ -363,9 +361,9 @@ if (window != NULL && window->Window.Handle != NULL) { int32_t width = ANativeWindow_getWidth(window->Window.Handle); int32_t height = ANativeWindow_getHeight(window->Window.Handle); - if (width != last_width || height != last_height) { - last_width = width; - last_height = height; + if (width != window->State.pWState.LastWidth || height != window->State.pWState.LastHeight) { + window->State.pWState.LastWidth = width; + window->State.pWState.LastHeight = height; LOGI("width=%d, height=%d", width, height); if( FETCH_WCB( *window, Reshape ) ) INVOKE_WCB( *window, Reshape, ( width, height ) ); Modified: trunk/freeglut/freeglut/src/android/fg_runtime_android.c =================================================================== --- trunk/freeglut/freeglut/src/android/fg_runtime_android.c 2012-05-03 13:32:06 UTC (rev 1290) +++ trunk/freeglut/freeglut/src/android/fg_runtime_android.c 2012-05-03 14:12:35 UTC (rev 1291) @@ -154,6 +154,8 @@ char progname[5] = "self"; char* argv[] = {progname, NULL}; main(1, argv); + /* FreeGLUT will exit() by itself if + GLUT_ACTION_ON_WINDOW_CLOSE == GLUT_ACTION_EXIT */ } LOGI("android_main: end"); @@ -163,7 +165,8 @@ while (!app->destroyRequested) fgPlatformProcessSingleEvent(); - /* In theory we should let NativeActivity restart us, however this - doesn't work well yet, so force exit */ - exit(0); + /* Let NativeActivity restart us */ + /* Users may want to forcibly exit() in their main() anyway because + NativeActivity doesn't dlclose() us, so all statically-assigned + variables keep their old values on restart.. */ } Modified: trunk/freeglut/freeglut/src/android/fg_structure_android.c =================================================================== --- trunk/freeglut/freeglut/src/android/fg_structure_android.c 2012-05-03 13:32:06 UTC (rev 1290) +++ trunk/freeglut/freeglut/src/android/fg_structure_android.c 2012-05-03 14:12:35 UTC (rev 1291) @@ -33,4 +33,6 @@ void fgPlatformCreateWindow ( SFG_Window *window ) { fghPlatformCreateWindowEGL(window); + window->State.pWState.LastWidth = -1; + window->State.pWState.LastHeight = -1; } Modified: trunk/freeglut/freeglut/src/android/fg_window_android.c =================================================================== --- trunk/freeglut/freeglut/src/android/fg_window_android.c 2012-05-03 13:32:06 UTC (rev 1290) +++ trunk/freeglut/freeglut/src/android/fg_window_android.c 2012-05-03 14:12:35 UTC (rev 1291) @@ -42,11 +42,10 @@ GLboolean gameMode, GLboolean isSubWindow ) { /* TODO: only one full-screen window possible? */ - static int nb_windows = 0; - if (nb_windows == 0) { - nb_windows++; + if (fgDisplay.pDisplay.single_window == NULL) { fgDisplay.pDisplay.single_window = window; } else { + fgWarning("You can't have more than one window on Android"); return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <be...@us...> - 2012-05-03 14:14:40
|
Revision: 1290 http://freeglut.svn.sourceforge.net/freeglut/?rev=1290&view=rev Author: beuc Date: 2012-05-03 13:32:06 +0000 (Thu, 03 May 2012) Log Message: ----------- android: better clean-up on exit Modified Paths: -------------- trunk/freeglut/freeglut/src/android/fg_main_android.c trunk/freeglut/freeglut/src/android/fg_runtime_android.c Modified: trunk/freeglut/freeglut/src/android/fg_main_android.c =================================================================== --- trunk/freeglut/freeglut/src/android/fg_main_android.c 2012-05-03 08:01:27 UTC (rev 1289) +++ trunk/freeglut/freeglut/src/android/fg_main_android.c 2012-05-03 13:32:06 UTC (rev 1290) @@ -133,6 +133,7 @@ int ascii = (*env)->CallIntMethod(env, keyEvent, KeyEvent_getUnicodeChar, AKeyEvent_getMetaState(event)); /* LOGI("getUnicodeChar(%d) = %d ('%c')", AKeyEvent_getKeyCode(event), ascii, ascii); */ + (*vm)->DetachCurrentThread(vm); return ascii; } @@ -319,8 +320,8 @@ fgDestroyWindow(fgDisplay.pDisplay.single_window); break; case APP_CMD_DESTROY: - /* Not reached because GLUT exit()s when last window is closed */ LOGI("handle_cmd: APP_CMD_DESTROY"); + /* glue has already set android_app->destroyRequested=1 */ break; case APP_CMD_GAINED_FOCUS: LOGI("handle_cmd: APP_CMD_GAINED_FOCUS"); @@ -393,7 +394,7 @@ void fgPlatformMainLoopPreliminaryWork ( void ) { - printf("fgPlatformMainLoopPreliminaryWork\n"); + LOGI("fgPlatformMainLoopPreliminaryWork\n"); key_init(); Modified: trunk/freeglut/freeglut/src/android/fg_runtime_android.c =================================================================== --- trunk/freeglut/freeglut/src/android/fg_runtime_android.c 2012-05-03 08:01:27 UTC (rev 1289) +++ trunk/freeglut/freeglut/src/android/fg_runtime_android.c 2012-05-03 13:32:06 UTC (rev 1290) @@ -127,6 +127,8 @@ AAssetDir_close(assetDir); } } + + (*vm)->DetachCurrentThread(vm); } /** @@ -155,5 +157,13 @@ } LOGI("android_main: end"); + + /* Finish processing all events (namely APP_CMD_DESTROY) before + exiting thread */ + while (!app->destroyRequested) + fgPlatformProcessSingleEvent(); + + /* In theory we should let NativeActivity restart us, however this + doesn't work well yet, so force exit */ exit(0); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <be...@us...> - 2012-05-03 19:35:18
|
Revision: 1292 http://freeglut.svn.sourceforge.net/freeglut/?rev=1292&view=rev Author: beuc Date: 2012-05-03 16:40:20 +0000 (Thu, 03 May 2012) Log Message: ----------- Document android app lifecycle; kill app when window is closed, until pausing/restoring windows is possible Modified Paths: -------------- trunk/freeglut/freeglut/src/android/fg_main_android.c trunk/freeglut/freeglut/src/android/fg_main_android.h trunk/freeglut/freeglut/src/android/fg_runtime_android.c Modified: trunk/freeglut/freeglut/src/android/fg_main_android.c =================================================================== --- trunk/freeglut/freeglut/src/android/fg_main_android.c 2012-05-03 14:12:35 UTC (rev 1291) +++ trunk/freeglut/freeglut/src/android/fg_main_android.c 2012-05-03 16:40:20 UTC (rev 1292) @@ -303,43 +303,75 @@ */ void handle_cmd(struct android_app* app, int32_t cmd) { switch (cmd) { - case APP_CMD_SAVE_STATE: - /* The system has asked us to save our current state. Do so. */ - LOGI("handle_cmd: APP_CMD_SAVE_STATE"); + /* App life cycle, in that order: */ + case APP_CMD_START: + LOGI("handle_cmd: APP_CMD_START"); break; - case APP_CMD_INIT_WINDOW: + case APP_CMD_RESUME: + LOGI("handle_cmd: APP_CMD_RESUME"); + /* If coming back from a pause: */ + /* - Recreate window context and surface */ + /* - Call user-defined hook to restore resources (textures...) */ + /* - Unpause GLUT callbacks */ + break; + case APP_CMD_INIT_WINDOW: /* surfaceCreated */ /* The window is being shown, get it ready. */ LOGI("handle_cmd: APP_CMD_INIT_WINDOW"); fgDisplay.pDisplay.single_window->Window.Handle = app->window; /* glPlatformOpenWindow was waiting for Handle to be defined and will now return from fgPlatformProcessSingleEvent() */ break; - case APP_CMD_TERM_WINDOW: - /* The window is being hidden or closed, clean it up. */ - LOGI("handle_cmd: APP_CMD_TERM_WINDOW"); + case APP_CMD_GAINED_FOCUS: + LOGI("handle_cmd: APP_CMD_GAINED_FOCUS"); + break; + case APP_CMD_WINDOW_RESIZED: + LOGI("handle_cmd: APP_CMD_WINDOW_RESIZED"); + if (fgDisplay.pDisplay.single_window->Window.pContext.egl.Surface != EGL_NO_SURFACE) + /* Make ProcessSingleEvent detect the new size, only available + after the next SwapBuffer */ + glutPostRedisplay(); + break; + + case APP_CMD_SAVE_STATE: /* onSaveInstanceState */ + /* The system has asked us to save our current state, when it + pauses the application without destroying it right after. */ + /* app->savedState = ... */ + /* app->savedStateSize = ... */ + LOGI("handle_cmd: APP_CMD_SAVE_STATE"); + break; + case APP_CMD_PAUSE: + LOGI("handle_cmd: APP_CMD_PAUSE"); + /* - Pause GLUT callbacks */ + break; + case APP_CMD_LOST_FOCUS: + LOGI("handle_cmd: APP_CMD_LOST_FOCUS"); + break; + case APP_CMD_TERM_WINDOW: /* surfaceDestroyed */ + /* The application is being hidden, but may be restored */ + /* TODO: Pausing/resuming windows not ready yet, so killing it now */ fgDestroyWindow(fgDisplay.pDisplay.single_window); fgDisplay.pDisplay.single_window = NULL; + LOGI("handle_cmd: APP_CMD_TERM_WINDOW"); break; - case APP_CMD_DESTROY: + case APP_CMD_STOP: + LOGI("handle_cmd: APP_CMD_STOP"); + break; + case APP_CMD_DESTROY: /* Activity.onDestroy */ LOGI("handle_cmd: APP_CMD_DESTROY"); + /* User closed the application for good, let's kill the window */ + if (fgDisplay.pDisplay.single_window != NULL) { + fgDestroyWindow(fgDisplay.pDisplay.single_window); + fgDisplay.pDisplay.single_window = NULL; + } /* glue has already set android_app->destroyRequested=1 */ break; - case APP_CMD_GAINED_FOCUS: - LOGI("handle_cmd: APP_CMD_GAINED_FOCUS"); - break; - case APP_CMD_LOST_FOCUS: - LOGI("handle_cmd: APP_CMD_LOST_FOCUS"); - break; + case APP_CMD_CONFIG_CHANGED: /* Handle rotation / orientation change */ LOGI("handle_cmd: APP_CMD_CONFIG_CHANGED"); break; - case APP_CMD_WINDOW_RESIZED: - LOGI("handle_cmd: APP_CMD_WINDOW_RESIZED"); - if (fgDisplay.pDisplay.single_window->Window.pContext.egl.Surface != EGL_NO_SURFACE) - /* Make ProcessSingleEvent detect the new size, only available - after the next SwapBuffer */ - glutPostRedisplay(); + case APP_CMD_LOW_MEMORY: + LOGI("handle_cmd: APP_CMD_LOW_MEMORY"); break; default: LOGI("handle_cmd: unhandled cmd=%d", cmd); Modified: trunk/freeglut/freeglut/src/android/fg_main_android.h =================================================================== --- trunk/freeglut/freeglut/src/android/fg_main_android.h 2012-05-03 14:12:35 UTC (rev 1291) +++ trunk/freeglut/freeglut/src/android/fg_main_android.h 2012-05-03 16:40:20 UTC (rev 1292) @@ -26,6 +26,9 @@ #ifndef __FG_MAIN_ANDROID_H__ #define __FG_MAIN_ANDROID_H__ +#include <GL/freeglut.h> +#include "fg_internal.h" + extern void fgPlatformProcessSingleEvent(void); extern void fgPlatformReshapeWindow(SFG_Window *window, int width, int height); extern void fgPlatformDisplayWindow(SFG_Window *window); Modified: trunk/freeglut/freeglut/src/android/fg_runtime_android.c =================================================================== --- trunk/freeglut/freeglut/src/android/fg_runtime_android.c 2012-05-03 14:12:35 UTC (rev 1291) +++ trunk/freeglut/freeglut/src/android/fg_runtime_android.c 2012-05-03 16:40:20 UTC (rev 1292) @@ -49,6 +49,7 @@ #include <android/asset_manager.h> #include <android/native_window.h> #include "android/native_app_glue/android_native_app_glue.h" +#include "android/fg_main_android.h" #define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, "FreeGLUT", __VA_ARGS__)) #define LOGW(...) ((void)__android_log_print(ANDROID_LOG_WARN, "FreeGLUT", __VA_ARGS__)) @@ -160,6 +161,9 @@ LOGI("android_main: end"); + /* TODO: Pausing/resuming windows not ready yet, so exiting now */ + exit(0); + /* Finish processing all events (namely APP_CMD_DESTROY) before exiting thread */ while (!app->destroyRequested) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <be...@us...> - 2012-05-04 19:59:43
|
Revision: 1303 http://freeglut.svn.sourceforge.net/freeglut/?rev=1303&view=rev Author: beuc Date: 2012-05-04 19:59:36 +0000 (Fri, 04 May 2012) Log Message: ----------- android: add code to display multi-touch events Modified Paths: -------------- trunk/freeglut/freeglut/src/android/fg_cursor_android.c trunk/freeglut/freeglut/src/android/fg_joystick_android.c trunk/freeglut/freeglut/src/android/fg_main_android.c Modified: trunk/freeglut/freeglut/src/android/fg_cursor_android.c =================================================================== --- trunk/freeglut/freeglut/src/android/fg_cursor_android.c 2012-05-04 14:57:02 UTC (rev 1302) +++ trunk/freeglut/freeglut/src/android/fg_cursor_android.c 2012-05-04 19:59:36 UTC (rev 1303) @@ -28,7 +28,7 @@ void fgPlatformSetCursor ( SFG_Window *window, int cursorID ) { - // No-op: no visible cursor on touchscreens + /* No-op: no visible cursor on touchscreens */ } void fgPlatformWarpPointer ( int x, int y ) @@ -38,4 +38,5 @@ SFG_Window* window = fgStructure.CurrentWindow; window->State.MouseX = x; window->State.MouseY = y; + /* TODO: this should simulate a fake motion event */ } Modified: trunk/freeglut/freeglut/src/android/fg_joystick_android.c =================================================================== --- trunk/freeglut/freeglut/src/android/fg_joystick_android.c 2012-05-04 14:57:02 UTC (rev 1302) +++ trunk/freeglut/freeglut/src/android/fg_joystick_android.c 2012-05-04 19:59:36 UTC (rev 1303) @@ -29,6 +29,11 @@ #include <GL/freeglut.h> #include "fg_internal.h" +/** + * TODO: Android has no joysticks at the moment (only touchscreens/touchpads), + * but we could expose the accelerometer as a 3-axis joystick. + */ + void fgPlatformJoystickRawRead( SFG_Joystick* joy, int* buttons, float* axes ) { fgWarning("fgPlatformJoystickRawRead: STUB\n"); Modified: trunk/freeglut/freeglut/src/android/fg_main_android.c =================================================================== --- trunk/freeglut/freeglut/src/android/fg_main_android.c 2012-05-04 14:57:02 UTC (rev 1302) +++ trunk/freeglut/freeglut/src/android/fg_main_android.c 2012-05-04 19:59:36 UTC (rev 1303) @@ -222,12 +222,26 @@ } } - if (AInputEvent_getType(event) == AINPUT_EVENT_TYPE_MOTION) { - int32_t action = AMotionEvent_getAction(event); + int32_t source = AInputEvent_getSource(event); + if (AInputEvent_getType(event) == AINPUT_EVENT_TYPE_MOTION + && source == AINPUT_SOURCE_TOUCHSCREEN) { + int32_t action = AMotionEvent_getAction(event) & AMOTION_EVENT_ACTION_MASK; + /* Pointer ID for clicks */ + int32_t pidx = AMotionEvent_getAction(event) >> AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT; + /* TODO: Handle multi-touch; also handle multiple sources */ + if (0) { + LOGI("motion action=%d index=%d source=%d", action, pidx, source); + int count = AMotionEvent_getPointerCount(event); + int i; + for (i = 0; i < count; i++) { + LOGI("multi(%d): %.01f,%.01f", + AMotionEvent_getPointerId(event, i), + AMotionEvent_getX(event, i), AMotionEvent_getY(event, i)); + } + } float x = AMotionEvent_getX(event, 0); float y = AMotionEvent_getY(event, 0); - LOGI("motion %.01f,%.01f action=%d", x, y, AMotionEvent_getAction(event)); - + /* Virtual arrows PAD */ /* Don't interfere with existing mouse move event */ if (!touchscreen.in_mmotion) { @@ -285,7 +299,6 @@ if (!touchscreen.vpad.on) { window->State.MouseX = x; window->State.MouseY = y; - LOGI("Changed mouse position: %f,%f", x, y); if (action == AMOTION_EVENT_ACTION_DOWN && FETCH_WCB(*window, Mouse)) { touchscreen.in_mmotion = true; INVOKE_WCB(*window, Mouse, (GLUT_LEFT_BUTTON, GLUT_DOWN, x, y)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <be...@us...> - 2013-05-19 15:01:35
|
Revision: 1621 http://sourceforge.net/p/freeglut/code/1621 Author: beuc Date: 2013-05-19 15:01:33 +0000 (Sun, 19 May 2013) Log Message: ----------- Fix random crash Modified Paths: -------------- trunk/freeglut/freeglut/src/android/fg_main_android.c trunk/freeglut/freeglut/src/android/fg_window_android.c Modified: trunk/freeglut/freeglut/src/android/fg_main_android.c =================================================================== --- trunk/freeglut/freeglut/src/android/fg_main_android.c 2013-05-19 14:57:13 UTC (rev 1620) +++ trunk/freeglut/freeglut/src/android/fg_main_android.c 2013-05-19 15:01:33 UTC (rev 1621) @@ -330,7 +330,6 @@ /* The window is being shown, get it ready. */ LOGI("handle_cmd: APP_CMD_INIT_WINDOW %p", app->window); fgDisplay.pDisplay.single_native_window = app->window; - window->State.WorkMask |= GLUT_INIT_WORK; /* start|resume: glPlatformOpenWindow was waiting for Handle to be defined and will now continue processing */ break; Modified: trunk/freeglut/freeglut/src/android/fg_window_android.c =================================================================== --- trunk/freeglut/freeglut/src/android/fg_window_android.c 2013-05-19 14:57:13 UTC (rev 1620) +++ trunk/freeglut/freeglut/src/android/fg_window_android.c 2013-05-19 15:01:33 UTC (rev 1621) @@ -64,6 +64,7 @@ /* fgPlatformProcessSingleEvent(); */ } window->Window.Handle = fgDisplay.pDisplay.single_native_window; + window->State.WorkMask |= GLUT_INIT_WORK; /* Create context */ fghChooseConfig(&window->Window.pContext.egl.Config); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |