Struct FPoint
D struct that wraps SDL_FPoint
(from SDL 2.0.10) containing 2D floating point coordinate pair
dsdl2.FPoint
stores float
ing point x
and y
coordinate points. This wrapper also implements
vector-like operator overloading.
Constructors
Name | Description |
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
Name | Type | Description |
sdlFPoint
|
sdl.rect.SDL_FPoint | Internal SDL_FPoint struct
|
Properties
Name | Type | Description |
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
Name | Description |
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);