use glScissor() instead of glViewport() when drawing widgets

This commit is contained in:
Josh Holtrop 2014-07-29 20:29:42 -04:00
parent 18e195799a
commit c5fb7df478
2 changed files with 3 additions and 1 deletions

View File

@ -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;
}

View File

@ -85,6 +85,8 @@ static void Init_OpenGL()
rb_raise(rb_eRuntimeError, "OpenGL 3.0 is not supported");
}
glEnable(GL_SCISSOR_TEST);
initialized = true;
}