Sha256: 0d5ba53807a3b2d8c672651cb8e51704053c15b6c35c75a5d1906abf9faac771
Contents?: true
Size: 1.31 KB
Versions: 7
Compression:
Stored size: 1.31 KB
Contents
#include "reflex/ruby/event.h" #include "defs.h" RUCY_DEFINE_VALUE_FROM_TO(Reflex::UpdateEvent) #define THIS to<Reflex::UpdateEvent*>(self) #define CHECK RUCY_CHECK_OBJ(Reflex::UpdateEvent, self) static VALUE alloc(VALUE klass) { return new_type<Reflex::UpdateEvent>(klass); } static VALUE initialize(VALUE self, VALUE now, VALUE dt) { CHECK; THIS->now = to<double>(now); THIS->dt = to<float>(dt); return rb_call_super(0, NULL); } static VALUE initialize_copy(VALUE self, VALUE obj) { CHECK; *THIS = to<Reflex::UpdateEvent&>(obj); return self; } static VALUE now(VALUE self) { CHECK; return value(THIS->now); } static VALUE dt(VALUE self) { CHECK; return value(THIS->dt); } static Class cUpdateEvent; void Init_update_event () { Module mReflex = rb_define_module("Reflex"); cUpdateEvent = mReflex.define_class("UpdateEvent", Reflex::event_class()); rb_define_alloc_func(cUpdateEvent, alloc); rb_define_private_method(cUpdateEvent, "initialize", RUBY_METHOD_FUNC(initialize), 2); rb_define_private_method(cUpdateEvent, "initialize_copy", RUBY_METHOD_FUNC(initialize_copy), 1); rb_define_method(cUpdateEvent, "now", RUBY_METHOD_FUNC(now), 0); rb_define_method(cUpdateEvent, "dt", RUBY_METHOD_FUNC(dt), 0); } namespace Reflex { Class update_event_class () { return cUpdateEvent; } }// Reflex
Version data entries
7 entries across 7 versions & 1 rubygems