From 7cc541ed29c337f9e517eba72b743c422a8461f1 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Mon, 4 Aug 2014 22:16:51 -0400 Subject: [PATCH] change Window.render to Window.render_begin; add empty Ruby Window.render method --- runtime/lib/window.rb | 3 +++ src/Window.cc | 16 +++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/runtime/lib/window.rb b/runtime/lib/window.rb index 1201e20..3695887 100644 --- a/runtime/lib/window.rb +++ b/runtime/lib/window.rb @@ -25,4 +25,7 @@ class Window Window.remove(self) end + def render + end + end diff --git a/src/Window.cc b/src/Window.cc index cf8dc4a..48bff43 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -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); }