Blender
V5.3
source
blender
gpu
opengl
gl_primitive.hh
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2020 Blender Authors
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later */
4
10
11
#pragma once
12
13
#include "
BLI_assert.hh
"
14
15
#include "
GPU_primitive.hh
"
16
17
namespace
blender::gpu
{
18
19
static
inline
GLenum
to_gl
(
GPUPrimType
prim_type)
20
{
21
BLI_assert
(prim_type !=
GPU_PRIM_NONE
);
22
switch
(prim_type) {
23
default
:
24
case
GPU_PRIM_POINTS
:
25
return
GL_POINTS;
26
case
GPU_PRIM_LINES
:
27
return
GL_LINES;
28
case
GPU_PRIM_LINE_STRIP
:
29
return
GL_LINE_STRIP;
30
case
GPU_PRIM_LINE_LOOP
:
31
return
GL_LINE_LOOP;
32
case
GPU_PRIM_TRIS
:
33
return
GL_TRIANGLES;
34
case
GPU_PRIM_TRI_STRIP
:
35
return
GL_TRIANGLE_STRIP;
36
case
GPU_PRIM_TRI_FAN
:
37
return
GL_TRIANGLE_FAN;
38
39
case
GPU_PRIM_LINES_ADJ
:
40
return
GL_LINES_ADJACENCY;
41
case
GPU_PRIM_LINE_STRIP_ADJ
:
42
return
GL_LINE_STRIP_ADJACENCY;
43
case
GPU_PRIM_TRIS_ADJ
:
44
return
GL_TRIANGLES_ADJACENCY;
45
};
46
}
47
48
}
// namespace blender::gpu
BLI_assert.hh
GPU_primitive.hh
blender::gpu
Definition
blf_internal_types.hh:35
blender::gpu::to_gl
GLenum to_gl(eGPUDataFormat format)
Definition
gl_texture.hh:231
blender::BLI_assert
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
blender::GPUPrimType
GPUPrimType
Definition
GPU_primitive.hh:18
blender::GPU_PRIM_TRI_STRIP
@ GPU_PRIM_TRI_STRIP
Definition
GPU_primitive.hh:24
blender::GPU_PRIM_NONE
@ GPU_PRIM_NONE
Definition
GPU_primitive.hh:33
blender::GPU_PRIM_TRIS_ADJ
@ GPU_PRIM_TRIS_ADJ
Definition
GPU_primitive.hh:30
blender::GPU_PRIM_TRIS
@ GPU_PRIM_TRIS
Definition
GPU_primitive.hh:21
blender::GPU_PRIM_LINES_ADJ
@ GPU_PRIM_LINES_ADJ
Definition
GPU_primitive.hh:29
blender::GPU_PRIM_LINES
@ GPU_PRIM_LINES
Definition
GPU_primitive.hh:20
blender::GPU_PRIM_LINE_STRIP_ADJ
@ GPU_PRIM_LINE_STRIP_ADJ
Definition
GPU_primitive.hh:31
blender::GPU_PRIM_TRI_FAN
@ GPU_PRIM_TRI_FAN
Definition
GPU_primitive.hh:25
blender::GPU_PRIM_LINE_STRIP
@ GPU_PRIM_LINE_STRIP
Definition
GPU_primitive.hh:22
blender::GPU_PRIM_POINTS
@ GPU_PRIM_POINTS
Definition
GPU_primitive.hh:19
blender::GPU_PRIM_LINE_LOOP
@ GPU_PRIM_LINE_LOOP
Definition
GPU_primitive.hh:23
Generated on
for Blender by
doxygen
1.18.0