![]() |
Gorgon Game Engine
|
This class turns a drawable into a pointer. More...
Public Member Functions | |
DrawablePointer ()=default | |
DrawablePointer (const AssumeOwnershipTag &, const Drawable &image, Geometry::Point hotspot) | |
Initializes a pointer. More... | |
DrawablePointer (const AssumeOwnershipTag &tag, const Drawable &image, int x, int y) | |
Initializes a pointer. More... | |
DrawablePointer (const Drawable &image, Geometry::Point hotspot) | |
Initializes a pointer. More... | |
DrawablePointer (const Drawable &image, int x, int y) | |
Initializes a pointer. More... | |
DrawablePointer (const DrawablePointer &other)=delete | |
DrawablePointer (DrawablePointer &&other) | |
~DrawablePointer () | |
void | Assume (const Drawable &value) |
Changes the image of the pointer by assuming the ownership of the given image. More... | |
void | Assume (const Drawable &value, Geometry::Point hotspot) |
Changes the image of the pointer by assuming the ownership of the given image. More... | |
void | Assume (const Drawable &value, int x, int y) |
Changes the image of the pointer by assuming the ownership of the given image. More... | |
const Drawable & | GetImage () const |
Returns the image contained in this pointer. More... | |
bool | HasImage () const |
Returns if the pointer has an image. More... | |
DrawablePointer & | operator= (const DrawablePointer &)=delete |
DrawablePointer & | operator= (DrawablePointer &&other) |
const Drawable & | Release () |
Releases the ownership of the drawable and removes it from the pointer. More... | |
void | RemoveImage () |
Removes the image from the pointer. More... | |
void | SetImage (const Drawable &value) |
Changes the image of this pointer. More... | |
![]() | |
virtual | ~Pointer () |
![]() | |
virtual | ~Drawable () |
void | Draw (TextureTarget &target, const Geometry::Point &p, RGBAf color=RGBAf(1.f)) const |
Draw to the given coordinates. More... | |
void | Draw (TextureTarget &target, const Geometry::Pointf &p, RGBAf color=RGBAf(1.f)) const |
Draw to the given coordinates. More... | |
void | Draw (TextureTarget &target, float x, float y, RGBAf color=RGBAf(1.f)) const |
Draw to the given coordinates. More... | |
void | Draw (TextureTarget &target, int x, int y, RGBAf color=RGBAf(1.f)) const |
Draw to the given coordinates. More... | |
Protected Member Functions | |
void | draw (Gorgon::Graphics::TextureTarget &target, const Geometry::Pointf &p, Gorgon::Graphics::RGBAf color) const override |
This is the only function that needs to implemented for a drawable. More... | |
This class turns a drawable into a pointer.
|
default |
DrawablePointer | ( | const Drawable & | image, |
int | x, | ||
int | y | ||
) |
Initializes a pointer.
Ownership of the drawable is not transferred. Use Assume function after invoking default constructor to transfer ownership.
DrawablePointer | ( | const Drawable & | image, |
Geometry::Point | hotspot | ||
) |
Initializes a pointer.
Ownership of the drawable is not transferred. Use Assume function after invoking default constructor to transfer ownership.
DrawablePointer | ( | const AssumeOwnershipTag & | tag, |
const Drawable & | image, | ||
int | x, | ||
int | y | ||
) |
Initializes a pointer.
Ownership of the drawable is not transferred. Use Assume function after invoking default constructor to transfer ownership.
DrawablePointer | ( | const AssumeOwnershipTag & | , |
const Drawable & | image, | ||
Geometry::Point | hotspot | ||
) |
Initializes a pointer.
Ownership of the drawable is not transferred. Use Assume function after invoking default constructor to transfer ownership.
|
delete |
DrawablePointer | ( | DrawablePointer && | other | ) |
~DrawablePointer | ( | ) |
References DrawablePointer::RemoveImage().
void Assume | ( | const Drawable & | value | ) |
Changes the image of the pointer by assuming the ownership of the given image.
References DrawablePointer::RemoveImage().
void Assume | ( | const Drawable & | value, |
Geometry::Point | hotspot | ||
) |
Changes the image of the pointer by assuming the ownership of the given image.
References DrawablePointer::RemoveImage().
void Assume | ( | const Drawable & | value, |
int | x, | ||
int | y | ||
) |
Changes the image of the pointer by assuming the ownership of the given image.
References DrawablePointer::RemoveImage().
|
overrideprotectedvirtual |
This is the only function that needs to implemented for a drawable.
Implements Drawable.
References Drawable::Draw().
const Drawable& GetImage | ( | ) | const |
Returns the image contained in this pointer.
You should check HasImage before accessing to the image
References ASSERT.
bool HasImage | ( | ) | const |
Returns if the pointer has an image.
|
delete |
DrawablePointer& operator= | ( | DrawablePointer && | other | ) |
References DrawablePointer::RemoveImage().
const Drawable& Release | ( | ) |
Releases the ownership of the drawable and removes it from the pointer.
void RemoveImage | ( | ) |
Removes the image from the pointer.
void SetImage | ( | const Drawable & | value | ) |
Changes the image of this pointer.
References DrawablePointer::RemoveImage().