Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Aşağıdaki bölümlerde, Tuning Fork kitaplığını araç zincirinize nasıl entegre edeceğiniz ve kitaplığın sağladığı işlevleri nasıl kullanacağınız açıklanmaktadır. Kitaplık, AGDK Kitaplıkları'nda statik veya paylaşılan kitaplık olarak kullanılabilir.
SDK'yı makinenize indirip kaynak kontrol sisteminize ekledikten sonra, projenizin derleme ayarlarında aşağıdaki bölümlerde listelenen değişiklikleri yapın.
Başlamadan önce
Tuning Fork kitaplığını entegre etmeden önce Android Frame Pacing kitaplığını entegre etmeniz gerekir. Bu işlemi yaparsanız Tuning Fork kitaplığı, kare süresini otomatik olarak kaydedebilir. Tick işlevlerini kendiniz açıkça çağırmanız gerekmez.
Daha fazla bilgi için aşağıdaki entegrasyon kılavuzlarına bakın:
Statik kitaplık bölümündeki adımlar, belirli ABI, API düzeyi, NDK ve STL kombinasyonu için derlenen Tuning Fork kitaplığının bir sürümüne karşı statik olarak bağlantı oluşturur. Bu kombinasyon ayarlarınız için kullanılamıyorsa bunun yerine paylaşılan kitaplığa bağlantı oluşturabilirsiniz:
Statik bağlantı, libtuningfork.so paylaşılan kitaplığını paketlemeniz gerekmediğinden çok daha küçük bir kod alanı sağlar.
CMake'i kullanma (yalnızca statik kitaplık)
CMake kullanıyorsanız örnek bir CMake yapılandırması için gamesdk/samples/tuningfork/insightsdemo/app/CMakeLists.txt dosyasına bakın. Son kontrolleri yapan, uygun derleyici dahil etme yollarını ekleyen ve kitaplığı bağlamak için kullanabileceğiniz bir hedef oluşturan bir yardımcı program dosyası (gamesdk/samples/gamesdk.cmake) içerir.
Bu yardımcı programı kullanmak için aşağıdakileri yapın:
Bu dosyayı CMakeLists.txt dosyanıza ekleyin:
include("path/to/gamesdk/samples/gamesdk.cmake")
Oyun SDK'sını içeren klasörle add_gamesdk_target işlevini çağırın: add_gamesdk_target(PACKAGE_DIR
path/to/gamesdk)
Yerel kitaplığınızın target_link_libraries bölümüne tuningfork öğesini bağımlılık olarak ekleyin (Android Frame Pacing kitaplığını entegre ettiyseniz swappy öğesini de ekleyin):
target_link_libraries(native-lib swappy tuningfork ...)
Bu sayfadaki içerik ve kod örnekleri, İçerik Lisansı sayfasında açıklanan lisanslara tabidir. Java ve OpenJDK, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-08-26 UTC.
[[["Anlaması kolay","easyToUnderstand","thumb-up"],["Sorunumu çözdü","solvedMyProblem","thumb-up"],["Diğer","otherUp","thumb-up"]],[["İhtiyacım olan bilgiler yok","missingTheInformationINeed","thumb-down"],["Çok karmaşık / çok fazla adım var","tooComplicatedTooManySteps","thumb-down"],["Güncel değil","outOfDate","thumb-down"],["Çeviri sorunu","translationIssue","thumb-down"],["Örnek veya kod sorunu","samplesCodeIssue","thumb-down"],["Diğer","otherDown","thumb-down"]],["Son güncelleme tarihi: 2025-08-26 UTC."],[],[],null,["The following sections describe how to integrate the Tuning Fork library\ninto your toolchain and how to use the functions that the library provides. The\nlibrary is available as a static or shared library in the AGDK Libraries.\n\nAfter you've [downloaded the SDK](/games/sdk#download) to your machine and\nchecked it into your source control system, make the changes listed in the\nfollowing sections to your project's build settings.\n\nBefore you begin\n\nYou should integrate the [Android Frame Pacing library](/games/sdk/frame-pacing)\nbefore integrating the Tuning Fork library. If you do this, the\nTuning Fork library can automatically record frame time; there is no\nneed to explicitly call the tick functions yourself.\n\nSee the following integration guides for more information:\n\n- [Integrate Android Frame Pacing into your OpenGL renderer](/games/sdk/frame-pacing/opengl)\n- [Integrate Android Frame Pacing into your Vulkan renderer](/games/sdk/frame-pacing/vulkan)\n\nStatic library\n\nTo link your project to the static library, do the following:\n\n1. Add `gamesdk/include` to your compiler include paths.\n2. Add a path of the following form in your linker library paths:\n\n ```\n gamesdk/libs/architecture_APIapiLevel_NDKndkVersion_stlVersion_Release\n ```\n\n Look in `gamesdk/libs` and pick the one that best suits your toolchain (for\n example, `gamesdk/libs/arm64-v8a_API24_NDK17_cpp_static_Release`).\n3. Add `-ltuningfork_static` to your linker command (and `-lswappy_static` if\n you integrated the Android Frame Pacing library).\n\n4. Add the `INTERNET` permission to your `AndroidManifest.xml` file:\n\n \u003cuses-permission android:name=\"android.permission.INTERNET\" /\u003e\n\nShared library\n\nThe steps in the [static library](#static-library) section statically link\nagainst a version of the Tuning Fork library compiled for the given ABI,\nAPI level, NDK, and STL combination. If the combination is not available for\nyour settings, you can instead link against the shared library:\n\n1. Add `gamesdk/include` to your compiler include paths.\n2. Add a path of the following form in your linker library paths:\n\n ```\n gamesdk/libs/architecture_APIapiLevel_NDKndkVersion_stlVersion_Release/lib/tuningfork\n ```\n3. Add `-ltuningfork` to your linker command (and `-lswappy` if you integrated\n the Android Frame Pacing library).\n\n4. Add the `INTERNET` permission to your `AndroidManifest.xml` file:\n\n \u003cuses-permission android:name=\"android.permission.INTERNET\" /\u003e\n\nStatic linking gives you a much smaller code footprint as you don't need to\nbundle the `libtuningfork.so` shared library.\n\nUsing CMake (static library only)\n\nIf you are using CMake, see the\n`gamesdk/samples/tuningfork/insightsdemo/app/CMakeLists.txt` file for an example\nCMake configuration. It includes a utility file,\n`gamesdk/samples/gamesdk.cmake`, which performs final checks, adds the proper\ncompiler include paths, and generates a target that you can use to link the\nlibrary.\n\nTo use this utility, do the following:\n\n1. Include this file in your `CMakeLists.txt` file: `include(\"`\u003cvar translate=\"no\"\u003epath/to/gamesdk\u003c/var\u003e`/samples/gamesdk.cmake\")`\n2. Call the `add_gamesdk_target` function with the folder containing the gamesdk: `add_gamesdk_target(PACKAGE_DIR\n `\u003cvar translate=\"no\"\u003epath/to/gamesdk\u003c/var\u003e`)`\n3. In your `target_link_libraries` for your native library, add `tuningfork` as a dependency (and `swappy` if you integrated the Android Frame Pacing library): ` target_link_libraries(native-lib swappy tuningfork ...) `\n\n| **Note:** The path to the gamesdk used for `include` and `add_gamesdk_target` can either be absolute (for example, `/home/yourusername/gamesdk` or `C:\\Android\\gamesdk`) or relative to the `CMakeLists.txt` file.\n\nFor advanced usage of CMake, see the [`gamesdk.cmake` source file](https://android.googlesource.com/platform/frameworks/opt/gamesdk/+/refs/heads/master/samples/gamesdk.cmake)."]]