#include "rays/ruby/shader.h" #include #include "defs.h" using namespace Rucy; static Class cShader; RUCY_DEFINE_VALUE_FROM_TO(Rays::Shader, cShader) #define THIS to(self) #define CHECK RUCY_CHECK_OBJECT(Rays::Shader, cShader, self) static RUCY_DEF_ALLOC(alloc, klass) { return new_type(klass); } RUCY_END static RUCY_DEF1(initialize, source) { RUCY_CHECK_OBJ(Rays::Shader, cShader, self); if (!source.is_s()) argument_error(__FILE__, __LINE__); *THIS = Rays::Shader(source.c_str()); return self; } RUCY_END void Init_shader () { Module mRays = define_module("Rays"); cShader = mRays.define_class("Shader"); cShader.define_alloc_func(alloc); cShader.define_private_method("initialize", initialize); } namespace Rays { Class shader_class () { return cShader; } }// Rays