comparison src/SDL_android.cpp @ 5001:77df56570442

Added "mouse" support for the Android touch screen
author Sam Lantinga <slouken@libsdl.org>
date Thu, 13 Jan 2011 18:31:15 -0800
parents 6a10693e66c3
children
comparison
equal deleted inserted replaced
5000:6a10693e66c3 5001:77df56570442
24 #include "SDL_android.h" 24 #include "SDL_android.h"
25 25
26 extern "C" { 26 extern "C" {
27 #include "events/SDL_events_c.h" 27 #include "events/SDL_events_c.h"
28 #include "video/android/SDL_androidkeyboard.h" 28 #include "video/android/SDL_androidkeyboard.h"
29 #include "video/android/SDL_androidtouch.h"
29 #include "video/android/SDL_androidvideo.h" 30 #include "video/android/SDL_androidvideo.h"
30 31
31 /* Impelemented in audio/android/SDL_androidaudio.c */ 32 /* Impelemented in audio/android/SDL_androidaudio.c */
32 extern void Android_RunAudioThread(); 33 extern void Android_RunAudioThread();
33 } // C 34 } // C
122 // Touch 123 // Touch
123 extern "C" void Java_org_libsdl_app_SDLActivity_onNativeTouch( 124 extern "C" void Java_org_libsdl_app_SDLActivity_onNativeTouch(
124 JNIEnv* env, jclass jcls, 125 JNIEnv* env, jclass jcls,
125 jint action, jfloat x, jfloat y, jfloat p) 126 jint action, jfloat x, jfloat y, jfloat p)
126 { 127 {
127 #ifdef DEBUG 128 Android_OnTouch(action, x, y, p);
128 __android_log_print(ANDROID_LOG_INFO, "SDL",
129 "SDL: native touch event %d @ %f/%f, pressure %f\n",
130 action, x, y, p);
131 #endif
132
133 //TODO: Pass this off to the SDL multitouch stuff
134 } 129 }
135 130
136 // Accelerometer 131 // Accelerometer
137 extern "C" void Java_org_libsdl_app_SDLActivity_onNativeAccel( 132 extern "C" void Java_org_libsdl_app_SDLActivity_onNativeAccel(
138 JNIEnv* env, jclass jcls, 133 JNIEnv* env, jclass jcls,