Intégrer Android Frame Pacing dans votre moteur de rendu OpenGL
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Ce tutoriel explique comment intégrer Android Frame Pacing à votre chaîne d'outils, comment utiliser les fonctions fournies par cette bibliothèque et comment vous assurer que le frame pacing s'est amélioré dans votre jeu. Android Frame Pacing est disponible sous forme de bibliothèque statique ou partagée dans les bibliothèques AGDK.
Exécutez l'exemple AGDKTunnel dans Android Studio. Cet exemple de projet intègre Android Frame Pacing à un jeu qui utilise OpenGL ES pour le rendu.
Ouvrez Android Studio.
Cliquez sur Projets > Ouvrir, puis sélectionnez le répertoire /games-samples/agdk/agdktunnel.
Attendez qu'Android Studio synchronise le projet.
Connectez un appareil ou créez un appareil virtuel pour exécuter l'exemple (pour plus d'informations, consultez Créer et exécuter votre application).
Sélectionnez l'appareil cible, puis cliquez sur Run (Exécuter) .
L'exemple d'APK doit compiler et lancer l'installation sur l'appareil cible. Si vous rencontrez des erreurs, vérifiez les points suivants :
Vous disposez d'une version compatible du SDK Android. Consultez le champ compileSdkVersion dans le fichier build.gradle du module d'application pour en savoir plus. Vous pouvez mettre à jour la version du SDK à partir de l'onglet SDK Platforms (Plates-formes de SDK) de SDK Manager.
Vous disposez d'une version compatible du NDK Android. Consultez le champ ndkVersion dans le fichier build.gradle du module d'application pour en savoir plus. Vous pouvez installer une version spécifique de NDK à partir de l'onglet SDK Tools de SDK Manager.
Le fichier local.properties du projet ne contient pas d'entrée pour ndk.dir. Cet emplacement est spécifié par Android Studio et utilise la version de NDK ci-dessus. Si vous disposez de cette entrée, effacez toute la ligne.
Après toute modification de paramètre de compilation, nettoyez le projet (Build > Clean Project ou Compilation > Nettoyer le projet) et actualisez les projets C++ associés (Build > Refresh Linked C++ Projects ou Compilation > Actualiser les projets C++ associés).
Le contenu et les exemples de code de cette page sont soumis aux licences décrites dans la Licence de contenu. Java et OpenJDK sont des marques ou des marques déposées d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/08/26 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Il n'y a pas l'information dont j'ai besoin","missingTheInformationINeed","thumb-down"],["Trop compliqué/Trop d'étapes","tooComplicatedTooManySteps","thumb-down"],["Obsolète","outOfDate","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Mauvais exemple/Erreur de code","samplesCodeIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/08/26 (UTC)."],[],[],null,["This tutorial describes how to integrate Android Frame Pacing into your\ntoolchain, how to use the functions that the library provides, and how to verify\nthat your frame pacing has improved. Android Frame Pacing is available as a\nstatic or shared library in the AGDK Libraries.\n\nGet started\n\n1. Clone the [`games-samples` repository](https://github.com/android/games-samples.git).\n2. Follow the instructions in the [prerequisites section of the AGDKTunnel README](https://github.com/android/games-samples/tree/main/agdk/agdktunnel#prerequisites).\n3. Run the [AGDKTunnel sample](https://github.com/android/games-samples/tree/main/agdk/agdktunnel) in Android Studio. This example\n project integrates Android Frame Pacing into a game that uses OpenGL ES for\n rendering.\n\n 1. Open Android Studio.\n 2. Click **Projects \\\u003e Open** and select the `/games-samples/agdk/agdktunnel` directory.\n 3. Wait for Android Studio to sync the project.\n 4. Connect a device or create a virtual device to run the sample (for more information, see [Build and run your app](/studio/run)).\n 5. Select the target device and click **Run** .\n 6. The sample APK should build and install on the target device. If you\n encounter errors, check the following:\n\n - You have a [supported version](/games/sdk#requirements) of the Android SDK; see the `compileSdkVersion` field in the app module `build.gradle` file for more information. You can [update the SDK version](/studio/intro/update#sdk-manager) from the **SDK Platforms** tab in the SDK Manager.\n - You have a [supported version](/games/sdk#requirements) of the Android NDK; see the `ndkVersion` field in the app module `build.gradle` file for more information. You can [install a specific version of the NDK](/studio/projects/install-ndk#specific-version) from the **SDK Tools** tab in the SDK Manager.\n - The `local.properties` file in the project does *not* have an entry for `ndk.dir`. This location is specified by Android Studio and uses the NDK version from above. If you have this entry, clear the entire line.\n - After any build setting change, clean the project (**Build \\\u003e Clean\n Project** ) and refresh the linked C++ projects (**Build \\\u003e Refresh\n Linked C++ Projects**)."]]