1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
//! # mira
//! [![crates.io](https://img.shields.io/crates/v/mira.svg)](https://crates.io/crates/mira)
//! [![docs.rs](https://docs.rs/mira/badge.svg)](https://docs.rs/mira)
//! [![license](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
//!
//! 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.
//!
//! ```rust
//! 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(())
//! }
//! ```
//! <br>
//!
//! ## Examples
//! Successfully tested on Linux(Lubuntu 20.04) with Intel(R) HD Graphics 620 (KBL GT2).
//! <br><br>
//!
//! ### Color
//! Displays a window with a purple background.
//! ```bash
//! cargo run --example color
//! ```
//!
//! ![screenshot](https://github.com/onlymaresia/mira/raw/HEAD/examples/mira_color.png)
//! <br><br>
//!
//! ## Vulkan version
//! 1.3.257
//!
//! [Vulkan Changelog](https://github.com/KhronosGroup/Vulkan-Docs/blob/main/ChangeLog.adoc)
//! <br><br>
//!
//! ## License
//!
//! [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0)
//! <br><br>

#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]

pub mod error;
pub mod loader;
pub mod mem;
pub mod version;
pub mod vulkan;