nngn
Toggle main menu visibility
Main Page
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
z
Variables
a
b
c
d
e
f
g
h
i
k
m
n
o
p
r
s
t
u
v
w
z
Typedefs
a
d
f
h
i
m
s
t
u
v
w
z
Enumerations
Enumerator
Concepts
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
k
m
o
p
q
r
s
t
u
v
Enumerations
a
b
c
d
e
f
l
m
o
p
r
s
t
Enumerator
a
b
c
d
e
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Related Symbols
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
z
Typedefs
Enumerations
Macros
c
d
e
f
g
l
n
p
s
t
x
▼
nngn
Documentation
►
Building
►
Namespaces
►
Concepts
►
Classes
▼
Files
▼
File List
►
demos
►
maps
▼
src
►
audio
►
collision
►
compute
►
font
►
glsl
▼
graphics
▼
opengl
►
handle.h
►
opengl.cpp
opengl.h
post.cpp
►
post.h
prog.cpp
►
prog.h
resource.cpp
►
resource.h
►
utils.cpp
►
utils.h
vao.cpp
►
vao.h
►
terminal
►
vulkan
glfw.cpp
►
glfw.h
►
graphics.cpp
►
graphics.h
►
lua_graphics.cpp
►
lua_texture.cpp
►
pseudo.cpp
►
pseudo.h
shaders.cpp
►
stats.h
►
texture.cpp
►
texture.h
►
input
►
lson
►
lua
►
math
►
os
►
render
►
timing
►
utils
►
const.h
►
debug.h
►
entity.cpp
►
entity.h
lua_entity.cpp
►
main.cpp
►
tests
►
tools
►
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
Concepts
Loading...
Searching...
No Matches
handle.h
Go to the documentation of this file.
1
#ifndef NNGN_GRAPHICS_OPENGL_HANDLE_H
2
#define NNGN_GRAPHICS_OPENGL_HANDLE_H
3
4
#include <utility>
5
6
#include "
utils/def.h
"
7
8
#include "
opengl.h
"
9
10
namespace
nngn
{
11
12
template
<
typename
T>
class
OpenGLHandle
{
13
u32
m_h
= 0;
14
public
:
15
constexpr
OpenGLHandle
() =
default
;
16
explicit
constexpr
OpenGLHandle
(
u32
h) noexcept :
m_h
(h) {}
17
OpenGLHandle
(
const
OpenGLHandle
&) =
delete
;
18
OpenGLHandle
(
OpenGLHandle
&&lhs)
noexcept
19
{ this->m_h = std::exchange(lhs.m_h, {}); }
18
OpenGLHandle
(
OpenGLHandle
&&lhs)
noexcept
{
…
}
20
OpenGLHandle
&
operator=
(
const
OpenGLHandle
&) =
delete
;
21
OpenGLHandle
&
operator=
(
OpenGLHandle
&&lhs)
noexcept
22
{ this->m_h = std::exchange(lhs.m_h, {}); }
21
OpenGLHandle
&
operator=
(
OpenGLHandle
&&lhs)
noexcept
{
…
}
23
~OpenGLHandle
() {
static_cast<
T
*
>
(
this
)->destroy(); }
24
u32
id
()
const
{
return
this->
m_h
; }
25
u32
&
id
() {
return
this->
m_h
; }
26
};
12
template
<
typename
T>
class
OpenGLHandle
{
…
};
27
28
}
29
30
#endif
nngn::OpenGLHandle
Definition
handle.h:12
nngn::OpenGLHandle::operator=
OpenGLHandle & operator=(const OpenGLHandle &)=delete
nngn::OpenGLHandle::OpenGLHandle
OpenGLHandle(const OpenGLHandle &)=delete
nngn::OpenGLHandle::id
u32 & id()
Definition
handle.h:25
nngn::OpenGLHandle::m_h
u32 m_h
Definition
handle.h:13
nngn::OpenGLHandle::operator=
OpenGLHandle & operator=(OpenGLHandle &&lhs) noexcept
Definition
handle.h:21
nngn::OpenGLHandle::OpenGLHandle
constexpr OpenGLHandle(u32 h) noexcept
Definition
handle.h:16
nngn::OpenGLHandle::OpenGLHandle
OpenGLHandle(OpenGLHandle &&lhs) noexcept
Definition
handle.h:18
nngn::OpenGLHandle::id
u32 id() const
Definition
handle.h:24
nngn::OpenGLHandle::OpenGLHandle
constexpr OpenGLHandle()=default
nngn::OpenGLHandle::~OpenGLHandle
~OpenGLHandle()
Definition
handle.h:23
def.h
T
#define T(f0, f1, f2)
nngn
Definition
audio.cpp:7
nngn::u32
std::uint32_t u32
Definition
def.h:14
opengl.h
src
graphics
opengl
handle.h
Generated by
1.11.0