1
0
Fork 0
forked from wry/wry

autocommit 2022-03-13 19:01:43 CET

This commit is contained in:
Julian Orth 2022-03-13 19:01:43 +01:00
parent 133035e0a6
commit e18be65210
12 changed files with 460 additions and 118 deletions

View file

@ -24,6 +24,18 @@ impl Debug for Framebuffer {
}
impl Framebuffer {
pub fn clear(&self) {
let _ = self.ctx.ctx.with_current(|| {
unsafe {
glBindFramebuffer(GL_FRAMEBUFFER, self.gl.fbo);
glViewport(0, 0, self.gl.width, self.gl.height);
glClearColor(0.0, 0.0, 0.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
}
Ok(())
});
}
pub fn render(&self, node: &dyn Node, state: &State, cursor_rect: Option<Rect>) {
let _ = self.ctx.ctx.with_current(|| {
if let Some(rd) = &self.ctx.renderdoc {