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