Pure and simple Vulkan bindings generated from Vulkan-Headers!

Overview

mira

crates.io docs.rs license

Pure and simple Vulkan bindings generated from Vulkan-Headers!

Mira provides a simple and straightforward way to interact with Vulkan. Everything was generated by bindgen and uses the original API names. This crate provides:

  • πŸ‘€ Function pointers!
  • πŸ’― Dynamic loader of instance and device commands!
  • ✍️ Original names of commands, structures and macros!
  • πŸ’ͺ Extra useful features to help with development!
  • πŸ˜€ Simple examples!

Code

Enumerate all instance extensions.

use mira::error::MiraError;
use mira::loader;
use mira::mem::{zeroed_vec, from_cstring};
use mira::vulkan::*;
use const_cstr::*;

fn main() -> Result<(), MiraError> {
    let enumerate_instance_extensions:PFN_vkEnumerateInstanceExtensionProperties;
    enumerate_instance_extensions = unsafe {
        loader::instance(std::ptr::null_mut(), const_cstr!("vkEnumerateInstanceExtensionProperties"))?
    };

    let mut count:u32 = 0;
    unsafe { enumerate_instance_extensions(std::ptr::null_mut(), &mut count, std::ptr::null_mut()) };
    let mut extensions = unsafe { zeroed_vec::<VkExtensionProperties>(count as usize) };

    unsafe { enumerate_instance_extensions(std::ptr::null_mut(), &mut count, extensions.as_mut_ptr()) };

    println!("Instance extensions");
    for extension in extensions.iter().enumerate() {
        let str = match unsafe { from_cstring(extension.1.extensionName.as_ptr()) } {
            Ok(str) => str,
            Err(_) => continue,
        };

        println!("extension #{} - {}", extension.0, str);
    }

    Ok(())
}

Examples

Successfully tested on Linux(Lubuntu 20.04) with Intel(R) HD Graphics 620 (KBL GT2).

Color

Displays a window with a purple background.

cargo run --example color

screenshot

Vulkan version

1.2.189.0

License

Apache 2.0

You might also like...
A low-level library for OpenGL context creation, written in pure Rust.

glutin - OpenGL, UTilities and INput A low-level library for OpenGL context creation, written in pure Rust. [dependencies] glutin = "0.28.0" Documenta

A low-level library for OpenGL context creation, written in pure Rust.

glutin - OpenGL, UTilities and INput A low-level library for OpenGL context creation, written in pure Rust. [dependencies] glutin = "0.28.0" Documenta

Multi-channel signed distance field (MSDF) generator for fonts implemented in pure Rust.

msdfont WIP - school started so less updates from now on :(( Multi-channel signed distance field (MSDF) generator for fonts implemented in pure Rust.

RPG Dialog support for Bevy, written in pure Rust!

🌷 🌷 Bevy x RPG Dialog 🌸 🌸 RPG Dialog support for Bevy, written in pure Rust! bevy-rpg is a plugin crate that adds dialog functionalities to Bevy,

A Rust wrapper and bindings of Allegro 5 game programming library

RustAllegro A thin Rust wrapper of Allegro 5. Game loop example extern crate allegro; extern crate allegro_font; use allegro::*; use allegro_font::*;

Bindings to TinyGL, a Small, Free and Fast Subset of OpenGL

TinyGL is a very lightweight partial OpenGL implementation. Its small size makes it ideal for static linking.

corange-rs CorangeCorange lucidscape/corange-rs β€” Corange bindings

CORANGE-RS This crate provides an interface to the Corange game engine, written in Pure C, SDL and OpenGL by Daniel Holden. Features include: deferred

Rust bindings for GDNative

GDNative bindings for Rust Rust bindings to the Godot game engine. Website | User Guide | API Documentation Stability The bindings cover most of the e

SDL bindings for Rust

Rust-SDL Bindings for SDL in Rust Overview Rust-SDL is a library for talking to SDL from Rust. Low-level C components are wrapped in Rust code to make

Owner
maresia
Give me some ETH or BNB: maresia.eth
maresia
Vulkan and Rust rendering~game engine which creation is covered with YouTube videos

Vulkan and Rust rendering~game engine which creation is covered with YouTube videos

小ι³₯ 11 Dec 4, 2022
Vulkan rendering sandbox for raytracing

sol-rs β˜€ sol-rs is a small rendering toolkit for Vulkan, with a focus on real-time raytracing (which is not currently available via other APIs such as

Γ‰ric Renaud-Houde 65 Dec 7, 2022
GFA visualizer, GPU-accelerated using Vulkan

gfaestus - Vulkan-accelerated GFA visualization Demo: https://youtu.be/TOJZeeCqatk gfaestus is a tool for visualizing and interacting with genome grap

Christian Fischer 46 Nov 29, 2022
A barebones example of how to integrate OpenXR with wgpu (Vulkan-only)

wgpu-openxr-example a barebones example of how to integrate OpenXR with wgpu (Vulkan-only) It has four modes: cargo run --no-default-features: desktop

Philpax 21 Dec 15, 2022
A vulkan library.

Docs.rs vkvk A vulkan library. Running The Example The shaders aren't compiled as part of the build script. Instead, run shader_build.bat (or copy the

Lokathor 7 Mar 13, 2023
A simple Verlet integration solver written using the Rust SDL2 bindings.

Rust Verlet Solver A simple Verlet integration solver written using the Rust SDL2 bindings. Where's the friction?! Building cargo-vcpkg is required in

Will 8 Jun 6, 2022
A simple Verlet integration solver written using the Rust SDL2 bindings.

Rust Verlet Solver A simple Verlet integration solver written using the Rust SDL2 bindings. Where's the friction?! Building cargo-vcpkg is required in

Will 8 Jun 6, 2022
Pure, minimal, and scalable timers

timer-queue A pure, minimal, and scalable structure for tracking expiration of timers let mut q = TimerQueue::new(); q.insert(42, "second"); q.insert(

Benjamin Saunders 18 Nov 15, 2022
unrust - A pure rust based (webgl 2.0 / native) game engine

unrust A pure rust based (webgl 2.0 / native) game engine Current Version : 0.1.1 This project is under heavily development, all api are very unstable

null 368 Jan 3, 2023
Pure C Game Engine

Corange game engine Version 0.8.0 Written in Pure C, SDL and OpenGL. Running Corange is a library, but to take a quick look at some of the things it d

Daniel Holden 1.6k Jan 3, 2023