sdl2 :: SDLTexture
sdl2 :: SDLTexture :: defaultinit
sdl2 :: SDLTexture :: from_surface
Get aSDLTexture
from a surface
, for a given renderer
sdl2 $ SDLTexture :: SELF
Type of this instance, automatically specialized in every classcore :: 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 :: SDLTexture :: defaultinit
core :: Pointer :: defaultinit
core :: Object :: defaultinit
sdl2 :: SDLTexture :: from_surface
Get aSDLTexture
from a surface
, for a given renderer
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 loaded bitmap texture
extern class SDLTexture `{ SDL_Texture * `}
# Get a `SDLTexture` from a `surface`, for a given `renderer`
new from_surface(renderer: SDLRenderer, surface: SDLSurface) `{
return SDL_CreateTextureFromSurface(renderer, surface);
`}
# Destroy this texture
fun destroy `{ SDL_DestroyTexture(self); `}
# Width of this texture
fun width: Int `{
int val;
SDL_QueryTexture(self, NULL, NULL, &val, NULL);
return val;
`}
# Height of this texture
fun height: Int `{
int val;
SDL_QueryTexture(self, NULL, NULL, NULL, &val);
return val;
`}
# TODO other queries: format and access
end
lib/sdl2/sdl2_base.nit:445,1--470,3