FPoint

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

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

Constructors

this
this()
Undocumented in source.
this
this(SDL_FPoint sdlFPoint)

Constructs a dsdl2.FPoint from a vanilla SDL_FPoint from bindbc-sdl

this
this(float x, float y)

Constructs a dsdl2.FPoint by feeding in an x and y pair

this
this(float[2] xy)

Constructs a dsdl2.FPoint by feeding in an array of x and y

this
this(Point point)

Constructs a dsdl2.FPoint from a dsdl2.Point

Members

Functions

array
inout(float[2]) array()

Static array proxy of the dsdl2.FPoint

opBinary
FPoint opBinary(FPoint other)

Binary element-wise operation overload template

opBinary
FPoint opBinary(float scalar)

Binary operation overload template with scalars

opOpAssign
inout(FPoint) opOpAssign(FPoint other)

Element-wise operator assignment overload

opOpAssign
inout(FPoint) opOpAssign(float scalar)

Operator assignment overload with scalars

opUnary
FPoint opUnary()

Unary element-wise operation overload template

toString
string toString()

Formats the dsdl2.FPoint into its construction representation: "dsdl2.FPoint(<x>, <y>)"

x
inout(float) x()

Proxy to the X value of the dsdl2.FPoint

y
inout(float) y()

Proxy to the Y value of the dsdl2.FPoint

Variables

sdlFPoint
SDL_FPoint sdlFPoint;

Internal SDL_FPoint struct

Examples

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);

Meta