[][src]Crate beryllium

A wrapper lib for SDL2, hereafter referred to as just "SDL" for simplicity.

The bindings themselves are provided by fermium, this crate attempts to make it safe and easy to use from Rust.

Restrictions

  • The library is very incomplete
  • The library only lets you have a single window because that's all that I personally need and it's a lot easier to make all the safety stuff work out that way. If you want more than one window you can fork this and try to figure all that out.

no_std Support

Yes on Win/Linux, no on Mac. On Windows and Linux you can start SDL from any thread as long as you stick to controlling it from just that thread. On Mac you must start SDL from the main thread, which this library checks, which requires the standard library because of how the objc crate is written.

Re-exports

pub use fermium;

Structs

AudioFormat

A per-sample data format.

AudioQueue

An AudioQueue lets you output audio by pushing samples to the device.

AudioQueueRequest

This lets you arrange your request for an AudioQueue.

ContextFlag

Values you can pass as SdlGlAttr::Flags, combine with |.

Controller

A game controller.

ControllerAxisEvent

A change in the axis value of a controller.

ControllerButtonEvent

A controller button was pressed or released.

GlProfile

Values you can pass as SdlGlAttr::Profile, pick just one.

GlWindow

A Window and its [GlContext], fused into one.

InitFlags

Flags of what subsystems to initialize.

KeyInfo

Info about a key pressed, and any modifiers.

KeyModifiers

A bit bag of modifier keys being held.

KeyboardEvent

A keyboard event.

Keycode

Virtual keycode value.

MouseButton

A bit bag of mouse buttons being pressed.

MouseButtonEvent

A mouse button was pressed or released.

MouseMotionEvent

Event for the mouse moving around.

MouseWheelEvent

The user moved the mouse wheel.

QuitEvent

The user requested to quit.

SDL

A handle to the SDL API.

Scancode

Physical scancode value.

Window

A handle to an SDL_Window.

WindowEvent

An event happened to the window.

WindowFlags

Allows you to specify the flags for window creation.

Enums

AudioChannels

The number of audio output channels.

AudioStatus

The status of an audio device.

ControllerAxis

An axis of input for a game controller.

ControllerButton

A controller button.

ControllerDeviceEvent

A controller was added, removed, or had the buttons remapped.

Event

The event possibilities.

SdlGlAttr

The various attributes that you can request a specific value for.

SwapInterval

The swap interval affects the video card's swapping of the video buffer.

WindowEventEnum

The types of window event that can happen.

WindowPosition

The starting position for a window.

Functions

get_error_unchecked

Obtains the current SDL error message.

Type Definitions

CowStr

Clone On Write, specific to &str and String.