qxLib
include
qx
render
draw_mode.h
Go to the documentation of this file.
1
/**
2
3
@file draw_mode.h
4
@author Khrapov
5
@date 9.04.2021
6
@copyright © Nick Khrapov, 2021. All right reserved.
7
8
**/
9
#pragma once
10
11
namespace
qx
12
{
13
14
enum class
draw_mode
15
{
16
/*
17
Separate points.
18
19
{ 0 }, { 1 }, { 2 }, { 3 }
20
*/
21
points,
22
23
/*
24
Vertices 0 and 1 are considered a line.
25
Vertices 2 and 3 are considered a line.
26
And so on.
27
28
{ 0, 1 },
29
{ 2, 3 },
30
*/
31
lines_list,
32
33
/*
34
The adjacent vertices are considered lines.
35
36
{ 0, 1 },
37
{ 1, 2 },
38
{ 2, 3 }
39
*/
40
lines_strip,
41
42
/*
43
Vertices 0, 1, and 2 form a triangle.
44
Vertices 3, 4, and 5 form a triangle.
45
And so on.
46
47
{ 0, 1, 2 },
48
{ 3, 4, 5 },
49
{ 6, 7, 8 }
50
*/
51
triangles_list,
52
53
/*
54
Every group of 3 adjacent vertices forms a triangle.
55
56
{ 0, 1, 3 },
57
{ 1, 2, 4 },
58
{ 2, 3, 5 }
59
*/
60
triangles_strip,
61
62
/*
63
The first vertex is always held fixed.
64
From there on, every group of 2 adjacent vertices
65
form a triangle with the first.
66
67
{ 0, 1, 2 }
68
{ 0, 2, 3 }
69
{ 0, 3, 4 }
70
{ 0, 4, 5}
71
*/
72
triangles_fan,
73
};
74
75
/**
76
@brief Returns true if the specified draw mode draws triangles
77
@param eDrawMode - draw mode to check
78
@retval - true if the specified draw mode draws triangles
79
**/
80
constexpr
bool
is_triandles
(draw_mode eDrawMode)
81
{
82
return
eDrawMode == draw_mode::triangles_list || eDrawMode == draw_mode::triangles_strip
83
|| eDrawMode == draw_mode::triangles_fan;
84
}
85
86
}
// namespace qx
qx::is_triandles
constexpr bool is_triandles(draw_mode eDrawMode)
Returns true if the specified draw mode draws triangles.
Definition:
draw_mode.h:80
Generated by
1.9.1