use glScissor() instead of glViewport() when drawing widgets
This commit is contained in:
parent
18e195799a
commit
c5fb7df478
@ -11,7 +11,7 @@ static VALUE Widget_render_begin(VALUE self)
|
|||||||
int width = FIX2INT(rb_iv_get(self, "@width"));
|
int width = FIX2INT(rb_iv_get(self, "@width"));
|
||||||
int height = FIX2INT(rb_iv_get(self, "@height"));
|
int height = FIX2INT(rb_iv_get(self, "@height"));
|
||||||
|
|
||||||
glViewport(x, y, width, height);
|
glScissor(x, y, width, height);
|
||||||
|
|
||||||
return Qnil;
|
return Qnil;
|
||||||
}
|
}
|
||||||
|
@ -85,6 +85,8 @@ static void Init_OpenGL()
|
|||||||
rb_raise(rb_eRuntimeError, "OpenGL 3.0 is not supported");
|
rb_raise(rb_eRuntimeError, "OpenGL 3.0 is not supported");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
glEnable(GL_SCISSOR_TEST);
|
||||||
|
|
||||||
initialized = true;
|
initialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user