galaxy
1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
TextureView.cpp
Go to the documentation of this file.
1
7
8
#include <glad/glad.h>
9
10
#include "
TextureView.hpp
"
11
12
namespace
galaxy
13
{
14
TextureView::TextureView
(
15
const
unsigned
int
parent,
16
const
unsigned
int
minlevel,
17
const
unsigned
int
numlevels,
18
const
unsigned
int
minlayer,
19
const
unsigned
int
numlayers
20
)
noexcept
21
{
22
glGenTextures(1, &m_id);
23
glTextureView(m_id, GL_TEXTURE_2D, parent, GL_RGBA8, minlevel, numlevels, minlayer, numlayers);
24
}
25
26
TextureView::TextureView
(
TextureView
&& t)
noexcept
27
{
28
glDeleteTextures(1, &m_id);
29
30
this->m_id = t.m_id;
31
t.m_id = 0;
32
}
33
34
TextureView
&
TextureView::operator=
(
TextureView
&& t)
noexcept
35
{
36
if
(
this
!= &t)
37
{
38
glDeleteTextures(1, &m_id);
39
40
this->m_id = t.m_id;
41
t.m_id = 0;
42
}
43
44
return
*
this
;
45
}
46
47
TextureView::~TextureView
() noexcept
48
{
49
glDeleteTextures(1, &
m_id
);
50
}
51
52
unsigned
int
TextureView::id
() const noexcept
53
{
54
return
m_id
;
55
}
56
}
// namespace galaxy
TextureView.hpp
galaxy::TextureView
OpenGL 2D TextureView.
Definition
TextureView.hpp:17
galaxy::TextureView::id
unsigned int id() const noexcept
Get OpenGL texture id.
Definition
TextureView.cpp:52
galaxy::TextureView::~TextureView
~TextureView() noexcept
Destructor.
Definition
TextureView.cpp:47
galaxy::TextureView::m_id
unsigned int m_id
Texture view id.
Definition
TextureView.hpp:73
galaxy::TextureView::operator=
TextureView & operator=(TextureView &&) noexcept
Move assignment operator.
Definition
TextureView.cpp:34
galaxy::TextureView::TextureView
TextureView()=delete
Constructor.
galaxy
Animated.cpp galaxy.
Definition
Animated.cpp:16
galaxy
src
galaxy
graphics
gl
TextureView.cpp
Generated on Wed Jan 7 2026 11:41:10 for galaxy by
1.12.0