2022-12-05 14:48:57 +11:00
|
|
|
//! Binding types for the librashader C API.
|
2022-12-04 10:32:10 +11:00
|
|
|
use crate::error::LibrashaderError;
|
2022-12-05 16:06:37 +11:00
|
|
|
use librashader::presets::ShaderPreset;
|
|
|
|
use std::ptr::NonNull;
|
2022-12-04 10:32:10 +11:00
|
|
|
|
2023-01-14 10:10:09 +11:00
|
|
|
/// A handle to a shader preset object.
|
2022-12-04 11:55:27 +11:00
|
|
|
pub type libra_shader_preset_t = Option<NonNull<ShaderPreset>>;
|
2023-01-14 10:10:09 +11:00
|
|
|
|
|
|
|
/// A handle to a librashader error object.
|
2022-12-05 14:37:03 +11:00
|
|
|
pub type libra_error_t = Option<NonNull<LibrashaderError>>;
|
2022-12-04 10:32:10 +11:00
|
|
|
|
2023-01-14 10:10:09 +11:00
|
|
|
/// A handle to a OpenGL filter chain.
|
2022-12-05 14:37:03 +11:00
|
|
|
#[cfg(feature = "runtime-opengl")]
|
2023-01-14 08:55:50 +11:00
|
|
|
pub type libra_gl_filter_chain_t = Option<NonNull<librashader::runtime::gl::capi::FilterChainGL>>;
|
2022-12-04 10:56:57 +11:00
|
|
|
|
2023-01-14 10:10:09 +11:00
|
|
|
/// A handle to a Direct3D11 filter chain.
|
2023-01-15 12:13:15 +11:00
|
|
|
#[cfg(all(feature = "runtime-d3d11"))]
|
2022-12-05 16:06:37 +11:00
|
|
|
pub type libra_d3d11_filter_chain_t =
|
2023-01-14 08:55:50 +11:00
|
|
|
Option<NonNull<librashader::runtime::d3d11::capi::FilterChainD3D11>>;
|
2022-12-05 14:48:57 +11:00
|
|
|
|
2023-01-14 10:10:09 +11:00
|
|
|
/// A handle to a Vulkan filter chain.
|
2023-01-14 09:59:22 +11:00
|
|
|
#[cfg(feature = "runtime-vulkan")]
|
|
|
|
pub type libra_vk_filter_chain_t =
|
2023-01-15 19:06:09 +11:00
|
|
|
Option<NonNull<librashader::runtime::vk::capi::FilterChainVulkan>>;
|
2023-01-14 09:59:22 +11:00
|
|
|
|
2023-01-14 10:10:09 +11:00
|
|
|
/// Defines the output viewport for a rendered frame.
|
2022-12-04 10:56:57 +11:00
|
|
|
#[repr(C)]
|
|
|
|
pub struct libra_viewport_t {
|
2023-01-14 10:10:09 +11:00
|
|
|
/// The x offset in the viewport framebuffer to begin rendering from.
|
2022-12-04 10:56:57 +11:00
|
|
|
pub x: f32,
|
2023-01-14 10:10:09 +11:00
|
|
|
/// The y offset in the viewport framebuffer to begin rendering from.
|
2022-12-04 10:56:57 +11:00
|
|
|
pub y: f32,
|
2023-01-14 10:10:09 +11:00
|
|
|
/// The height of the viewport framebuffer.
|
2022-12-04 10:56:57 +11:00
|
|
|
pub height: u32,
|
2023-01-21 16:31:29 +11:00
|
|
|
/// The width of the viewport framebuffer.
|
|
|
|
pub width: u32,
|
2022-12-05 16:06:37 +11:00
|
|
|
}
|