hx3d  1
2D/3D Simple Game Framework
texture_region.cpp
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 #include "hx3d/graphics/texture_region.hpp"
24 
25 #include "hx3d/graphics/texture.hpp"
26 
27 namespace hx3d {
28 namespace graphics {
29 
30 TextureRegion::TextureRegion(Ptr<Texture> texture, float minX, float maxX, float minY, float maxY):
31  _texture(texture), _minX(minX), _maxX(maxX), _minY(minY), _maxY(maxY),
32  _uv(0.f)
33  {}
34 
36 
38  return _texture;
39 }
40 
42  return _minX;
43 }
44 
46  return _maxX;
47 }
48 
50  return _minY;
51 }
52 
54  return _maxY;
55 }
56 
57 } /* graphics */
58 } /* hx3d */
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.
float getMinX()
Get the left coordinate.
std::shared_ptr< T > Ptr
Quick-typing shared ptr.
Definition: ptr.hpp:34