Giter Club home page Giter Club logo

getting-started-with-vulkan-on-android-codelab's Introduction

Hello VK

Hello VK is an Android C++ sample that draws the simple, but traditional Hello World Triangle.

Aside from the base functionality the source code also covers convenient features such as:

Pre-requisites

  • Android Studio 4.2+ with NDK bundle.

Getting Started

  1. Download Android Studio
  2. Launch Android Studio.
  3. Open the sample directory.
  4. Open File/Project Structure...
  • Click Download or Select NDK location.
  1. Click File/Sync Project with Gradle Files.
  2. Click Run/Run 'app'.

Validation layers

As the validation layer is a sizeable download, we chose to not ship them within the apk. As such in order to enable validation layer, please follow the simple steps below:

  1. Download the latest android binaries from: https://github.com/KhronosGroup/Vulkan-ValidationLayers/releases
  2. Place them in their respective ABI folders located in: app/src/main/jniLibs
  3. Go to hellovk.h, search for 'bool enableValidationLayers = false' and toggle that to true.

Extra information:

As Vulkan is well documented we will not provide detailed instructions regarding the innerworkings of Vulkan. You should however, find useful comments and references regarding the android to vulkan bridge. We chose to use Android Glue for a seamless experience. More details here: https://developer.android.com/reference/games/game-activity/group/android-native-app-glue

These vulkan tutorials should hopefully cover everything needed to understand the workings of the Vulkan app: https://vulkan-tutorial.com https://vkguide.dev/docs/chapter-1/vulkan_init_flow/

Lastly, you will notice that the Kotlin file is somewhat redundant. Luckily, if you do not require any additional/custom application behaviour, the Android(Kotlin) source files can be completely removed and the AndroidManifest.xml tweaked as specified here: https://developer.android.com/ndk/samples/sample_na

Support

If you've found an error in these samples, please file an issue.

Patches are encouraged, and may be submitted by forking this project and submitting a pull request through GitHub. Please see CONTRIBUTING.md for more details.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.