change Window.render to Window.render_begin; add empty Ruby Window.render method

This commit is contained in:
Josh Holtrop 2014-08-04 22:16:51 -04:00
parent 846e21bf5f
commit 7cc541ed29
2 changed files with 14 additions and 5 deletions

View File

@ -25,4 +25,7 @@ class Window
Window.remove(self)
end
def render
end
end

View File

@ -140,8 +140,10 @@ static VALUE Window_event_loop(VALUE klass)
return Qnil;
}
static VALUE Window_render(VALUE self)
static VALUE Window_render_begin(VALUE self)
{
rb_call_super(0, NULL);
glClearColor (0.0, 0.0, 0.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
@ -160,8 +162,12 @@ static VALUE Window_render_end(VALUE self)
void Window_Init(void)
{
ruby_class = rb_define_class("Window", rb_cObject);
rb_define_singleton_method(ruby_class, "new", (VALUE(*)(...))Window_new, 0);
rb_define_singleton_method(ruby_class, "event_loop", (VALUE(*)(...))Window_event_loop, 0);
rb_define_method(ruby_class, "render", (VALUE(*)(...))Window_render, 0);
rb_define_method(ruby_class, "render_end", (VALUE(*)(...))Window_render_end, 0);
rb_define_singleton_method(ruby_class, "new",
(VALUE(*)(...))Window_new, 0);
rb_define_singleton_method(ruby_class, "event_loop",
(VALUE(*)(...))Window_event_loop, 0);
rb_define_method(ruby_class, "render_begin",
(VALUE(*)(...))Window_render_begin, 0);
rb_define_method(ruby_class, "render_end",
(VALUE(*)(...))Window_render_end, 0);
}