No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
justindriggers Merge pull request #2 from justindriggers/memoryAllocation
Implement memory allocation/mapping and Buffers
Latest commit cce8549 Sep 18, 2018


Vulkan Java API

The Vulkan Java API is an object-oriented Java library, backed by the Lightweight Java Game Library Vulkan API. The Java API aims to encapsulate the complexities of struct construction and memory management into classes that are more easily understood by those uncomfortable with such concepts.


This library is a work-in-progress, and the API is incomplete. Contributions and feedback are welcome and appreciated.

But why?

The original goal behind writing this library was, first and foremost, to familiarize myself with the Vulkan API.

However, this library does have a lot of potential for the future:

  • Apple recently deprecated OpenGL, pushing developers to use Metal instead.
  • KhronosGroup released MoltenVK, providing a Vulkan-to-Metal compatibility layer for Apple systems.
  • It is unlikely that libGDX (the most prominent Java-based game library at the time of this writing) will support Vulkan any time soon.


  • Vulkan APIs that begin with vkCreate are covered by Java Object instantiation.
    • The vkCreateSemaphore function (which requires a VkDevice) is invoked simply by constructing a new Semaphore(device).
  • Vulkan APIs that begin with vkDestroy are invoked by implementing the AutoCloseable interface.
    • The vkDestroySemaphore function is invoked by calling semaphore.close(), or using a try-with-resources block.
  • Vulkan APIs that act on a specific parameter are implemented as methods on the corresponding object.
    • The vkDeviceWaitIdle function (which requires a VkDevice) is invoked by calling device.waitIdle().

Getting Started


import org.gradle.internal.os.OperatingSystem

project.ext.lwjglVersion = "3.2.0"
project.ext.hasVulkanNatives = false
switch (OperatingSystem.current()) {
   case OperatingSystem.WINDOWS:
       project.ext.lwjglNatives = "natives-windows"
   case OperatingSystem.LINUX:
       project.ext.lwjglNatives = "natives-linux"
   case OperatingSystem.MAC_OS:
       project.ext.lwjglNatives = "natives-macos"
       project.ext.hasVulkanNatives = true
repositories {
   maven {
       url = ''
dependencies {

   if (project.ext.hasVulkanNatives) {


Check out for a more comprehensive usage example.