Struct beryllium::Sdl

source ·
pub struct Sdl { /* private fields */ }

Implementations§

source§

impl Sdl

source§

impl Sdl

source

pub fn poll_events(&self) -> Option<(Event, u32)>

source

pub fn get_ticks(&self) -> u32

Get the number of milliseconds since the SDL library initialization.

source§

impl Sdl

source

pub fn create_surface_from( &self, pixels: &[r8g8b8a8_Srgb], width: i32, height: i32 ) -> Result<Surface, SdlError>

source§

impl Sdl

source

pub fn create_gl_window( &self, args: CreateWinArgs<'_> ) -> Result<GlWindow, SdlError>

You can only have one GL window active!

source§

impl Sdl

source

pub fn set_gl_depth_bits(&self, count: u8) -> Result<(), SdlError>

Sets the minimum number of depth buffer bits (default=16).

source

pub fn set_gl_stencil_bits(&self, count: u8) -> Result<(), SdlError>

Sets the minimum number of stencil buffer bits (default=0).

source

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].
source

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].
source

pub fn set_gl_context_major_version(&self, major: u8) -> Result<(), SdlError>

source

pub fn set_gl_context_minor_version(&self, minor: u8) -> Result<(), SdlError>

source

pub fn set_gl_context_flags( &self, flags: GlContextFlags ) -> Result<(), SdlError>

source

pub fn set_gl_profile(&self, profile: GlProfile) -> Result<(), SdlError>

source

pub fn set_gl_framebuffer_srgb_capable( &self, capable: bool ) -> Result<(), SdlError>

source§

impl Sdl

source§

impl Sdl

source

pub fn create_renderer_window( &self, args: CreateWinArgs<'_>, flags: RendererFlags ) -> Result<RendererWindow, SdlError>

You can only have one GL window active!

source

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

source

pub fn init(flags: InitFlags) -> Self

source

pub fn set_controller_use_button_labels(&self, labels: bool) -> bool

source

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§

source§

impl Clone for Sdl

source§

fn clone(&self) -> Sdl

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.