Move ffi module to separate file

This commit is contained in:
Stephen Seo 2024-03-05 17:03:33 +09:00
parent 66be063ce0
commit 2d8ded2111
2 changed files with 15 additions and 16 deletions

14
src/ffi.rs Normal file
View file

@ -0,0 +1,14 @@
#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(unused_imports)]
#![allow(dead_code)]
include!(concat!(env!("OUT_DIR"), "/glfw_vk_bindings.rs"));
pub fn VK_MAKE_VERSION(major: u32, minor: u32, patch: u32) -> u32 {
(major << 22) | (minor << 12) | patch
}
pub fn VK_MAKE_API_VERSION(variant: u32, major: u32, minor: u32, patch: u32) -> u32 {
(variant << 29) | (major << 22) | (minor << 12) | patch
}

View file

@ -1,19 +1,4 @@
mod ffi {
#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(unused_imports)]
#![allow(dead_code)]
include!(concat!(env!("OUT_DIR"), "/glfw_vk_bindings.rs"));
pub fn VK_MAKE_VERSION(major: u32, minor: u32, patch: u32) -> u32 {
(major << 22) | (minor << 12) | patch
}
pub fn VK_MAKE_API_VERSION(variant: u32, major: u32, minor: u32, patch: u32) -> u32 {
(variant << 29) | (major << 22) | (minor << 12) | patch
}
}
mod ffi;
use std::collections::HashSet;
use std::ffi::{CStr, CString};