diff --git a/src/Widget.cc b/src/Widget.cc index 8674d1f..af24301 100644 --- a/src/Widget.cc +++ b/src/Widget.cc @@ -11,7 +11,7 @@ static VALUE Widget_render_begin(VALUE self) int width = FIX2INT(rb_iv_get(self, "@width")); int height = FIX2INT(rb_iv_get(self, "@height")); - glViewport(x, y, width, height); + glScissor(x, y, width, height); return Qnil; } diff --git a/src/Window.cc b/src/Window.cc index 18e4b7c..7002ccc 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -85,6 +85,8 @@ static void Init_OpenGL() rb_raise(rb_eRuntimeError, "OpenGL 3.0 is not supported"); } + glEnable(GL_SCISSOR_TEST); + initialized = true; }