Blender V5.0
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
8
9#pragma once
10
11#include "BLI_sys_types.h"
12
13namespace blender::gpu {
14class Batch;
15class IndexBuf;
16class VertBuf;
17} // namespace blender::gpu
18
19namespace blender::ed::vse {
20
21struct ColorVertex;
22
32 public:
35
37 void draw();
39 void add_quad(float x1, float y1, float x2, float y2, const uchar color[4])
40 {
41 add_quad(x1, y1, x1, y2, x2, y1, x2, y2, color, color, color, color);
42 }
43
44 void add_quad(float x1,
45 float y1,
46 float x2,
47 float y2,
48 float x3,
49 float y3,
50 float x4,
51 float y4,
52 const uchar color[4])
53 {
54 add_quad(x1, y1, x2, y2, x3, y3, x4, y4, color, color, color, color);
55 }
56
57 void add_quad(float x1,
58 float y1,
59 float x2,
60 float y2,
61 float x3,
62 float y3,
63 float x4,
64 float y4,
65 const uchar color1[4],
66 const uchar color2[4],
67 const uchar color3[4],
68 const uchar color4[4]);
70 void add_wire_quad(float x1, float y1, float x2, float y2, const uchar color[4]);
72 void add_line(float x1, float y1, float x2, float y2, const uchar color[4])
73 {
74 add_line(x1, y1, x2, y2, color, color);
75 }
76
77 void add_line(
78 float x1, float y1, float x2, float y2, const uchar color1[4], const uchar color2[4]);
79
80 private:
81 static constexpr int MAX_QUADS = 1024;
82 static constexpr int MAX_LINES = 4096;
83
84 blender::gpu::VertBuf *vbo_quads = nullptr;
85 blender::gpu::IndexBuf *ibo_quads = nullptr;
86 blender::gpu::Batch *batch_quads = nullptr;
87 ColorVertex *verts_quads = nullptr;
88 int quads_num = 0;
89
90 blender::gpu::VertBuf *vbo_lines = nullptr;
91 blender::gpu::Batch *batch_lines = nullptr;
92 ColorVertex *verts_lines = nullptr;
93 int lines_num = 0;
94};
95
96} // namespace blender::ed::vse
unsigned char uchar
void add_quad(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4, const uchar color[4])
void add_quad(float x1, float y1, float x2, float y2, const uchar color[4])
void add_line(float x1, float y1, float x2, float y2, const uchar color[4])
void add_wire_quad(float x1, float y1, float x2, float y2, const uchar color[4])