2022-12-01 11:10:04 +11:00
|
|
|
use crate::{FilterMode, WrapMode};
|
2022-11-30 17:38:05 +11:00
|
|
|
use windows::Win32::Graphics::Direct3D11;
|
2022-11-30 17:35:20 +11:00
|
|
|
|
2022-11-27 07:55:14 +11:00
|
|
|
impl From<WrapMode> for Direct3D11::D3D11_TEXTURE_ADDRESS_MODE {
|
|
|
|
fn from(value: WrapMode) -> Self {
|
|
|
|
match value {
|
|
|
|
WrapMode::ClampToBorder => Direct3D11::D3D11_TEXTURE_ADDRESS_BORDER,
|
|
|
|
WrapMode::ClampToEdge => Direct3D11::D3D11_TEXTURE_ADDRESS_CLAMP,
|
|
|
|
WrapMode::Repeat => Direct3D11::D3D11_TEXTURE_ADDRESS_WRAP,
|
|
|
|
WrapMode::MirroredRepeat => Direct3D11::D3D11_TEXTURE_ADDRESS_MIRROR,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl From<FilterMode> for Direct3D11::D3D11_FILTER {
|
|
|
|
fn from(value: FilterMode) -> Self {
|
|
|
|
match value {
|
|
|
|
FilterMode::Linear => Direct3D11::D3D11_FILTER_MIN_MAG_MIP_LINEAR,
|
2023-01-30 13:19:18 +11:00
|
|
|
FilterMode::Nearest => Direct3D11::D3D11_FILTER_MIN_MAG_MIP_POINT,
|
2022-11-27 07:55:14 +11:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|