#![no_std]
#![allow(bad_style)]
#![warn(missing_docs)]
#![allow(clippy::missing_safety_doc)]
#![cfg_attr(docs_rs, feature(doc_cfg))]
pub use core::ffi::{
c_char, c_double, c_float, c_int, c_long, c_longlong, c_schar, c_short,
c_uchar, c_uint, c_ulong, c_ulonglong, c_ushort, c_void,
};
macro_rules! impl_bit_ops_for_tuple_newtype {
($t:ty) => {
impl core::ops::BitAnd for $t {
type Output = Self;
#[inline]
#[must_use]
fn bitand(self, rhs: Self) -> Self::Output {
Self(self.0 & rhs.0)
}
}
impl core::ops::BitAndAssign for $t {
#[inline]
fn bitand_assign(&mut self, rhs: Self) {
self.0 &= rhs.0
}
}
impl core::ops::BitOr for $t {
type Output = Self;
#[inline]
#[must_use]
fn bitor(self, rhs: Self) -> Self::Output {
Self(self.0 | rhs.0)
}
}
impl core::ops::BitOrAssign for $t {
#[inline]
fn bitor_assign(&mut self, rhs: Self) {
self.0 |= rhs.0
}
}
impl core::ops::BitXor for $t {
type Output = Self;
#[inline]
#[must_use]
fn bitxor(self, rhs: Self) -> Self::Output {
Self(self.0 ^ rhs.0)
}
}
impl core::ops::BitXorAssign for $t {
#[inline]
fn bitxor_assign(&mut self, rhs: Self) {
self.0 ^= rhs.0
}
}
impl core::ops::Not for $t {
type Output = Self;
#[inline]
#[must_use]
fn not(self) -> Self::Output {
Self(!self.0)
}
}
};
}
pub mod prelude;
pub mod audio;
pub mod blendmode;
pub mod clipboard;
pub mod cpuinfo;
pub mod error;
pub mod events;
pub mod filesystem;
pub mod gamecontroller;
pub mod gesture;
pub mod hints;
pub mod joystick;
pub mod keyboard;
pub mod keycode;
pub mod loadso;
pub mod messagebox;
pub mod mouse;
pub mod pixels;
pub mod platform;
pub mod power;
pub mod quit;
pub mod rect;
pub mod renderer;
pub mod rwops;
pub mod scancode;
pub mod sensor;
pub mod stdinc;
pub mod surface;
pub mod syswm;
pub mod timer;
pub mod touch;
pub mod version;
pub mod video;
#[cfg(feature = "vulkan")]
pub mod vulkan;
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(transparent)]
pub struct SDL_InitFlags(pub u32);
impl_bit_ops_for_tuple_newtype!(SDL_InitFlags);
#[allow(missing_docs)]
pub const SDL_INIT_TIMER: SDL_InitFlags = SDL_InitFlags(0x00000001);
#[allow(missing_docs)]
pub const SDL_INIT_AUDIO: SDL_InitFlags = SDL_InitFlags(0x00000010);
pub const SDL_INIT_VIDEO: SDL_InitFlags = SDL_InitFlags(0x00000020);
pub const SDL_INIT_JOYSTICK: SDL_InitFlags = SDL_InitFlags(0x00000200);
#[allow(missing_docs)]
pub const SDL_INIT_HAPTIC: SDL_InitFlags = SDL_InitFlags(0x00001000);
pub const SDL_INIT_GAMECONTROLLER: SDL_InitFlags = SDL_InitFlags(0x00002000);
#[allow(missing_docs)]
pub const SDL_INIT_EVENTS: SDL_InitFlags = SDL_InitFlags(0x00004000);
#[allow(missing_docs)]
pub const SDL_INIT_SENSOR: SDL_InitFlags = SDL_InitFlags(0x00008000);
pub const SDL_INIT_NOPARACHUTE: SDL_InitFlags = SDL_InitFlags(0x00100000);
#[allow(missing_docs)]
pub const SDL_INIT_EVERYTHING: SDL_InitFlags = SDL_InitFlags(
SDL_INIT_TIMER.0
| SDL_INIT_AUDIO.0
| SDL_INIT_VIDEO.0
| SDL_INIT_EVENTS.0
| SDL_INIT_JOYSTICK.0
| SDL_INIT_HAPTIC.0
| SDL_INIT_GAMECONTROLLER.0
| SDL_INIT_SENSOR.0,
);
extern "C" {
pub fn SDL_Init(flags: SDL_InitFlags) -> c_int;
pub fn SDL_InitSubSystem(flags: SDL_InitFlags) -> c_int;
pub fn SDL_QuitSubSystem(flags: SDL_InitFlags) -> c_int;
pub fn SDL_WasInit(flags: SDL_InitFlags) -> c_int;
pub fn SDL_Quit();
}