diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-12-14 23:32:35 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-12-14 23:32:35 +0100 |
commit | 08b27c7854cf38d3f03b0607f06c0140d6dc7952 (patch) | |
tree | 202b276fd812394abb2e4efda048dcf4e3332635 /src/window | |
parent | e52886f8bea55fb3c9ff973b16ed812549cd1f22 (diff) |
Enable scissor test, invert scissor coordinates
Diffstat (limited to 'src/window')
-rw-r--r-- | src/window/window.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/window/window.c b/src/window/window.c index 64c09f2..1df12e0 100644 --- a/src/window/window.c +++ b/src/window/window.c @@ -332,6 +332,7 @@ static int mgl_window_init(mgl_window *self, const char *title, const mgl_window set_vertical_sync_enabled(self->window, 1); context->gl.glEnable(GL_TEXTURE_2D); context->gl.glEnable(GL_BLEND); + context->gl.glEnable(GL_SCISSOR_TEST); context->gl.glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); context->gl.glEnableClientState(GL_VERTEX_ARRAY); context->gl.glEnableClientState(GL_TEXTURE_COORD_ARRAY); @@ -725,7 +726,7 @@ void mgl_window_get_view(mgl_window *self, mgl_view *view) { void mgl_window_set_scissor(mgl_window *self, mgl_scissor *new_scissor) { mgl_context *context = mgl_get_context(); self->scissor = *new_scissor; - context->gl.glScissor(self->scissor.position.x, self->scissor.position.y, self->scissor.size.x, self->scissor.size.y); + context->gl.glScissor(self->scissor.position.x, self->size.y - self->scissor.position.y - self->scissor.size.y, self->scissor.size.x, self->scissor.size.y); } void mgl_window_get_scissor(mgl_window *self, mgl_scissor *scissor) { |