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

A headless backend. This backend does not actually render anything. This allows apps reliant on Fluid to run outside of graphical environments, provided an alternative method of access exist.

raylib5
module fluid.backend.raylib5
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.
raylib
import raylib; via public static import raylib;
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.

defaultFluidBackend
FluidBackend defaultFluidBackend()
Undocumented in source.
defaultFluidBackend
FluidBackend defaultFluidBackend()
Undocumented in source. Be warned that the author may not have intended to support it.
defaultFluidBackend
FluidBackend defaultFluidBackend()
Undocumented in source. Be warned that the author may not have intended to support it.
defaultFluidBackend
FluidBackend defaultFluidBackend()
Undocumented in source. Be warned that the author may not have intended to support it.
multiply
Color multiply(Color a, Color b)

Multiple color values.

setAlpha
Color setAlpha(Color color, float alpha)

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

setAlpha
Color setAlpha(Color color, int alpha)
Undocumented in source. Be warned that the author may not have intended to support it.
setAlpha
Color setAlpha(Color color, ubyte 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.

Static functions

generateAlphaMask
Image generateAlphaMask(int width, int height, ubyte value)

Generate an alpha mask filled with given value.

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

Generate an image filled with a given color.

generatePalettedImage
Image generatePalettedImage(int width, int height, ubyte alpha)

Generate a paletted image filled with 0-index pixels of given alpha value.

Structs

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

Image available to the CPU.

PalettedColor
struct PalettedColor

A paletted pixel, for use in palettedAlpha images; Stores images using an index into a palette, along with an alpha value.

Rectangle
struct Rectangle
Undocumented in source.
Texture
struct Texture

Image or texture can be rendered by Fluid, for example, a texture stored in VRAM.

TextureGC
struct TextureGC

Wrapper over Texture that automates destruction via GC or RAII.

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