Blender V4.3
SeqQuadsBatch Class Reference

#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])
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ SeqQuadsBatch()

◆ ~SeqQuadsBatch()

SeqQuadsBatch::~SeqQuadsBatch ( )

Definition at line 62 of file sequencer_quads_batch.cc.

References BLI_assert_msg, and GPU_batch_discard().

Member Function Documentation

◆ add_line() [1/2]

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().

◆ add_line() [2/2]

void SeqQuadsBatch::add_line ( float x1,
float y1,
float x2,
float y2,
const uchar color[4] )
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().

◆ add_quad() [1/3]

◆ add_quad() [2/3]

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.

◆ add_quad() [3/3]

void SeqQuadsBatch::add_quad ( float x1,
float y1,
float x2,
float y2,
float x3,
float y3,
float x4,
float y4,
const uchar color[4] )
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_wire_quad()

void SeqQuadsBatch::add_wire_quad ( float x1,
float y1,
float x2,
float y2,
const uchar color[4] )

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().

◆ draw()

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().


The documentation for this class was generated from the following files: