autocommit 2022-02-01 01:20:49 CET
This commit is contained in:
parent
f2117256b9
commit
7654e70f64
39 changed files with 830 additions and 761 deletions
|
|
@ -1,15 +1,15 @@
|
|||
use crate::rect::Rect;
|
||||
use crate::render::gl::frame_buffer::GlFrameBuffer;
|
||||
use crate::render::gl::sys::{
|
||||
glBindFramebuffer, glClear, glClearColor, glViewport, GL_COLOR_BUFFER_BIT, GL_FRAMEBUFFER,
|
||||
};
|
||||
use crate::render::renderer::context::RenderContext;
|
||||
use crate::render::renderer::renderer::Renderer;
|
||||
use crate::render::sys::{glBlendFunc, GL_ONE, GL_ONE_MINUS_SRC_ALPHA};
|
||||
use crate::tree::Node;
|
||||
use crate::State;
|
||||
use std::ptr;
|
||||
use std::rc::Rc;
|
||||
use crate::rect::Rect;
|
||||
use crate::render::sys::{GL_ONE, GL_ONE_MINUS_SRC_ALPHA, glBlendFunc};
|
||||
use crate::State;
|
||||
|
||||
pub struct Framebuffer {
|
||||
pub(super) ctx: Rc<RenderContext>,
|
||||
|
|
|
|||
|
|
@ -10,14 +10,14 @@ use crate::render::gl::sys::{
|
|||
GL_TEXTURE_MIN_FILTER, GL_TRIANGLES, GL_TRIANGLE_STRIP,
|
||||
};
|
||||
use crate::render::renderer::context::RenderContext;
|
||||
use crate::render::sys::{glDisable, glEnable, GL_BLEND};
|
||||
use crate::tree::{
|
||||
ContainerFocus, ContainerNode, ContainerSplit, FloatNode, OutputNode,
|
||||
WorkspaceNode, CONTAINER_BORDER, CONTAINER_TITLE_HEIGHT,
|
||||
ContainerFocus, ContainerNode, ContainerSplit, FloatNode, OutputNode, WorkspaceNode,
|
||||
CONTAINER_BORDER, CONTAINER_TITLE_HEIGHT,
|
||||
};
|
||||
use std::ops::Deref;
|
||||
use std::rc::Rc;
|
||||
use std::slice;
|
||||
use crate::render::sys::{GL_BLEND, glDisable, glEnable};
|
||||
|
||||
const NON_COLOR: (f32, f32, f32) = (0.2, 0.2, 0.2);
|
||||
const CHILD_COLOR: (f32, f32, f32) = (0.8, 0.8, 0.8);
|
||||
|
|
@ -233,11 +233,11 @@ impl Renderer<'_> {
|
|||
true => {
|
||||
glEnable(GL_BLEND);
|
||||
&self.ctx.tex_alpha_prog
|
||||
},
|
||||
}
|
||||
false => {
|
||||
glDisable(GL_BLEND);
|
||||
&self.ctx.tex_prog
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
glUseProgram(prog.prog.prog);
|
||||
|
|
@ -269,14 +269,7 @@ impl Renderer<'_> {
|
|||
0,
|
||||
texcoord.as_ptr() as _,
|
||||
);
|
||||
glVertexAttribPointer(
|
||||
prog.pos as _,
|
||||
2,
|
||||
GL_FLOAT,
|
||||
GL_FALSE,
|
||||
0,
|
||||
pos.as_ptr() as _,
|
||||
);
|
||||
glVertexAttribPointer(prog.pos as _, 2, GL_FLOAT, GL_FALSE, 0, pos.as_ptr() as _);
|
||||
|
||||
glEnableVertexAttribArray(prog.texcoord as _);
|
||||
glEnableVertexAttribArray(prog.pos as _);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue