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 "galaxy/utils/Globals.hpp"
11
12
#include "
TextureView.hpp
"
13
14
#ifdef GALAXY_WIN_PLATFORM
15
#pragma warning(push)
16
#pragma warning(disable : 26493)
17
#endif
18
19
namespace
galaxy
20
{
21
namespace
graphics
22
{
23
TextureView::TextureView
(
const
unsigned
int
parent,
const
unsigned
int
minlevel,
const
unsigned
int
numlevels,
const
unsigned
int
minlayer,
const
unsigned
int
numlayers)
24
:
Texture
{}
25
{
26
glGenTextures(1, &
m_id
);
27
glTextureView(
m_id
, GL_TEXTURE_2D, parent, GL_RGBA8, minlevel, numlevels, minlayer, numlayers);
28
}
29
30
TextureView::TextureView
(
TextureView
&& t)
31
:
Texture
{
std
::move(t)}
32
{
33
}
34
35
TextureView
&
TextureView::operator=
(
TextureView
&& t)
36
{
37
if
(
this
!= &t)
38
{
39
Texture::operator=
(std::move(t));
40
}
41
42
return
*
this
;
43
}
44
45
TextureView::~TextureView
()
46
{
47
// We don't need to destroy the view here.
48
}
49
50
void
TextureView::bind
()
51
{
52
glBindTexture(GL_TEXTURE_2D,
m_id
);
53
}
54
55
void
TextureView::unbind
()
56
{
57
glBindTexture(GL_TEXTURE_2D, 0);
58
}
59
}
// namespace graphics
60
}
// namespace galaxy
61
62
#ifdef GALAXY_WIN_PLATFORM
63
#pragma warning(pop)
64
#endif
TextureView.hpp
galaxy::graphics::TextureView
OpenGL 2D TextureView.
Definition
TextureView.hpp:21
galaxy::graphics::TextureView::operator=
TextureView & operator=(TextureView &&)
Move assignment operator.
Definition
TextureView.cpp:35
galaxy::graphics::TextureView::bind
void bind() override
Activate context.
Definition
TextureView.cpp:50
galaxy::graphics::TextureView::TextureView
TextureView()=delete
Constructor.
galaxy::graphics::TextureView::~TextureView
virtual ~TextureView()
Destructor.
Definition
TextureView.cpp:45
galaxy::graphics::TextureView::unbind
void unbind() override
Deactivate context.
Definition
TextureView.cpp:55
galaxy::graphics::Texture
OpenGL 2D Texture.
Definition
Texture.hpp:26
galaxy::graphics::Texture::m_id
unsigned int m_id
OpenGL id.
Definition
Texture.hpp:161
galaxy::graphics::Texture::operator=
Texture & operator=(Texture &&)
Move assignment operator.
Definition
Texture.cpp:49
galaxy
Animated.cpp galaxy.
Definition
Animated.cpp:16
std
STL namespace.
galaxy
src
galaxy
graphics
gl
TextureView.cpp
Generated on Fri Sep 12 2025 07:29:47 for galaxy by
1.12.0