瀏覽代碼

android: JNI hooks for single touch input.

legacy
Sam Hocevar sam 13 年之前
父節點
當前提交
e43d7b07e0
共有 1 個檔案被更改,包括 21 行新增0 行删除
  1. +21
    -0
      src/androidapp.cpp

+ 21
- 0
src/androidapp.cpp 查看文件

@@ -69,6 +69,27 @@ Java_org_zoy_LolEngine_LolGLSurfaceView_nativePause(JNIEnv* env)
/* TODO: unimplemented */
}

extern "C" void
Java_org_zoy_LolEngine_LolGLSurfaceView_nativeDown(JNIEnv* env)
{
Input::SetMouseButton(0);
}

extern "C" void
Java_org_zoy_LolEngine_LolGLSurfaceView_nativeUp(JNIEnv* env)
{
Input::UnsetMouseButton(0);
}

extern "C" void
Java_org_zoy_LolEngine_LolGLSurfaceView_nativeMove(JNIEnv* env, jobject thiz,
jint x, jint y)
{
vec2i pos(x * 640 / Video::GetWidth(),
480 - 1 - y * 480 / Video::GetHeight());
Input::SetMousePos(pos);
}

/* Call to render the next GL frame */
extern "C" void
Java_org_zoy_LolEngine_LolRenderer_nativeRender(JNIEnv* env)


Loading…
取消
儲存