Struct FPoint

D struct that wraps SDL_FPoint (from SDL 2.0.10) containing 2D floating point coordinate pair

struct FPoint ;

dsdl2.FPoint stores floating point x and y coordinate points. This wrapper also implements vector-like operator overloading.

Constructors

NameDescription
this (sdlFPoint) Constructs a dsdl2.FPoint from a vanilla SDL_FPoint from bindbc-sdl
this (x, y) Constructs a dsdl2.FPoint by feeding in an x and y pair
this (xy) Constructs a dsdl2.FPoint by feeding in an array of x and y
this (point) Constructs a dsdl2.FPoint from a dsdl2.Point

Fields

NameTypeDescription
sdlFPoint sdl.rect.SDL_FPointInternal SDL_FPoint struct

Properties

NameTypeDescription
array[get] inout(float[2])Static array proxy of the dsdl2.FPoint
x[get] inout(float)Proxy to the X value of the dsdl2.FPoint
y[get] inout(float)Proxy to the Y value of the dsdl2.FPoint

Methods

NameDescription
opBinary (other) Binary element-wise operation overload template
opBinary (scalar) Binary operation overload template with scalars
opOpAssign (other) Element-wise operator assignment overload
opOpAssign (scalar) Operator assignment overload with scalars
opUnary () Unary element-wise operation overload template
toString () Formats the dsdl2.FPoint into its construction representation: "dsdl2.FPoint(<x>, <y>)"

Example

auto a = dsdl2.FPoint(1.0, 2.0);
auto b = a + a;
assert(b == dsdl2.FPoint(2.0, 4.0));

auto c = a * 2.0;
assert(b == c);