gg: scissor
parent
554d1dd7c6
commit
4ca283380a
|
@ -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)
|
||||||
|
}
|
Loading…
Reference in New Issue