Skip to content

club-doki7/vulkan4j

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vulkan4j

CI status

Website & JavaDoc | Vulkan Tutorial port | LearnOpenGL port | Discord

This project is heavily inspired by the vulkanalia crate.

vulkan4j is a series of graphics and relevant API binding for Java, implemented with Java 22 Project Panama java.lang.foreign APIs. This project initially focuses on Vulkan, but soon we expanded to other graphics APIs such as OpenGL and OpenGL ES. More APIs will be added in the future, feature requests and contributions are welcome!

Bindings Available

  • Vulkan (vulkan module): Generated from vk.xml and video.xml.
  • Vulkan Memory Allocator (vma module): Generated from vk_mem_alloc.h. If you use a specific build supporting vk4jSetJavaTrace, you can enjoy Java stacktrace on VMA assertion failures. Check out the vma_build directory for more information.
  • OpenGL (opengl module): Generated from gl.xml. Our supported extension list is copied from LWJGL, and not all extensions are included (since some OpenGL extensions are completely useless nowadays). Name your desired extension in the issue tracker!
  • OpenAL (openal module): Generated from OpenAL-soft header files. This module is based on OpenAL-soft 1.2, and provides a complete set of OpenAL features, including all extensions supported by OpenAL-soft.
  • GLFW (glfw module): Generated from GLFW header files.
Obsolete bindings
  • OpenGL ES 2.0 only (gles2 module): Also generated from gl.xml. This module only provides most fundamental OpenGL ES 2.0 features, and does not include any extensions. This package was initially created for the Chuigda's own use. This package will still get maintained since Chuigda wants.

ffm-plus

To improve development experience using Java 22 FFM APIs, we created a small library ffm-plus that encapsulates most commonly used facilities, such as typed pointers and bitfield operations. All our bindings use ffm-plus.

Documentation and Tutorials

Our website itself is generated with JavaDoc, with a custom overview.html.

For users new to Vulkan, there is a (almost) complete adaptation of https://vulkan-tutorial.com by Alexander Overvoorde to use Java and vulkan4j instead of C++. The published version of this tutorial can be found here, and the sources for the tutorial (including standalone working code examples for each chapter) can be found under the tutorial directory.

For OpenGL users, we ported the LearnOpenGL tutorial to use Java and vulkan4j. The published version of this tutorial can be found here, and the sources for the tutorial can be found under the tutorial directory. Till now only the first several chapters are ported, which should be adequate to get you started with OpenGL in Java. The rest of the chapters will be ported in the future.

Roadmap

  • v0.3.0 rewrite, new namespace, new ffm-plus module, use codegen-v2 module for all registry extraction and code generation.
  • API enhancements: chaining set methods for structures, LWJGL style set methods for structure members, allocateV and writeV series functions for Ptr types.
  • Full OpenGL bindings
    • Tutorial porting
  • OpenAL bindings
  • WebGPU bindings
  • Full OpenGL ES bindings
  • SDL3 bindings
  • LLVM bindings (is this graphics anymore?)

Development history before 0.3.0?

See vulkan4j-legacy.

Donation

Doki Doki 7th Design Club! is not accepting any donation at the moment though Chuigda thinks that the whole world owes him 27 billion 30 million CHF. If you like this project, either using in production or got some inspiration, just star and thank author.