sdl2 :: SDLPoint :: defaultinit
# A point with `x` and `y`
extern class SDLPoint `{SDL_Point *`}
# Get a null rectangle (on the C side), should be used only internally
new nil `{ return NULL; `}
# Allocate the memory for a new `SDLPoint`, it must the be freed with `free`
new malloc`{ return malloc(sizeof(SDL_Point)); `}
# Allocate the memory for a new `SDLPoint` and fill it with `x` and `y`
#
# As with `malloc`, the new instances must the be freed with `free`.
new (x, y: Int) do
var point = new SDLPoint.malloc
point.x = x
point.y = y
return point
end
# X coordinate of this point
fun x: Int `{ return self->x; `}
# Set the X coordinate of this point
fun x=(val: Int) `{ self->x = val; `}
# Y coordinate of this point
fun y: Int `{ return self->y; `}
# Set the Y coordinate of this point
fun y=(val: Int) `{ self->y = val; `}
end
lib/sdl2/sdl2_base.nit:535,1--564,3