gamesdk_common.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Copyright 2020 The Android Open Source Project
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. /*
  17. * This is the main interface to the Android Performance Tuner library, also
  18. * known as Tuning Fork.
  19. *
  20. * It is part of the Android Games SDK and produces best results when integrated
  21. * with the Swappy Frame Pacing Library.
  22. *
  23. * See the documentation at
  24. * https://developer.android.com/games/sdk/performance-tuner/custom-engine for
  25. * more information on using this library in a native Android game.
  26. *
  27. */
  28. #pragma once
  29. // There are separate versions for each GameSDK component that use this format:
  30. #define ANDROID_GAMESDK_PACKED_VERSION(MAJOR, MINOR, BUGFIX) \
  31. ((MAJOR << 16) | (MINOR << 8) | (BUGFIX))
  32. // Accessors
  33. #define ANDROID_GAMESDK_MAJOR_VERSION(PACKED) ((PACKED) >> 16)
  34. #define ANDROID_GAMESDK_MINOR_VERSION(PACKED) (((PACKED) >> 8) & 0xff)
  35. #define ANDROID_GAMESDK_BUGFIX_VERSION(PACKED) ((PACKED) & 0xff)
  36. #define AGDK_STRINGIFY(NUMBER) #NUMBER
  37. #define AGDK_STRING_VERSION(MAJOR, MINOR, BUGFIX) \
  38. AGDK_STRINGIFY(MAJOR) "." AGDK_STRINGIFY(MINOR) "." AGDK_STRINGIFY(BUGFIX)