Sha256: acdd171b2cfe3f6252db3268a7811866497a949afad587783c8e25b8cee88d18
Contents?: true
Size: 1.21 KB
Versions: 7
Compression:
Stored size: 1.21 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 RUCY_DEF_ALLOC(alloc, klass) { return new_type<Reflex::UpdateEvent>(klass); } RUCY_END static RUCY_DEF2(initialize, now, dt) { CHECK; THIS->now = to<double>(now); THIS->dt = to<float>(dt); return rb_call_super(0, NULL); } RUCY_END static RUCY_DEF1(initialize_copy, obj) { CHECK; *THIS = to<Reflex::UpdateEvent&>(obj); return self; } RUCY_END static RUCY_DEF0(now) { CHECK; return value(THIS->now); } RUCY_END static RUCY_DEF0(dt) { CHECK; return value(THIS->dt); } RUCY_END static Class cUpdateEvent; void Init_update_event () { Module mReflex = define_module("Reflex"); cUpdateEvent = mReflex.define_class("UpdateEvent", Reflex::event_class()); cUpdateEvent.define_alloc_func(alloc); cUpdateEvent.define_private_method("initialize", initialize); cUpdateEvent.define_private_method("initialize_copy", initialize_copy); cUpdateEvent.define_method("now", now); cUpdateEvent.define_method("dt", dt); } namespace Reflex { Class update_event_class () { return cUpdateEvent; } }// Reflex
Version data entries
7 entries across 7 versions & 1 rubygems