Blender
V4.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
11
#pragma once
12
13
#include "
BLI_assert.h
"
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.h
BLI_assert
#define BLI_assert(a)
Definition
BLI_assert.h:50
GPU_primitive.hh
GPUPrimType
GPUPrimType
Definition
GPU_primitive.hh:16
GPU_PRIM_TRI_FAN
@ GPU_PRIM_TRI_FAN
Definition
GPU_primitive.hh:23
GPU_PRIM_LINE_LOOP
@ GPU_PRIM_LINE_LOOP
Definition
GPU_primitive.hh:21
GPU_PRIM_LINE_STRIP_ADJ
@ GPU_PRIM_LINE_STRIP_ADJ
Definition
GPU_primitive.hh:29
GPU_PRIM_TRIS_ADJ
@ GPU_PRIM_TRIS_ADJ
Definition
GPU_primitive.hh:28
GPU_PRIM_NONE
@ GPU_PRIM_NONE
Definition
GPU_primitive.hh:31
GPU_PRIM_LINES
@ GPU_PRIM_LINES
Definition
GPU_primitive.hh:18
GPU_PRIM_POINTS
@ GPU_PRIM_POINTS
Definition
GPU_primitive.hh:17
GPU_PRIM_LINES_ADJ
@ GPU_PRIM_LINES_ADJ
Definition
GPU_primitive.hh:27
GPU_PRIM_LINE_STRIP
@ GPU_PRIM_LINE_STRIP
Definition
GPU_primitive.hh:20
GPU_PRIM_TRI_STRIP
@ GPU_PRIM_TRI_STRIP
Definition
GPU_primitive.hh:22
GPU_PRIM_TRIS
@ GPU_PRIM_TRIS
Definition
GPU_primitive.hh:19
blender::gpu
Definition
blf_internal_types.hh:23
blender::gpu::to_gl
static GLenum to_gl(const GPUAttachmentType type)
Definition
gl_framebuffer.hh:120
Generated on Thu Feb 6 2025 07:36:39 for Blender by
doxygen
1.11.0