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
12namespace galaxy
13{
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
27 {
28 glDeleteTextures(1, &m_id);
29
30 this->m_id = t.m_id;
31 t.m_id = 0;
32 }
33
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
48 {
49 glDeleteTextures(1, &m_id);
50 }
51
52 unsigned int TextureView::id() const noexcept
53 {
54 return m_id;
55 }
56} // namespace galaxy
OpenGL 2D TextureView.
unsigned int id() const noexcept
Get OpenGL texture id.
~TextureView() noexcept
Destructor.
unsigned int m_id
Texture view id.
TextureView & operator=(TextureView &&) noexcept
Move assignment operator.
TextureView()=delete
Constructor.
Animated.cpp galaxy.
Definition Animated.cpp:16