Expand description
This crate mainly revolves around the Platform
trait, which can be
implemented to provide a “platform implementation” for the game engine.
Otherwise, this crate mostly contains some low-level parts of the engine
which are necessarily needed to implement Platform
, such as some
multithreading utilities.
This is split off of the main engine crate so that the engine and the platform implementation can be compiled independently, which appears to speed up compilation time.
Re-exports§
pub use thread_pool::TaskChannel;
pub use thread_pool::ThreadState;
Modules§
- channel
- Static memory based single-producer single-consumer channel for communication between threads.
- thread_
pool - Thread pool for running tasks on other threads.
Structs§
- Box
- Owned pointer to a
T
. - Button
- A button or key on a specific input device.
- Draw
Settings2D - Various options for controlling how draw commands should be executed.
- File
Handle - Platform-specific file handle.
- File
Read Task - Handle to an asynchronous file reading operation.
- Input
Device - A specific input device.
- Instant
- Analogous to the standard library
Instant
type, representing a point in time. - Semaphore
- Atomically counting semaphore for efficiently waiting on other threads, intended to be created by the platform implementation, making use of OS synchronization primitives.
- Sprite
Ref - Platform-specific sprite reference.
- Vertex2D
- Vertex describing a 2D point with a texture coordinate and a color.
Enums§
- Action
Category - Generic action categories for which default buttons are provided. Can be used by games to set up their default mappings for any input device. Different categories may map to the same buttons, so making inputs inputs context-sensitive are recommended.
- Blend
Mode - How drawn pixels are blended with the previously drawn pixels.
- Event
- An input event sent by the platform to the engine for handling.
- Pixel
Format - Descriptions of pixel data layouts, used to interpret the byte arrays passed into uploading functions.
- Texture
Filter - How the texture is filtered when magnified or minified.
Constants§
- AUDIO_
CHANNELS - The amount of channels of audio data played back by the engine.
- AUDIO_
SAMPLE_ RATE - Sample rate for the audio data played back by the engine.
Traits§
- Engine
Callbacks - Interface to the engine for the platform implementation.
- Platform
- A trait for using platform-dependent features from the engine without depending on any platform implementation directly. A platform implementation should implement this trait, and also call the engine’s “iterate” and “event” methods at appropriate times.
- Semaphore
Impl - A trait to implement a semaphore object.
Type Aliases§
- Input
Devices - Shorthand for an
ArrayVec
ofInputDevice
.