hx3d  1
2D/3D Simple Game Framework
texture_region.hpp
1 /*
2  Texture region.
3  To delimit a texture rectangle.
4 
5  Copyright (C) 2015 Denis BOURGE
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Lesser General Public
9  License as published by the Free Software Foundation; either
10  version 2.1 of the License, or (at your option) any later version.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Lesser General Public License for more details.
16 
17  You should have received a copy of the GNU Lesser General Public
18  License along with this library; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
20  USA
21 */
22 
23 #ifndef HX3D_GRAPHICS_TEXTUREREGION
24 #define HX3D_GRAPHICS_TEXTUREREGION
25 
26 #include <glm/vec2.hpp>
27 
28 #include "hx3d/utils/ptr.hpp"
29 
30 namespace hx3d {
31 namespace graphics {
32 
33 class Texture;
34 
39 
40 public:
50  TextureRegion(Ptr<Texture> texture, float minX, float maxX, float minY, float maxY);
51 
55  TextureRegion();
56 
62  const Ptr<Texture>& getTexture();
63 
69  float getMinX();
70 
76  float getMaxX();
77 
83  float getMinY();
84 
90  float getMaxY();
91 
92 private:
94  Ptr<Texture> _texture;
96  float _minX;
98  float _maxX;
100  float _minY;
102  float _maxY;
103 
105  glm::vec2 _uv;
106 };
107 
108 } /* graphics */
109 } /* hx3d */
110 
111 #endif
float getMaxX()
Get the right coordinate.
float getMaxY()
Get the top coordinate.
float getMinY()
Get the bottom coordinate.
hx3d framework namespace
Definition: audio.hpp:26
TextureRegion()
Create an empty texture region.
const Ptr< Texture > & getTexture()
Get the texture.
Defines a rectangle in a texture.
float getMinX()
Get the left coordinate.
std::shared_ptr< T > Ptr
Quick-typing shared ptr.
Definition: ptr.hpp:34