Blender
V4.3
source
blender
editors
space_sequencer
sequencer_quads_batch.hh
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2023 Blender Authors
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later */
4
9
#pragma once
10
11
#include "
BLI_sys_types.h
"
12
13
namespace
blender::gpu
{
14
class
Batch;
15
class
IndexBuf;
16
class
VertBuf;
17
}
// namespace blender::gpu
18
struct
ColorVertex
;
19
28
class
SeqQuadsBatch
{
29
public
:
30
SeqQuadsBatch
();
31
~SeqQuadsBatch
();
32
34
void
draw
();
36
void
add_quad
(
float
x1,
float
y1,
float
x2,
float
y2,
const
uchar
color[4])
37
{
38
add_quad
(x1, y1, x1, y2, x2, y1, x2, y2, color, color, color, color);
39
}
41
void
add_quad
(
float
x1,
42
float
y1,
43
float
x2,
44
float
y2,
45
float
x3,
46
float
y3,
47
float
x4,
48
float
y4,
49
const
uchar
color[4])
50
{
51
add_quad
(x1, y1, x2, y2, x3, y3, x4, y4, color, color, color, color);
52
}
54
void
add_quad
(
float
x1,
55
float
y1,
56
float
x2,
57
float
y2,
58
float
x3,
59
float
y3,
60
float
x4,
61
float
y4,
62
const
uchar
color1[4],
63
const
uchar
color2[4],
64
const
uchar
color3[4],
65
const
uchar
color4[4]);
67
void
add_wire_quad
(
float
x1,
float
y1,
float
x2,
float
y2,
const
uchar
color[4]);
69
void
add_line
(
float
x1,
float
y1,
float
x2,
float
y2,
const
uchar
color[4])
70
{
71
add_line
(x1, y1, x2, y2, color, color);
72
}
74
void
add_line
(
75
float
x1,
float
y1,
float
x2,
float
y2,
const
uchar
color1[4],
const
uchar
color2[4]);
76
77
private
:
78
static
constexpr
int
MAX_QUADS = 1024;
79
static
constexpr
int
MAX_LINES = 4096;
80
81
blender::gpu::VertBuf
*vbo_quads =
nullptr
;
82
blender::gpu::IndexBuf
*ibo_quads =
nullptr
;
83
blender::gpu::Batch *batch_quads =
nullptr
;
84
ColorVertex
*verts_quads =
nullptr
;
85
int
quads_num = 0;
86
87
blender::gpu::VertBuf
*vbo_lines =
nullptr
;
88
blender::gpu::Batch *batch_lines =
nullptr
;
89
ColorVertex
*verts_lines =
nullptr
;
90
int
lines_num = 0;
91
};
BLI_sys_types.h
uchar
unsigned char uchar
Definition
BLI_sys_types.h:71
SeqQuadsBatch
Definition
sequencer_quads_batch.hh:28
SeqQuadsBatch::add_line
void add_line(float x1, float y1, float x2, float y2, const uchar color[4])
Definition
sequencer_quads_batch.hh:69
SeqQuadsBatch::~SeqQuadsBatch
~SeqQuadsBatch()
Definition
sequencer_quads_batch.cc:62
SeqQuadsBatch::add_quad
void add_quad(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4, const uchar color[4])
Definition
sequencer_quads_batch.hh:41
SeqQuadsBatch::draw
void draw()
Definition
sequencer_quads_batch.cc:70
SeqQuadsBatch::SeqQuadsBatch
SeqQuadsBatch()
Definition
sequencer_quads_batch.cc:39
SeqQuadsBatch::add_wire_quad
void add_wire_quad(float x1, float y1, float x2, float y2, const uchar color[4])
Definition
sequencer_quads_batch.cc:122
SeqQuadsBatch::add_quad
void add_quad(float x1, float y1, float x2, float y2, const uchar color[4])
Definition
sequencer_quads_batch.hh:36
blender::gpu::IndexBuf
Definition
GPU_index_buffer.hh:40
blender::gpu::VertBuf
Definition
GPU_vertex_buffer.hh:61
blender::gpu
Definition
blf_internal_types.hh:23
ColorVertex
Definition
sequencer_quads_batch.cc:18
Generated on Thu Feb 6 2025 07:36:39 for Blender by
doxygen
1.11.0