jes-ruby/src/Widget.cc

24 lines
539 B
C++

#include "Widget.h"
#include "ruby.h"
#include "gl3w.h"
static VALUE ruby_class;
static VALUE Widget_render_begin(VALUE self)
{
int x = FIX2INT(rb_iv_get(self, "@x"));
int y = FIX2INT(rb_iv_get(self, "@y"));
int width = FIX2INT(rb_iv_get(self, "@width"));
int height = FIX2INT(rb_iv_get(self, "@height"));
glScissor(x, y, width, height);
return Qnil;
}
void Widget_Init()
{
ruby_class = rb_define_module("Widget");
rb_define_method(ruby_class, "render_begin", (VALUE(*)(...))Widget_render_begin, 0);
}