fluid.backend

This module handles input/output facilities Fluid requires to operate. It connects backends like Raylib, exposing them under a common interface so they can be changed at will.

Fluid comes with a built-in interface for Raylib.

Modules

headless
module fluid.backend.headless
Undocumented in source.
raylib5
module fluid.backend.raylib5
Undocumented in source.
simpledisplay
module fluid.backend.simpledisplay
Undocumented in source.

Public Imports

fluid.backend.raylib5
public import fluid.backend.raylib5;
Undocumented in source.
fluid.backend.headless
public import fluid.backend.headless;
Undocumented in source.
fluid.backend.simpledisplay
public import fluid.backend.simpledisplay;
Undocumented in source.

Members

Aliases

Color
alias Color = raylib.Color
Undocumented in source.
Rectangle
alias Rectangle = raylib.Rectangle
Undocumented in source.
Vector2
alias Vector2 = raylib.Vector2
Undocumented in source.
VoidDelegate
alias VoidDelegate = void delegate() @(safe)
Undocumented in source.

Enums

GamepadAxis
enum GamepadAxis
Undocumented in source.
GamepadButton
enum GamepadButton
Undocumented in source.
KeyboardKey
enum KeyboardKey
Undocumented in source.
MouseButton
enum MouseButton
Undocumented in source.

Functions

alphaBlend
Color alphaBlend(Color bottom, Color top)

Blend two colors together; apply top on top of the bottom color. If top has maximum alpha, returns top. If alpha is zero, returns bottom.

color
Color color()
Color color(string hexCode)

Create a color from hex code.

setAlpha
Color setAlpha(Color color, float alpha)

Set the alpha channel for the given color, as a float.

toHex
string toHex(Color color)

Get a hex code from color.

Interfaces

FluidBackend
interface FluidBackend

FluidBackend is an interface making it possible to bind Fluid to a library other than Raylib. Another built-in backend is fluid.simpledisplay.SimpledisplayBackend for arsd.simpledisplay.

Static functions

generateColorImage
Image generateColorImage(int width, int height, Color color)

Generate an image filled with a given color.

Static variables

defaultFluidBackend
FluidBackend defaultFluidBackend;
Undocumented in source.

Structs

Color
struct Color
Undocumented in source.
FluidMouseCursor
struct FluidMouseCursor
Undocumented in source.
Image
struct Image

Image available to the CPU.

Rectangle
struct Rectangle
Undocumented in source.
Texture
struct Texture

Represents a GPU texture.

TextureReaper
struct TextureReaper

Struct that maintains a registry of all allocated textures. It's used to finalize textures once they have been marked for destruction. This makes it possible to mark them from any thread, while the reaper runs only on the main thread, ensuring thread safety in OpenGL backends.

TextureTombstone
struct TextureTombstone

Tombstones are used to ensure textures are freed on the same thread they have been created on.

Vector2
struct Vector2
Undocumented in source.

Meta