x
and y
core :: Pointer :: address_is_null
Is the address behind this Object at NULL?core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
sdl2 :: SDLPoint :: defaultinit
core :: Object :: defaultinit
core :: Pointer :: defaultinit
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
core :: Object :: output_class_name
Display class name on stdout (debug only).
# 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