aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-08-05 05:42:31 +0200
committerdec05eba <dec05eba@protonmail.com>2024-08-05 05:42:31 +0200
commit269cab0f80d49734a613ee4577f783ed870a8e1b (patch)
tree0d7d6b894f426ef11225863682145b98e9fe0273
parenta96a61a4d5104f804628912830de2afd0e22280c (diff)
set scissor const
-rw-r--r--include/mgl/window/window.h2
-rw-r--r--src/window/window.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/include/mgl/window/window.h b/include/mgl/window/window.h
index 211c2e4..96511fc 100644
--- a/include/mgl/window/window.h
+++ b/include/mgl/window/window.h
@@ -131,7 +131,7 @@ void mgl_window_get_view(mgl_window *self, mgl_view *view);
|mgl_window_set_scissor| with that saved scissor.
The scissor is set to the window size when the window is resized (window resize event).
*/
-void mgl_window_set_scissor(mgl_window *self, mgl_scissor *new_scissor);
+void mgl_window_set_scissor(mgl_window *self, const mgl_scissor *new_scissor);
void mgl_window_get_scissor(mgl_window *self, mgl_scissor *scissor);
void mgl_window_set_visible(mgl_window *self, bool visible);
diff --git a/src/window/window.c b/src/window/window.c
index 06b5a6b..701fbb3 100644
--- a/src/window/window.c
+++ b/src/window/window.c
@@ -1628,7 +1628,7 @@ void mgl_window_get_view(mgl_window *self, mgl_view *view) {
*view = self->view;
}
-void mgl_window_set_scissor(mgl_window *self, mgl_scissor *new_scissor) {
+void mgl_window_set_scissor(mgl_window *self, const mgl_scissor *new_scissor) {
mgl_context *context = mgl_get_context();
self->scissor = *new_scissor;
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);