Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
nfynt authored Apr 20, 2024
2 parents b572aa5 + bbf6bbb commit 7b7f7e0
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 12 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion endless-tunnel/app/src/main/cpp/input_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ static bool CookEvent_Motion(AInputEvent *event, CookedEventCallback callback) {
}

ev.motionPointerId = AMotionEvent_getPointerId(event, ptrIndex);
ev.motionIsOnScreen = (src == AINPUT_SOURCE_TOUCHSCREEN);
ev.motionIsOnScreen = (src & AINPUT_SOURCE_TOUCHSCREEN) != 0;
ev.motionX = AMotionEvent_getX(event, ptrIndex);
ev.motionY = AMotionEvent_getY(event, ptrIndex);

Expand Down
10 changes: 4 additions & 6 deletions native-activity/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ plugins {
id 'com.android.application'
}

// Caution: If you add any Java or Kotlin code to this project, or if you add
// any dependencies which themselves use Java/Kotlin, you'll need to remove
// `android:hasCode` from main/AndroidManifest.xml.

android {
compileSdk 33
ndkVersion '25.1.8937393'
Expand Down Expand Up @@ -30,9 +34,3 @@ android {
}
namespace 'com.example.native_activity'
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
}
8 changes: 7 additions & 1 deletion native-activity/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@
android:versionCode="1"
android:versionName="1.0">

<!-- This .apk has no Java code itself, so set hasCode to false. -->
<!--
This .apk has no Java/Kotlin code, so set hasCode to false.
If you copy from this sample and later add Java/Kotlin code, or add a
dependency on a library that does (such as androidx), be sure to set
`android:hasCode` to `true` (or just remove it, since that's the default).
-->
<application
android:allowBackup="false"
android:fullBackupContent="false"
Expand Down
4 changes: 4 additions & 0 deletions native-activity/app/src/main/cpp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ static int engine_init_display(struct engine* engine) {
eglGetConfigAttrib(display, config, EGL_NATIVE_VISUAL_ID, &format);
surface =
eglCreateWindowSurface(display, config, engine->app->window, nullptr);

/* A version of OpenGL has not been specified here. This will default to
* OpenGL 1.0. You will need to change this if you want to use the newer
* features of OpenGL like shaders. */
context = eglCreateContext(display, config, nullptr, nullptr);

if (eglMakeCurrent(display, surface, surface, context) == EGL_FALSE) {
Expand Down
8 changes: 4 additions & 4 deletions teapots/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Teapots

Teapots is an collection of Android C++ samples that uses a Teapot rendering to
demostrate Android NDK platform features:
demonstrate Android NDK platform features:

- classic-teapot: Rendering classic teapot mesh using GLES 2.0 API and
[NativeActivity](http://developer.android.com/reference/android/app/NativeActivity.html).
- more-teapots: Rendering multiple instances of Classic Teapot with GLES 3.0
Instance Rendering
- choreographer-30fps: demonstrates multiple frame rate throttoling techniques
- choreographer-30fps: demonstrates multiple frame rate throttling techniques
based on API level using Choreographer API and EGL Android presentation time
extension.
- textured-teapot: Rendering classic teapot plus textures
Expand All @@ -18,7 +18,7 @@ This sample uses the new
[Android Studio CMake plugin](http://tools.android.com/tech-docs/external-c-builds)
with C++ support.

## Pre-requisites
## Prerequisites

- Android Studio 4.0.0 with [NDK](https://developer.android.com/ndk/)
- Android
Expand Down Expand Up @@ -51,7 +51,7 @@ submitting a pull request through GitHub. Please see
[CONTRIBUTING.md](../CONTRIBUTING.md) for more details.

- [Stack Overflow](http://stackoverflow.com/questions/tagged/android-ndk)
- [Android Tools Feedbacks](http://tools.android.com/feedback)
- [Android Tools Feedback](http://tools.android.com/feedback)

## License

Expand Down

0 comments on commit 7b7f7e0

Please sign in to comment.