|
Blender V4.3
|
#include <sequencer_quads_batch.hh>
Public Member Functions | |
| SeqQuadsBatch () | |
| ~SeqQuadsBatch () | |
| void | draw () |
| void | add_quad (float x1, float y1, float x2, float y2, const uchar color[4]) |
| 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, float x3, float y3, float x4, float y4, const uchar color1[4], const uchar color2[4], const uchar color3[4], const uchar color4[4]) |
| void | add_wire_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_line (float x1, float y1, float x2, float y2, const uchar color1[4], const uchar color2[4]) |
Flat-colored 2D geometry draw batching utility.
Internally uses GPU_SHADER_3D_FLAT_COLOR to draw single-colored rectangles, quads or lines. After adding a number of primitives with add_quad, add_wire_quad, add_line, draw them using draw. Note that draw can be called behind the scenes if number of primitives is larger than the internal batch buffer size.
Definition at line 28 of file sequencer_quads_batch.hh.
| SeqQuadsBatch::SeqQuadsBatch | ( | ) |
Definition at line 39 of file sequencer_quads_batch.cc.
References create_quads_index_buffer(), GPU_batch_create_ex(), GPU_BATCH_OWNS_INDEX, GPU_BATCH_OWNS_VBO, GPU_batch_program_set_builtin(), GPU_COMP_F32, GPU_COMP_U8, GPU_FETCH_FLOAT, GPU_FETCH_INT_TO_FLOAT_UNIT, GPU_PRIM_LINES, GPU_PRIM_TRIS, GPU_SHADER_3D_SMOOTH_COLOR, GPU_USAGE_STREAM, GPU_vertbuf_create_with_format_ex(), GPU_vertbuf_data_alloc(), GPU_vertformat_attr_add(), and GPU_vertformat_clear().
| SeqQuadsBatch::~SeqQuadsBatch | ( | ) |
Definition at line 62 of file sequencer_quads_batch.cc.
References BLI_assert_msg, and GPU_batch_discard().
| void SeqQuadsBatch::add_line | ( | float | x1, |
| float | y1, | ||
| float | x2, | ||
| float | y2, | ||
| const uchar | color1[4], | ||
| const uchar | color2[4] ) |
Add a line with two endpoint colors.
Definition at line 153 of file sequencer_quads_batch.cc.
References BLI_assert, blender::gpu::VertBuf::data(), data, and draw().
|
inline |
Add a line with single color.
Definition at line 69 of file sequencer_quads_batch.hh.
References add_line().
Referenced by add_line(), and draw_seq_waveform_overlay().
|
inline |
Add an axis-aligned quad.
Definition at line 36 of file sequencer_quads_batch.hh.
References add_quad().
Referenced by add_quad(), add_quad(), draw_cache_background(), draw_cache_view_iter_fn(), draw_multicam_highlight(), draw_seq_fcurve_overlay(), draw_seq_waveform_overlay(), draw_strip_offsets(), drawmeta_contents(), and sequencer_retiming_draw_continuity().
| void SeqQuadsBatch::add_quad | ( | float | x1, |
| float | y1, | ||
| float | x2, | ||
| float | y2, | ||
| float | x3, | ||
| float | y3, | ||
| float | x4, | ||
| float | y4, | ||
| const uchar | color1[4], | ||
| const uchar | color2[4], | ||
| const uchar | color3[4], | ||
| const uchar | color4[4] ) |
Add a quad with four arbitrary coordinates and a color for each.
Definition at line 88 of file sequencer_quads_batch.cc.
References BLI_assert, blender::gpu::VertBuf::data(), data, draw(), and v2.
|
inline |
Add a quad with four arbitrary coordinates and one color.
Definition at line 41 of file sequencer_quads_batch.hh.
References add_quad().
Add four lines of an axis-aligned quad edges.
Definition at line 122 of file sequencer_quads_batch.cc.
References BLI_assert, blender::gpu::VertBuf::data(), data, draw(), and v2.
Referenced by draw_strip_offsets().
| void SeqQuadsBatch::draw | ( | ) |
Draw all the previously added primitives.
Definition at line 70 of file sequencer_quads_batch.cc.
References GPU_batch_draw_range(), GPU_vertbuf_tag_dirty(), and GPU_vertbuf_use().
Referenced by add_line(), add_quad(), add_wire_quad(), draw_retiming_continuity_ranges(), and draw_seq_strips().