use utils::c_bindings::*;
use utils::vk_traits::*;
use utils::vk_ptr::*;
use utils::vk_convert::*;
use std::os::raw::c_char;
use std::ops::Drop;
use std::ptr;
use std::mem;
use std::cmp;
use std::slice;
use vulkan::*;
use vulkan::vk::*;
#[doc(hidden)]
pub type RawVkSampler = u64;
#[derive(Debug, Clone, Copy)]
pub struct VkSampler {
_handle: RawVkSampler,
_fn_table: *mut VkFunctionTable
}
impl VkRawType<VkSampler> for RawVkSampler {
fn vk_to_wrapped(src: &RawVkSampler) -> VkSampler {
VkSampler {
_handle: *src,
_fn_table: ptr::null_mut()
}
}
}
impl VkWrappedType<RawVkSampler> for VkSampler {
fn vk_to_raw(src: &VkSampler, dst: &mut RawVkSampler) {
*dst = src._handle
}
}
impl Default for VkSampler {
fn default() -> VkSampler {
VkSampler {
_handle: 0,
_fn_table: ptr::null_mut()
}
}
}
impl PartialEq for VkSampler {
fn eq(&self, other: &VkSampler) -> bool {
self._handle == other._handle
}
}
impl VkSetup for VkSampler {
fn vk_setup(&mut self, fn_table: *mut VkFunctionTable) {
self._fn_table = fn_table;
}
}
impl VkSampler {
pub fn vk_handle(&self) -> u64 {
self._handle
}
pub fn is_null(&self) -> bool {
self._handle == 0
}
pub fn null() -> Self {
Self {
_handle: 0,
_fn_table: ptr::null_mut()
}
}
pub fn destroy(&self) {
unsafe {
((&*self._fn_table).vkDestroySampler)((*self._fn_table).device, self._handle, ptr::null());
}
}
}