1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

gg: scissor

This commit is contained in:
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

View File

@ -11,7 +11,6 @@ import (
gx
os
glfw
math
)
pub struct Vec2 {
@ -111,6 +110,7 @@ pub fn new_context(cfg Cfg) &GG {
if cfg.retina {
scale = 2
}
gl.enable(C.GL_SCISSOR_TEST)
//gl.enable(GL_BLEND)
//# glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
//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 + w, y, x + w, y + h, color)
}
pub fn scissor(x, y, w, h f32) {
C.glScissor(x, y, w, h)
}