Gorgon Game Engine
TextureProvider Class Reference
Inheritance diagram for TextureProvider:
[legend]

Public Member Functions

 TextureProvider ()
 Default constructor, creates an empty texture. More...
 
 TextureProvider (const Containers::Image &image)
 This constructor creates a new texture from the given Image. More...
 
 TextureProvider (GL::Texture id, ColorMode mode, const Geometry::Size &size)
 Regular, full texture constructor. More...
 
 TextureProvider (GL::Texture id, ColorMode mode, const Geometry::Size &size, const Geometry::Bounds &location)
 Atlas constructor, specifies a region of the texture, size is for the entirity of the texture. More...
 
 TextureProvider (TextureProvider &&other)
 Move constructor. More...
 
 TextureProvider (TextureProvider &other)
 Copy constructor. More...
 
virtual Geometry::Size GetSize () const override
 
virtual auto MoveOutProvider () -> decltype(*this) override
 This function moves this animation provider into a new provider. More...
 
- Public Member Functions inherited from TextureImage
 TextureImage ()
 Default constructor, creates an empty texture. More...
 
 TextureImage (const Containers::Image &image)
 This constructor creates a new texture from the given Image. More...
 
 TextureImage (GL::Texture id, ColorMode mode, const Geometry::Size &size)
 Regular, full texture constructor. More...
 
 TextureImage (GL::Texture id, ColorMode mode, const Geometry::Size &size, const Geometry::Bounds &location)
 Atlas constructor, specifies a region of the texture, size is for the entirity of the texture. More...
 
 TextureImage (TextureImage &&other)
 Move constructor. More...
 
 TextureImage (TextureImage &other)
 Copy constructor. More...
 
- Public Member Functions inherited from Texture
 Texture ()
 Default constructor, creates an empty texture. More...
 
 Texture (const Containers::Image &image)
 This constructor creates a new texture from the given Image. More...
 
 Texture (GL::Texture id, ColorMode mode, const Geometry::Size &size)
 Regular, full texture constructor. More...
 
 Texture (GL::Texture id, ColorMode mode, const Geometry::Size &size, const Geometry::Bounds &location)
 Atlas constructor, specifies a region of the texture. More...
 
 Texture (Texture &&other)
 Moves a texture. More...
 
 Texture (Texture &other)
 Copies a texture. This newly created texture will not assume ownership. More...
 
virtual ~Texture ()
 
void Assume (GL::Texture id, ColorMode mode, const Geometry::Size &size)
 Sets the texture to the given id with the given size. More...
 
void Assume (GL::Texture id, ColorMode mode, const Geometry::Size &size, const Geometry::Bounds &location)
 Sets the texture to the given id with the given size. More...
 
void CreateEmpty (const Geometry::Size &size, ColorMode mode)
 Create an empty texture. More...
 
void Destroy ()
 Remove the texture from this object. If this object is the owner of the texture, then it is destroyed. More...
 
virtual const Geometry::PointfGetCoordinates () const override final
 Returns the coordinates of the texture to be used. Declared final to allow inlining. More...
 
virtual GL::Texture GetID () const override final
 Returns GL::Texture to be drawn. Declared final to allow inlining. More...
 
virtual Geometry::Size GetImageSize () const override final
 Returns the size of the texture in pixels. Declared final to allow inlining. More...
 
ColorMode GetMode () const override
 
GL::Texture Release ()
 Releases the texture id that might be owned by this object without destroying it. More...
 
void Set (const Containers::Image &image)
 Sets the texture to the given id with the given size. More...
 
void Set (GL::Texture id)
 Sets the texture to the given id without any modification to size or color mode. More...
 
void Set (GL::Texture id, ColorMode mode, const Geometry::Size &size)
 Sets the texture to the given id with the given size. More...
 
void Set (GL::Texture id, ColorMode mode, const Geometry::Size &size, const Geometry::Bounds &location)
 Sets the texture to the given id with the given size. More...
 
void Swap (Texture &other)
 Swaps two textures. More...
 
- Public Member Functions inherited from TextureSource
bool IsPartial () const
 Returns whether this texture uses only a part of the GL::Texture. More...
 
- Public Member Functions inherited from RectangularDrawable
const Geometry::Size CalculateSize (const Geometry::Size &area) const
 Calculates the adjusted size of this drawable depending on the given area. More...
 
const Geometry::Size CalculateSize (const SizeController &controller, const Geometry::Size &area) const
 Calculates the adjusted size of this drawable depending on the given area and controller. More...
 
const Geometry::Size CalculateSize (const SizeController &controller, int w=-1, int h=-1) const
 Calculates the adjusted size of this drawable depending on the given area and controller. More...
 
const Geometry::Size CalculateSize (int w=-1, int h=-1) const
 Calculates the adjusted size of this drawable depending on the given area. More...
 
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, const Geometry::Sizef &size, const Geometry::Pointf &t1, const Geometry::Pointf &t2, const Geometry::Pointf &t3, const Geometry::Pointf &t4, RGBAf color=RGBAf(1.f)) const
 Draws the object with the given screen and texture coordinates. More...
 
void Draw (TextureTarget &target, const Geometry::Pointf &p, const Geometry::Sizef &size, float u1, float v1, float u2, float v2, float u3, float v3, float u4, float v4, RGBAf color=RGBAf(1.f)) const
 Draws the object with the given screen and texture coordinates. More...
 
void Draw (TextureTarget &target, const Geometry::Pointf &p, float w, float h, const Geometry::Pointf &t1, const Geometry::Pointf &t2, const Geometry::Pointf &t3, const Geometry::Pointf &t4, RGBAf color=RGBAf(1.f)) const
 Draws the object with the given screen and texture coordinates. More...
 
void Draw (TextureTarget &target, const Geometry::Pointf &p, float w, float h, float u1, float v1, float u2, float v2, float u3, float v3, float u4, float v4, RGBAf color=RGBAf(1.f)) const
 Draws the object with the given screen and texture 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, const Geometry::Pointf &p1, const Geometry::Pointf &p2, const Geometry::Pointf &p3, const Geometry::Pointf &p4, const Geometry::Pointf &t1, const Geometry::Pointf &t2, const Geometry::Pointf &t3, const Geometry::Pointf &t4, RGBAf color=RGBAf(1.f)) const
 Draws the object with the given screen and texture coordinates. More...
 
void Draw (TextureTarget &target, const Geometry::Pointf &p1, const Geometry::Pointf &p2, const Geometry::Pointf &p3, const Geometry::Pointf &p4, float u1, float v1, float u2, float v2, float u3, float v3, float u4, float v4, RGBAf color=RGBAf(1.f)) const
 Draws the object with the given screen and texture coordinates. More...
 
void Draw (TextureTarget &target, const Geometry::Pointf &p1, const Geometry::Pointf &p2, const Geometry::Pointf &p3, const Geometry::Pointf &p4, RGBAf color=RGBAf(1.f)) const
 Draw the object to the target by specifying coordinates for four corners. More...
 
void Draw (TextureTarget &target, float x, float y, const Geometry::Sizef &size, const Geometry::Pointf &t1, const Geometry::Pointf &t2, const Geometry::Pointf &t3, const Geometry::Pointf &t4, RGBAf color=RGBAf(1.f)) const
 Draws the object with the given screen and texture coordinates. More...
 
void Draw (TextureTarget &target, float x, float y, const Geometry::Sizef &size, float u1, float v1, float u2, float v2, float u3, float v3, float u4, float v4, RGBAf color=RGBAf(1.f)) const
 Draws the object with the given screen and texture coordinates. More...
 
void Draw (TextureTarget &target, float x, float y, float w, float h, const Geometry::Pointf &t1, const Geometry::Pointf &t2, const Geometry::Pointf &t3, const Geometry::Pointf &t4, RGBAf color=RGBAf(1.f)) const
 Draws the object with the given screen and texture coordinates. More...
 
void Draw (TextureTarget &target, float x, float y, float w, float h, float u1, float v1, float u2, float v2, float u3, float v3, float u4, float v4, RGBAf color=RGBAf(1.f)) const
 Draws the object with the given screen and texture 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, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4, const Geometry::Pointf &t1, const Geometry::Pointf &t2, const Geometry::Pointf &t3, const Geometry::Pointf &t4, RGBAf color=RGBAf(1.f)) const
 Draws the object with the given screen and texture coordinates. More...
 
void Draw (TextureTarget &target, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4, float u1, float v1, float u2, float v2, float u3, float v3, float u4, float v4, RGBAf color=RGBAf(1.f)) const
 Draws the object with the given screen and texture coordinates. More...
 
void Draw (TextureTarget &target, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4, RGBAf color=RGBAf(1.f)) const
 Draw the object to the target by specifying coordinates for four corners. More...
 
void Draw (TextureTarget &target, int x, int y, RGBAf color=RGBAf(1.f)) const
 Draw to the given coordinates. More...
 
void DrawIn (TextureTarget &target, const Geometry::Point &p, const Geometry::Size &size, RGBAf color=RGBAf(1.f)) const
 Draw to the given area. More...
 
void DrawIn (TextureTarget &target, const Geometry::Point &p, int w, int h, RGBAf color=RGBAf(1.f)) const
 Draw to the given area. More...
 
void DrawIn (TextureTarget &target, const Geometry::Pointf &p, const Geometry::Sizef &size, RGBAf color=RGBAf(1.f)) const
 Draw to the given area. More...
 
void DrawIn (TextureTarget &target, const Geometry::Pointf &p, float w, float h, RGBAf color=RGBAf(1.f)) const
 Draw to the given area. More...
 
void DrawIn (TextureTarget &target, const Geometry::Rectangle &r, RGBAf color=RGBAf(1.f)) const
 Draw in the given area. More...
 
void DrawIn (TextureTarget &target, const Geometry::Rectanglef &r, RGBAf color=RGBAf(1.f)) const
 Draw in the given area. More...
 
void DrawIn (TextureTarget &target, const SizeController &controller, const Geometry::Point &p, const Geometry::Size &size, RGBAf color=RGBAf(1.f)) const
 Draw to the given area with the given size according to the given controller. More...
 
void DrawIn (TextureTarget &target, const SizeController &controller, const Geometry::Point &p, int w, int h, RGBAf color=RGBAf(1.f)) const
 Draw to the given area according to the given controller. More...
 
void DrawIn (TextureTarget &target, const SizeController &controller, const Geometry::Pointf &p, const Geometry::Sizef &size, RGBAf color=RGBAf(1.f)) const
 Draw to the given area with the given size according to the given controller. More...
 
void DrawIn (TextureTarget &target, const SizeController &controller, const Geometry::Pointf &p, float w, float h, RGBAf color=RGBAf(1.f)) const
 Draw to the given area according to the given controller. More...
 
void DrawIn (TextureTarget &target, const SizeController &controller, const Geometry::Rectangle &r, RGBAf color=RGBAf(1.f)) const
 Draw in the given area according to the given controller. More...
 
void DrawIn (TextureTarget &target, const SizeController &controller, const Geometry::Rectanglef &r, RGBAf color=RGBAf(1.f)) const
 Draw in the given area according to the given controller. More...
 
void DrawIn (TextureTarget &target, const SizeController &controller, float x, float y, const Geometry::Sizef &size, RGBAf color=RGBAf(1.f)) const
 Draw to the given area the given size according to the given controller. More...
 
void DrawIn (TextureTarget &target, const SizeController &controller, float x, float y, float w, float h, RGBAf color=RGBAf(1.f)) const
 Draw to the given coordinates with the given size according to the given controller. More...
 
void DrawIn (TextureTarget &target, const SizeController &controller, int x, int y, const Geometry::Size &size, RGBAf color=RGBAf(1.f)) const
 Draw to the given area the given size according to the given controller. More...
 
void DrawIn (TextureTarget &target, const SizeController &controller, int x, int y, int w, int h, RGBAf color=RGBAf(1.f)) const
 Draw to the given coordinates with the given size according to the given controller. More...
 
void DrawIn (TextureTarget &target, const SizeController &controller, RGBAf color=RGBAf(1.f)) const
 Draw to fill the given target according to the given controller. More...
 
void DrawIn (TextureTarget &target, float x, float y, const Geometry::Sizef &size, RGBAf color=RGBAf(1.f)) const
 Draw to the given area. More...
 
void DrawIn (TextureTarget &target, float x, float y, float w, float h, RGBAf color=RGBAf(1.f)) const
 Draw to the given area. More...
 
void DrawIn (TextureTarget &target, int x, int y, const Geometry::Size &size, RGBAf color=RGBAf(1.f)) const
 Draw to the given area. More...
 
void DrawIn (TextureTarget &target, int x, int y, int w, int h, RGBAf color=RGBAf(1.f)) const
 Draw to the given area. More...
 
void DrawIn (TextureTarget &target, RGBAf color=RGBAf(1.f)) const
 Draw to fill the given target. More...
 
void DrawIn (TextureTarget &target, Tiling tiling, const Geometry::Point &p, const Geometry::Size &size, RGBAf color=RGBAf(1.f)) const
 Draws the object to the target using the given tiling information. More...
 
void DrawIn (TextureTarget &target, Tiling tiling, const Geometry::Point &p, int w, int h, RGBAf color=RGBAf(1.f)) const
 Draws the object to the target using the given tiling information. More...
 
void DrawIn (TextureTarget &target, Tiling tiling, const Geometry::Pointf &p, const Geometry::Sizef &size, RGBAf color=RGBAf(1.f)) const
 Draws the object to the target using the given tiling information. More...
 
void DrawIn (TextureTarget &target, Tiling tiling, const Geometry::Pointf &p, float w, float h, RGBAf color=RGBAf(1.f)) const
 Draws the object to the target using the given tiling information. More...
 
void DrawIn (TextureTarget &target, Tiling tiling, const Geometry::Rectangle &r, RGBAf color=RGBAf(1.f)) const
 Draws the object to the target using the given tiling information. More...
 
void DrawIn (TextureTarget &target, Tiling tiling, const Geometry::Rectanglef &r, RGBAf color=RGBAf(1.f)) const
 Draws the object to the target using the given tiling information. More...
 
void DrawIn (TextureTarget &target, Tiling tiling, float x, float y, const Geometry::Sizef &size, RGBAf color=RGBAf(1.f)) const
 Draws the object to the target using the given tiling information. More...
 
void DrawIn (TextureTarget &target, Tiling tiling, float x, float y, float w, float h, RGBAf color=RGBAf(1.f)) const
 Draws the object to the target using the given tiling information. More...
 
void DrawIn (TextureTarget &target, Tiling tiling, int x, int y, const Geometry::Size &size, RGBAf color=RGBAf(1.f)) const
 Draws the object to the target using the given tiling information. More...
 
void DrawIn (TextureTarget &target, Tiling tiling, int x, int y, int w, int h, RGBAf color=RGBAf(1.f)) const
 Draws the object to the target using the given tiling information. More...
 
void DrawRotated (TextureTarget &target, const Geometry::Point &p, float angle, const Geometry::Pointf &origin=Geometry::Point(0, 0), RGBAf color=RGBAf(1.f)) const
 Draw the object rotated to the given angle in radians, full C++11 support will enable the use of 90deg like qualifiers. More...
 
void DrawRotated (TextureTarget &target, const Geometry::Point &p, float angle, RGBAf color) const
 Draw the object rotated to the given angle in radians, full C++11 support will enable the use of 90deg like qualifiers. More...
 
void DrawRotated (TextureTarget &target, int x, int y, float angle, float oX, float oY, RGBAf color=RGBAf(1.f)) const
 Draw the object rotated to the given angle in radians, full C++11 support will enable the use of 90deg like qualifiers. More...
 
void DrawStretched (TextureTarget &target, const Geometry::Point &p, const Geometry::Size &size, RGBAf color=RGBAf(1.f)) const
 Draw to the given area by stretching object to fit. More...
 
void DrawStretched (TextureTarget &target, const Geometry::Point &p, int w, int h, RGBAf color=RGBAf(1.f)) const
 Draw to the given area by stretching object to fit. More...
 
void DrawStretched (TextureTarget &target, const Geometry::Pointf &p, const Geometry::Sizef &size, RGBAf color=RGBAf(1.f)) const
 Draw to the given area by stretching object to fit. More...
 
void DrawStretched (TextureTarget &target, const Geometry::Pointf &p, float w, float h, RGBAf color=RGBAf(1.f)) const
 Draw to the given area by stretching object to fit. More...
 
void DrawStretched (TextureTarget &target, const Geometry::Rectangle &r, RGBAf color=RGBAf(1.f)) const
 Draw to the given area by stretching object to fit. More...
 
void DrawStretched (TextureTarget &target, const Geometry::Rectanglef &r, RGBAf color=RGBAf(1.f)) const
 Draw to the given area by stretching object to fit. More...
 
void DrawStretched (TextureTarget &target, float x, float y, const Geometry::Sizef &size, RGBAf color=RGBAf(1.f)) const
 Draw to the given area by stretching object to fit. More...
 
void DrawStretched (TextureTarget &target, float x, float y, float w, float h, RGBAf color=RGBAf(1.f)) const
 Draw to the given area by stretching object to fit. More...
 
void DrawStretched (TextureTarget &target, int x, int y, const Geometry::Size &size, RGBAf color=RGBAf(1.f)) const
 Draw to the given area by stretching object to fit. More...
 
void DrawStretched (TextureTarget &target, int x, int y, int w, int h, RGBAf color=RGBAf(1.f)) const
 Draw to the given area by stretching object to fit. More...
 
int GetHeight () const
 Returns the height of the drawable. More...
 
const Geometry::Size GetSize () const
 Returns the size of this object. More...
 
int GetWidth () const
 Returns the width of the drawable. More...
 
- Public Member Functions inherited from Drawable
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...
 
- Public Member Functions inherited from ImageProvider
ImageProviderCreateAnimation (bool=false) const override
 This function should create and animation and depending on the create parameter, it should create its own timer. More...
 
ImageProviderCreateAnimation (Gorgon::Animation::ControllerBase &) const override
 This function should create a new animation with the given controller and if owner parameter is set to true, it should assume ownership of the controller. More...
 
virtual void DeleteAnimation () const override
 if used as animation, this object will not be deleted More...
 
- Public Member Functions inherited from Base
 Base (bool create=false)
 This constructor creates a new controller depending on the create parameter. More...
 
 Base (const Base &base)
 Copies the animation. More...
 
 Base (ControllerBase &controller)
 Sets the controller for this animation to the given controller. More...
 
virtual ControllerBaseGetController () const
 Returns the controller of this animation. More...
 
virtual bool HasController () const
 Returns whether this animation has a controller. More...
 
virtual void RemoveController ()
 Removes the controller of this animation. More...
 
virtual void SetController (ControllerBase &controller)
 Sets the controller to the given controller. More...
 
- Public Member Functions inherited from RectangularAnimationProvider
int GetHeight () const
 
int GetWidth () const
 
- Public Member Functions inherited from AnimationProvider
virtual ~AnimationProvider ()
 
- Public Member Functions inherited from Provider
virtual ~Provider ()
 Virtual destructor. More...
 

Protected Member Functions

Geometry::Size getsize () const override
 Should return the exact size of this object. More...
 
- Protected Member Functions inherited from Image
virtual Geometry::Size calculatesize (const Geometry::Size &s) const override
 This function should return the size of the object when it is requested to be drawn in the given area. More...
 
virtual Geometry::Size calculatesize (const SizeController &controller, const Geometry::Size &s) const override
 This function should return the size of the object when it is requested to be drawn in the given area. More...
 
virtual void draw (TextureTarget &target, const Geometry::Pointf &p1, const Geometry::Pointf &p2, const Geometry::Pointf &p3, const Geometry::Pointf &p4, const Geometry::Pointf &tex1, const Geometry::Pointf &tex2, const Geometry::Pointf &tex3, const Geometry::Pointf &tex4, RGBAf color) const override
 This method should draw to object inside the given quad with the given texture coordinates. More...
 
virtual void draw (TextureTarget &target, const Geometry::Pointf &p1, const Geometry::Pointf &p2, const Geometry::Pointf &p3, const Geometry::Pointf &p4, RGBAf color) const override
 This function should draw the object inside the given quad. More...
 
virtual void drawin (TextureTarget &target, const Geometry::Rectanglef &r, RGBAf color) const override
 This function should draw the object to the target area. More...
 
virtual void drawin (TextureTarget &target, const SizeController &controller, const Geometry::Rectanglef &r, RGBAf color) const override
 This function should draw this drawable inside the given rectangle according to the given controller. More...
 
virtual void drawstretched (TextureTarget &target, const Geometry::Rectanglef &r, RGBAf color) const override
 This function should draw the object to the target area. More...
 
- Protected Member Functions inherited from RectangularDrawable
virtual void draw (TextureTarget &target, const Geometry::Pointf &p, RGBAf color) const override
 This function should draw the object to the given point. More...
 
- Protected Member Functions inherited from ImageProvider
int GetDuration () const override
 Returns the duration of the animation if it is a known apriori. More...
 
bool Progress (unsigned &) override
 When used as animation, an image is always persistent and it never finishes. More...
 
- Protected Member Functions inherited from Base
virtual ~Base ()
 Virtual destructor. More...
 

Additional Inherited Members

- Public Types inherited from RectangularAnimationProvider
using AnimationType = RectangularAnimation
 
- Public Types inherited from AnimationProvider
using AnimationType = Animation
 
- Public Types inherited from Provider
using AnimationType = Base
 
- Protected Attributes inherited from Texture
Geometry::Pointf coordinates [4]
 Readily calculated texture coordinates of the image. More...
 
GL::Texture id
 GL texture id. More...
 
ColorMode mode
 Color mode of the texture, necessary to choose correct texture. More...
 
bool owner
 Whether this object owns this texture. More...
 
Geometry::Size size
 Size of the texture. More...
 
- Protected Attributes inherited from Base
ControllerBasecontroller
 Controller of this animation. More...
 
- Static Protected Attributes inherited from TextureSource
static const Geometry::Pointf fullcoordinates [4]
 Coordinates that selects the entire texture to be used. More...
 

Constructor & Destructor Documentation

◆ TextureProvider() [1/6]

Default constructor, creates an empty texture.

◆ TextureProvider() [2/6]

Copy constructor.

◆ TextureProvider() [3/6]

Move constructor.

◆ TextureProvider() [4/6]

TextureProvider ( GL::Texture  id,
ColorMode  mode,
const Geometry::Size size 
)

Regular, full texture constructor.

◆ TextureProvider() [5/6]

TextureProvider ( GL::Texture  id,
ColorMode  mode,
const Geometry::Size size,
const Geometry::Bounds location 
)

Atlas constructor, specifies a region of the texture, size is for the entirity of the texture.

◆ TextureProvider() [6/6]

TextureProvider ( const Containers::Image image)

This constructor creates a new texture from the given Image.

Member Function Documentation

◆ GetSize()

◆ getsize()

Geometry::Size getsize ( ) const
overrideprotectedvirtual

Should return the exact size of this object.

Reimplemented from Image.

References TextureProvider::GetSize().

◆ MoveOutProvider()

virtual auto MoveOutProvider ( ) -> decltype(*this)
overridevirtual

This function moves this animation provider into a new provider.

Ownership of this new object belongs to the caller and this object could be destroyed safely.

Implements RectangularAnimationProvider.


The documentation for this class was generated from the following file: