pub struct Sdl { /* private fields */ }
Implementations§
source§impl Sdl
impl Sdl
pub fn open_game_controller( &self, index: i32 ) -> Result<GameController, SdlError>
source§impl Sdl
impl Sdl
pub fn create_surface_from( &self, pixels: &[r8g8b8a8_Srgb], width: i32, height: i32 ) -> Result<Surface, SdlError>
source§impl Sdl
impl Sdl
sourcepub fn create_gl_window(
&self,
args: CreateWinArgs<'_>
) -> Result<GlWindow, SdlError>
pub fn create_gl_window( &self, args: CreateWinArgs<'_> ) -> Result<GlWindow, SdlError>
You can only have one GL window active!
source§impl Sdl
impl Sdl
sourcepub fn set_gl_depth_bits(&self, count: u8) -> Result<(), SdlError>
pub fn set_gl_depth_bits(&self, count: u8) -> Result<(), SdlError>
Sets the minimum number of depth buffer bits (default=16).
sourcepub fn set_gl_stencil_bits(&self, count: u8) -> Result<(), SdlError>
pub fn set_gl_stencil_bits(&self, count: u8) -> Result<(), SdlError>
Sets the minimum number of stencil buffer bits (default=0).
sourcepub fn set_gl_multisample_buffers(&self, count: u8) -> Result<(), SdlError>
pub fn set_gl_multisample_buffers(&self, count: u8) -> Result<(), SdlError>
Number of multisample buffers (default=0).
- Set to 1 to allow multisampling.
- More than one multisample buffer is extremely unlikely to be available
- Also be sure to call [
set_gl_multisample_count
].
sourcepub fn set_gl_multisample_count(&self, count: u8) -> Result<(), SdlError>
pub fn set_gl_multisample_count(&self, count: u8) -> Result<(), SdlError>
Number of multisamples per normal sample (default=0).
- Usually you should set this to a power of 2. Picking 4 is a “safe default” that will usually be available, but some platforms allow 16 or more. This has diminishing returns as far as what the user can actually perceive, so more than 16 is likely a waste of GPU time.
- Also be sure to call [
set_gl_multisample_buffers
].
pub fn set_gl_context_major_version(&self, major: u8) -> Result<(), SdlError>
pub fn set_gl_context_minor_version(&self, minor: u8) -> Result<(), SdlError>
pub fn set_gl_context_flags( &self, flags: GlContextFlags ) -> Result<(), SdlError>
pub fn set_gl_profile(&self, profile: GlProfile) -> Result<(), SdlError>
pub fn set_gl_framebuffer_srgb_capable( &self, capable: bool ) -> Result<(), SdlError>
source§impl Sdl
impl Sdl
pub fn get_renderer_driver_infos(&self) -> Result<Vec<RendererInfo>, SdlError>
source§impl Sdl
impl Sdl
sourcepub fn create_renderer_window(
&self,
args: CreateWinArgs<'_>,
flags: RendererFlags
) -> Result<RendererWindow, SdlError>
pub fn create_renderer_window( &self, args: CreateWinArgs<'_>, flags: RendererFlags ) -> Result<RendererWindow, SdlError>
You can only have one GL window active!
sourcepub fn compose_custom_blend_mode(
&self,
src_color: BlendFactor,
dst_color: BlendFactor,
color_op: BlendOperation,
src_alpha: BlendFactor,
dst_alpha: BlendFactor,
alpha_op: BlendOperation
) -> BlendMode
pub fn compose_custom_blend_mode( &self, src_color: BlendFactor, dst_color: BlendFactor, color_op: BlendOperation, src_alpha: BlendFactor, dst_alpha: BlendFactor, alpha_op: BlendOperation ) -> BlendMode
source§impl Sdl
impl Sdl
pub fn init(flags: InitFlags) -> Self
sourcepub fn set_relative_mouse_mode(&self, b: bool) -> Result<(), ()>
pub fn set_relative_mouse_mode(&self, b: bool) -> Result<(), ()>
Tries to set the mouse into relative mode, returning err
if that isn’t
supported.
While the mouse is in relative mode, the cursor is hidden, and the driver will try to report continuous motion in the current window. Only relative motion events will be delivered, the mouse position will not change.
In other words, this is what you’d use for an “FPS” style interface.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Sdl
impl !Send for Sdl
impl !Sync for Sdl
impl Unpin for Sdl
impl UnwindSafe for Sdl
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more