hx3d
1
2D/3D Simple Game Framework
Main Page
Namespaces
Classes
Files
File List
engine
include
hx3d
graphics
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
38
class
TextureRegion
{
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
hx3d::graphics::TextureRegion::getMaxX
float getMaxX()
Get the right coordinate.
Definition:
texture_region.cpp:45
hx3d::graphics::TextureRegion::getMaxY
float getMaxY()
Get the top coordinate.
Definition:
texture_region.cpp:53
hx3d::graphics::TextureRegion::getMinY
float getMinY()
Get the bottom coordinate.
Definition:
texture_region.cpp:49
hx3d
hx3d framework namespace
Definition:
audio.hpp:26
hx3d::graphics::TextureRegion::TextureRegion
TextureRegion()
Create an empty texture region.
Definition:
texture_region.cpp:35
hx3d::graphics::TextureRegion::getTexture
const Ptr< Texture > & getTexture()
Get the texture.
Definition:
texture_region.cpp:37
hx3d::graphics::TextureRegion
Defines a rectangle in a texture.
Definition:
texture_region.hpp:38
hx3d::graphics::TextureRegion::getMinX
float getMinX()
Get the left coordinate.
Definition:
texture_region.cpp:41
hx3d::Ptr
std::shared_ptr< T > Ptr
Quick-typing shared ptr.
Definition:
ptr.hpp:34
Generated by
1.8.11