Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/sdl3/gpu/pass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::{
BufferBinding, BufferRegion, GraphicsPipeline, IndexElementSize, LoadOp, StoreOp, Texture,
TextureRegion, TextureSamplerBinding, TextureTransferInfo, TransferBufferLocation,
},
pixels::Color,
pixels::{Color, FColor},
rect::Rect,
Error,
};
Expand Down Expand Up @@ -504,6 +504,12 @@ impl RenderPass {
pub fn set_scissor(&self, scissor: Rect) {
unsafe { sys::gpu::SDL_SetGPUScissor(self.inner, scissor.raw()) }
}

#[doc(alias = "SDL_SetGPUBlendConstants")]
pub fn set_blend_constants(&self, color: Color) {
let color = FColor::from(color);
unsafe { sys::gpu::SDL_SetGPUBlendConstants(self.inner, color.raw()) }
}
}

pub struct CopyPass {
Expand Down
2 changes: 1 addition & 1 deletion src/sdl3/pixels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ impl FColor {

// Implemented manually and kept private, because reasons
#[inline]
const fn raw(self) -> sys::pixels::SDL_FColor {
pub(crate) const fn raw(self) -> sys::pixels::SDL_FColor {
sys::pixels::SDL_FColor {
r: self.r,
g: self.g,
Expand Down
Loading