 |
Gorgon Game Engine
|
Go to the documentation of this file.
3 #pragma warning(disable:4250)
5 #include "../Geometry/Size.h"
6 #include "../Geometry/Bounds.h"
8 #include "../Graphics.h"
9 #include "../Containers/Image.h"
82 void Set(GL::Texture
id) {
151 virtual GL::Texture
GetID() const override final {
273 auto ret =
new std::remove_reference<decltype(*
this)>::type(std::move(*
this));
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.
Definition: Texture.h:264
This class represents boundaries of 2D objects.
Definition: Bounds.h:27
void swap(Event< Source_, Args_... > &l, Event< Source_, Args_... > &r)
Swaps two events.
Definition: Event.h:351
Texture GenerateTexture(const Containers::Image &data)
This function generates a texture from the given image data.
Definition: OpenGL.cpp:146
Graphics::ColorMode GetMode() const
Returns the color mode of the image.
Definition: Image.h:1311
virtual auto MoveOutProvider() -> decltype(*this) override
This function moves this animation provider into a new provider.
Definition: Texture.h:272
ColorMode
Color modes for images.
Definition: Color.h:16
This class represents an image depends on a GL texture.
Definition: Texture.h:17
ColorMode mode
Color mode of the texture, necessary to choose correct texture.
Definition: Texture.h:198
@ Invalid
This is used to mark invalid color data.
virtual const Geometry::Pointf * GetCoordinates() const override final
Returns the coordinates of the texture to be used. Declared final to allow inlining.
Definition: Texture.h:161
virtual ~Texture()
Definition: Texture.h:63
T_ Height
Height of this size object.
Definition: Size.h:261
Texture(GL::Texture id, ColorMode mode, const Geometry::Size &size)
Regular, full texture constructor.
Definition: Texture.h:26
Texture(Texture &other)
Copies a texture. This newly created texture will not assume ownership.
Definition: Texture.h:41
GL::Texture Release()
Releases the texture id that might be owned by this object without destroying it.
Definition: Texture.h:180
TextureProvider(TextureProvider &&other)
Move constructor.
Definition: Texture.h:256
void CreateEmpty(const Geometry::Size &size, ColorMode mode)
Create an empty texture.
Definition: Texture.h:142
TextureProvider(TextureProvider &other)
Copy constructor.
Definition: Texture.h:252
Texture(const Containers::Image &image)
This constructor creates a new texture from the given Image.
Definition: Texture.h:36
TextureImage(const Containers::Image &image)
This constructor creates a new texture from the given Image.
Definition: Texture.h:240
Texture GenerateEmptyTexture(const Geometry::Size &size, Graphics::ColorMode mode)
This function generates a texture from the given image data.
Definition: OpenGL.cpp:154
T_ Left
Left-most boundary.
Definition: Bounds.h:399
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.
Definition: Texture.h:135
Root namespace for Gorgon Game Engine.
Definition: Any.h:19
This class represents a 2D geometric size.
Definition: Size.h:23
virtual Geometry::Size GetImageSize() const override final
Returns the size of the texture in pixels. Declared final to allow inlining.
Definition: Texture.h:156
This is an interface for solid texture based image.
Definition: Drawables.h:511
Texture(Texture &&other)
Moves a texture.
Definition: Texture.h:47
void Set(GL::Texture id)
Sets the texture to the given id without any modification to size or color mode.
Definition: Texture.h:82
bool owner
Whether this object owns this texture.
Definition: Texture.h:201
This is a solid texture based image class.
Definition: Texture.h:211
Geometry::Size size
Size of the texture.
Definition: Texture.h:195
void DestroyTexture(Texture texture)
Destroys the given texture.
Definition: OpenGL.cpp:213
GL::Texture id
GL texture id.
Definition: Texture.h:192
This class represents a 2D point.
Definition: Point.h:32
TextureImage(GL::Texture id, ColorMode mode, const Geometry::Size &size)
Regular, full texture constructor.
Definition: Texture.h:232
TextureImage()
Default constructor, creates an empty texture.
Definition: Texture.h:214
TextureProvider()
Default constructor, creates an empty texture.
Definition: Texture.h:249
virtual GL::Texture GetID() const override final
Returns GL::Texture to be drawn. Declared final to allow inlining.
Definition: Texture.h:151
void Swap(Texture &other)
Swaps two textures.
Definition: Texture.h:53
TextureImage(TextureImage &&other)
Move constructor.
Definition: Texture.h:221
Texture()
Default constructor, creates an empty texture.
Definition: Texture.h:21
T_ Right
Right-most boundary.
Definition: Bounds.h:405
@ Graphics
Definition: Template.h:164
This interface represents a GL texture source.
Definition: Graphics.h:480
T_ Bottom
Bottom-most boundary.
Definition: Bounds.h:408
ColorMode GetMode() const override
Definition: Texture.h:165
This class is a container for image data.
Definition: Image.h:19
TextureImage(TextureImage &other)
Copy constructor.
Definition: Texture.h:217
T_ Width
Width of this size object.
Definition: Size.h:258
basic_Size< T_ > GetSize() const
Returns the size of the bounds object.
Definition: Bounds.h:141
void Set(const Containers::Image &image)
Sets the texture to the given id with the given size.
Definition: Texture.h:69
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.
Definition: Texture.h:108
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.
Definition: Texture.h:236
Geometry::Size getsize() const override
Should return the exact size of this object.
Definition: Texture.h:285
Geometry::Pointf coordinates[4]
Readily calculated texture coordinates of the image.
Definition: Texture.h:206
Texture(GL::Texture id, ColorMode mode, const Geometry::Size &size, const Geometry::Bounds &location)
Atlas constructor, specifies a region of the texture.
Definition: Texture.h:31
TextureProvider(GL::Texture id, ColorMode mode, const Geometry::Size &size)
Regular, full texture constructor.
Definition: Texture.h:260
void Assume(GL::Texture id, ColorMode mode, const Geometry::Size &size)
Sets the texture to the given id with the given size.
Definition: Texture.h:124
TextureProvider(const Containers::Image &image)
This constructor creates a new texture from the given Image.
Definition: Texture.h:268
void Destroy()
Remove the texture from this object. If this object is the owner of the texture, then it is destroyed...
Definition: Texture.h:170
Definition: Texture.h:246
void Set(GL::Texture id, ColorMode mode, const Geometry::Size &size)
Sets the texture to the given id with the given size.
Definition: Texture.h:93
static const Geometry::Pointf fullcoordinates[4]
Coordinates that selects the entire texture to be used.
Definition: Graphics.h:501
Definition: Animations.h:85
Geometry::Size GetSize() const
Returns the size of the image.
Definition: Image.h:1291
T_ Top
Top-most boundary.
Definition: Bounds.h:402
virtual Geometry::Size GetSize() const override
Definition: Texture.h:278