Sha256: 0bd0fe22843714b4f3c912a0a78460324034898ae86fec67222f07ac3bbfa59c

Contents?: true

Size: 961 Bytes

Versions: 11

Compression:

Stored size: 961 Bytes

Contents

/*
 * module Ashton
 *
 * Ruby module extension for Gosu, implementing shaders and textures.
 *
 */

#include "ashton.h"

VALUE rb_mAshton;

void Init_ashton()
{
    rb_mAshton = rb_define_module("Ashton");

    srand((float)time(NULL));

    Init_Gosu();

    Init_Ashton_Texture(rb_mAshton);
    Init_Ashton_ParticleEmitter(rb_mAshton);
    Init_Ashton_Shader(rb_mAshton);
    Init_Ashton_PixelCache(rb_mAshton);
    //Init_Ashton_WindowBuffer(rb_mAshton);


    rb_define_singleton_method(rb_mAshton, "fast_sin", Ashton_fast_sin, 1);
    rb_define_singleton_method(rb_mAshton, "fast_cos", Ashton_fast_cos, 1);
    rb_define_method(rb_mAshton, "fast_sin", Ashton_fast_sin, 1);
    rb_define_method(rb_mAshton, "fast_cos", Ashton_fast_cos, 1);
}

VALUE Ashton_fast_sin(VALUE self, VALUE angle)
{
    return rb_float_new(fast_sin_deg(NUM2DBL(angle)));
}

VALUE Ashton_fast_cos(VALUE self, VALUE angle)
{
   return rb_float_new(fast_cos_deg(NUM2DBL(angle)));
}

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
danabr75-ashton-0.1.5 ext/ashton/ashton.c
ashton-0.1.6 ext/ashton/ashton.c
ashton-0.1.5 ext/ashton/ashton.c
ashton-0.1.4 ext/ashton/ashton.c
ashton-0.1.3 ext/ashton/ashton.c
ashton-0.1.2 ext/ashton/ashton.c
ashton-0.1.1 ext/ashton/ashton.c
ashton-0.1.0 ext/ashton/ashton.c
ashton-0.0.4alpha ext/ashton/ashton.c
ashton-0.0.3alpha ext/ashton/ashton.c
ashton-0.0.2alpha ext/ashton/ashton.c