non uniform border radius for quads
This commit is contained in:
parent
d222b5c8b0
commit
c0596179bd
25 changed files with 121 additions and 60 deletions
|
|
@ -254,7 +254,7 @@ unsafe fn create_buffers(
|
|||
gl.enable_vertex_attrib_array(4);
|
||||
gl.vertex_attrib_pointer_f32(
|
||||
4,
|
||||
1,
|
||||
4,
|
||||
glow::FLOAT,
|
||||
false,
|
||||
stride,
|
||||
|
|
@ -268,7 +268,7 @@ unsafe fn create_buffers(
|
|||
glow::FLOAT,
|
||||
false,
|
||||
stride,
|
||||
4 * (2 + 2 + 4 + 4 + 1),
|
||||
4 * (2 + 2 + 4 + 4 + 4),
|
||||
);
|
||||
|
||||
gl.enable_vertex_attrib_array(6);
|
||||
|
|
@ -278,7 +278,7 @@ unsafe fn create_buffers(
|
|||
glow::FLOAT,
|
||||
false,
|
||||
stride,
|
||||
4 * (2 + 2 + 4 + 4 + 1 + 1),
|
||||
4 * (2 + 2 + 4 + 4 + 4 + 1),
|
||||
);
|
||||
|
||||
gl.bind_vertex_array(None);
|
||||
|
|
@ -307,7 +307,7 @@ pub struct Vertex {
|
|||
pub border_color: [f32; 4],
|
||||
|
||||
/// The border radius of the [`Vertex`].
|
||||
pub border_radius: f32,
|
||||
pub border_radius: [f32; 4],
|
||||
|
||||
/// The border width of the [`Vertex`].
|
||||
pub border_width: f32,
|
||||
|
|
@ -325,7 +325,7 @@ impl Vertex {
|
|||
size: quad.size,
|
||||
color: quad.color,
|
||||
border_color: quad.color,
|
||||
border_radius: quad.border_radius,
|
||||
border_radius: [quad.border_radius[0]; 4],
|
||||
border_width: quad.border_width,
|
||||
q_position: [0.0, 0.0],
|
||||
};
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@ unsafe fn create_instance_buffer(
|
|||
gl.enable_vertex_attrib_array(4);
|
||||
gl.vertex_attrib_pointer_f32(
|
||||
4,
|
||||
1,
|
||||
4,
|
||||
glow::FLOAT,
|
||||
false,
|
||||
stride,
|
||||
|
|
@ -233,7 +233,7 @@ unsafe fn create_instance_buffer(
|
|||
glow::FLOAT,
|
||||
false,
|
||||
stride,
|
||||
4 * (2 + 2 + 4 + 4 + 1),
|
||||
4 * (2 + 2 + 4 + 4 + 4),
|
||||
);
|
||||
gl.vertex_attrib_divisor(5, 1);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue