Struct Point
D struct that wraps SDL_Point
containing 2D integer coordinate pair
dsdl2.Point
stores signed int
eger x
and y
coordinate points. This wrapper also implements vector-like
operator overloading.
Constructors
Name | Description |
this
(sdlPoint)
|
Constructs a dsdl2.Point from a vanilla SDL_Point from bindbc-sdl
|
this
(x, y)
|
Constructs a dsdl2.Point by feeding in an x and y pair
|
this
(xy)
|
Constructs a dsdl2.Point by feeding in an array of x and y
|
this
(fpoint)
|
Constructs a dsdl2.Point from a dsdl2.FPoint (from SDL 2.0.10)
|
Fields
Name | Type | Description |
sdlPoint
|
sdl.rect.SDL_Point | Internal SDL_Point struct
|
Properties
Name | Type | Description |
array [get]
|
inout(int[2]) | Static array proxy of the dsdl2.Point
|
x [get]
|
inout(int) | Proxy to the X value of the dsdl2.Point
|
y [get]
|
inout(int) | Proxy to the Y value of the dsdl2.Point
|
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.Point into its construction representation: "dsdl2.Point(<x>, <y>)"
|
Example
auto a = dsdl2.Point(1, 2);
auto b = a + a;
assert(b == dsdl2.Point(2, 4));
auto c = a * 2;
assert(b == c);