Crate dwarf_term

Source
Expand description

The dwarf-term crate allows you to draw a screen that ends up looking like dwarf fortress.

At the moment there’s only a single graphics set supported, but perhaps in future versions that will become an element that you can change at runtime.

Modules§

dpi
DPI is important, so read the docs for this module if you don’t want to be confused.
macros
All of our macros go in here.
os
Contains traits with platform-specific methods in them.
palettes
Module for color palettes you might wish to use with your indexed color images.
u16_ext
Module for code specific to u16 base images.
u32_ext
Module for code specific to u32 base images.

Macros§

check_misalign4
Checks that an address is aligned to a 4 byte bound.
check_misalign8
Checks that an address is aligned to a 8 byte bound.
check_misalign16
Checks that an address is aligned to a 16 byte bound.
check_misalign32
Checks that an address is aligned to a 32 byte bound.
determine_overlay
rgb16
As per rgba16, but automatically selects alpha=true.
rgb32
As per rgba32, but automatically selects alpha = 255.
rgba16
Builds a u16 value from the given RGBA values.
rgba32
Builds a u32 value from the given RGBA values.

Structs§

AvailableMonitorsIter
An iterator for the list of available monitors.
Context
Represents an OpenGL context.
ContextBuilder
Object that allows you to build Contexts.
DeviceId
Identifier of an input device.
DwarfTerm
A terminal where each cell has a foreground, background, and sprite id.
EventsLoop
Provides a way to retreive events from the system and from the windows that were registered to the events loop.
EventsLoopClosed
The error that is returned when an EventsLoopProxy attempts to wake up an EventsLoop that no longer exists.
EventsLoopProxy
Used to wake up the EventsLoop from another thread.
GlAttributes
Attributes to use when creating an OpenGL context.
GlWindow
Represents an OpenGL context and a Window with which it is associated.
HeadlessContext
Represents a headless OpenGL context.
HeadlessRendererBuilder
Object that allows you to build headless contexts.
Icon
An icon used for the window titlebar, taskbar, etc.
ImageMutRefIter
A struct that iterates over pixels of an Image by mutable reference.
ImageMutSlice
A mutable sub-view of some image data.
ImageRefIter
A struct that iterates over pixels of an Image by reference.
ImageSlice
A shared view of some image data.
KeyboardInput
Describes a keyboard input event.
ModifiersState
Represents the current state of the keyboard modifiers
MonitorId
Identifier for a monitor.
NESImage
An image the size of an NES screen, backed by an array.
PixelFormat
Describes a possible format. Unused.
PixelFormatRequirements
Describes how the backend should choose a pixel format.
Touch
Represents touch event
VecImage
An image backed by a Vec.
Window
Represents a window.
WindowAttributes
Attributes to use when creating a window.
WindowBuilder
Object that allows you to build windows.
WindowId
Identifier of a window. Unique for each window.

Enums§

Api
All APIs related to OpenGL that you can possibly get while using glutin.
ContextError
Error that can happen when manipulating an OpenGL context.
ControlFlow
Returned by the user callback given to the EventsLoop::run_forever method.
CreationError
Error that can happen while creating a window or a headless renderer.
DeviceEvent
Represents raw hardware events that are not associated with any particular window.
DwarfTermGliumError
Some sort of OpenGL error happened.
ElementState
Describes the input state of a key.
Event
Describes a generic event.
GlProfile
Describes the requested OpenGL context profiles.
GlRequest
Describes the OpenGL API and version that are being requested when a context is created.
MouseButton
Describes a button of a mouse controller.
MouseCursor
Describes the appearance of the mouse cursor.
MouseScrollDelta
Describes a difference in the mouse scroll wheel state.
ReleaseBehavior
The behavior of the driver when you change the current context.
Robustness
Specifies the tolerance of the OpenGL context to faults. If you accept raw OpenGL commands and/or raw shader code from an untrusted source, you should definitely care about this.
TouchPhase
Describes touch-screen input state.
VirtualKeyCode
Symbolic name for a keyboard key.
WindowCreationError
Error that can happen while creating a window or a headless renderer.
WindowEvent
Describes an event from a Window.

Statics§

GL_CORE
The minimum core profile GL context. Useful for getting the minimum required GL version while still running on OSX, which often forbids the compatibility profile features.
NES_PALETTE
A palette for NES colors.
SHARECART_PALETTE
Colors from the Sharecart1000 spec.

Traits§

GlContext
A trait for types associated with a GL context.
ReadableImage
Trait for anything that can be read as if it was an image.
WritableImage
The trait for anything that can be written to as if it was an image.
WritableImageU16Ext
This allows u16 specific extensions to the WritableImage concepts.
WritableImageU32Ext
Extra functionality that’s only available to images of u32 values.

Functions§

linear_to_u32
The inverse of u32_to_linear.
u32_to_linear
Converts an RGBA u32 into a pseudo-linear brightness float array.

Type Aliases§

AxisId
Identifier for a specific analog axis on some device.
ButtonId
Identifier for a specific button on some device.
ScanCode
Hardware-dependent keyboard scan code.