gg: scissor

pull/3627/head
Leah Lundqvist 2020-02-02 02:54:41 +01:00 committed by GitHub
parent 554d1dd7c6
commit 4ca283380a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -11,7 +11,6 @@ import (
gx gx
os os
glfw glfw
math
) )
pub struct Vec2 { pub struct Vec2 {
@ -111,6 +110,7 @@ pub fn new_context(cfg Cfg) &GG {
if cfg.retina { if cfg.retina {
scale = 2 scale = 2
} }
gl.enable(C.GL_SCISSOR_TEST)
//gl.enable(GL_BLEND) //gl.enable(GL_BLEND)
//# glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); //# glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
//println('new gg text context VAO=$VAO') //println('new gg text context VAO=$VAO')
@ -522,3 +522,7 @@ pub fn (c &GG) draw_empty_rect(x, y, w, h f32, color gx.Color) {
c.draw_line(x, y + h, x + w, y + h, color) c.draw_line(x, y + h, x + w, y + h, color)
c.draw_line(x + w, y, x + w, y + h, color) c.draw_line(x + w, y, x + w, y + h, color)
} }
pub fn scissor(x, y, w, h f32) {
C.glScissor(x, y, w, h)
}