ext/drawable.c
void Init_ray_drawable() {
  ray_cDrawable = rb_define_class_under(ray_mRay, "Drawable", rb_cObject);
  rb_define_alloc_func(ray_cDrawable, ray_drawable_alloc);
  rb_define_method(ray_cDrawable, "initialize", ray_drawable_init, -1);
  rb_define_method(ray_cDrawable, "initialize_copy", ray_drawable_init_copy, 1);

  /* @group Transformations */
  rb_define_method(ray_cDrawable, "origin", ray_drawable_origin, 0);
  rb_define_method(ray_cDrawable, "origin=", ray_drawable_set_origin, 1);

  rb_define_method(ray_cDrawable, "scale", ray_drawable_scale, 0);
  rb_define_method(ray_cDrawable, "scale=", ray_drawable_set_scale, 1);

  rb_define_method(ray_cDrawable, "pos", ray_drawable_pos, 0);
  rb_define_method(ray_cDrawable, "pos=", ray_drawable_set_pos, 1);

  rb_define_method(ray_cDrawable, "z", ray_drawable_z, 0);
  rb_define_method(ray_cDrawable, "z=", ray_drawable_set_z, 1);

  rb_define_method(ray_cDrawable, "angle", ray_drawable_angle, 0);
  rb_define_method(ray_cDrawable, "angle=", ray_drawable_set_angle, 1);

  rb_define_method(ray_cDrawable, "matrix_proc", ray_drawable_matrix_proc, 0);
  rb_define_method(ray_cDrawable, "matrix_proc=", ray_drawable_set_matrix_proc,
                   1);

  rb_define_method(ray_cDrawable, "matrix_changed!",
                   ray_drawable_matrix_changed, 0);

  rb_define_method(ray_cDrawable, "matrix", ray_drawable_matrix, 0);
  rb_define_method(ray_cDrawable, "matrix=", ray_drawable_set_matrix, 1);
  rb_define_method(ray_cDrawable, "default_matrix",
                   ray_drawable_default_matrix, 0);
  rb_define_method(ray_cDrawable, "transform", ray_drawable_transform, 1);
  /* @endgroup */

  /* @group Rendering options */
  rb_define_method(ray_cDrawable, "shader", ray_drawable_shader, 0);
  rb_define_method(ray_cDrawable, "shader=", ray_drawable_set_shader, 1);

  rb_define_method(ray_cDrawable, "vertex_count=",
                   ray_drawable_set_vertex_count, 1);
  rb_define_method(ray_cDrawable, "vertex_count", ray_drawable_vertex_count, 0);

  rb_define_method(ray_cDrawable, "index_count=", ray_drawable_set_index_count,
                   1);
  rb_define_method(ray_cDrawable, "index_count", ray_drawable_index_count, 0);

  rb_define_method(ray_cDrawable, "changed!", ray_drawable_set_changed, 0);
  rb_define_method(ray_cDrawable, "changed?", ray_drawable_has_changed, 0);

  rb_define_method(ray_cDrawable, "textured=", ray_drawable_set_textured, 1);
  rb_define_method(ray_cDrawable, "textured?", ray_drawable_is_textured, 0);

  rb_define_method(ray_cDrawable, "blend_mode=", ray_drawable_set_blend_mode,
                   1);
  rb_define_method(ray_cDrawable, "blend_mode", ray_drawable_blend_mode, 0);
  /* @endgroup */
}
/*
 * Document-class: Ray::Drawable
 *
 * A drawable object represents anything that can be rendered on a target. This
 * class allows to define transformations for any drawable and to set states to
 * create your own drawable.
 *
 * A subclass of Ray::Drawable must implement ``render`` to draw the object,
 * using OpenGL calls:
 *
 *    # vertex_id is the index of the first vertex of this object; index_id is
 *    # the index of the first index of this object in the element buffer. One
 *    # of those variables at least will be ignored in the implementation
 *    def render(vertex_id, index_id)
 *      # do work
 *    end
 *
 * Also, it will often use Ray's system to store vertices and sometimes indices:
 *
 *     def fill_vertices
 *       # returns an array of vertices
 *     end
 *
 * Same with indices:
 *
 *     def fill_indices(vertex_id)
 *       # returns a Ray::GL::IntArray
 *     end
 *
 */
Document-class: Ray::Drawable
A drawable object represents anything that can be rendered on a target. This
class allows to define transformations for any drawable and to set states to
create your own drawable.

A subclass of Ray::Drawable must implement ``render`` to draw the object,
using OpenGL calls.

# vertex_id is the index of the first vertex of this object; index_id is
# the index of the first index of this object in the element buffer. One
# of those variables at least will be ignored in the implementation
def render(vertex_id, index_id)
# do work
end

Also, it will often use Ray's system to store vertices and sometimes indices.

def fill_vertices
# returns an array of vertices
end

Same with indices.


Document - class : Ray :: Drawable A drawable object represents anything that can be rendered on a target . This class allows to define transformations for any drawable and to set states to create your own drawable . A subclass of Ray :: Drawable must implement ` ` render ` ` to draw the object using OpenGL calls . # vertex_id is the index of the first vertex of this object ; index_id is # the index of the first index of this object in the element buffer . One # of those variables at least will be ignored in the implementation def render ( vertex_id index_id ) # do work end Also it will often use Ray ' s system to store vertices and sometimes indices . def fill_vertices # returns an array of vertices end Same with indices .
void Init_ray_drawable() {
  ray_cDrawable = rb_define_class_under(ray_mRay, "Drawable", rb_cObject);
  rb_define_alloc_func(ray_cDrawable, ray_drawable_alloc);
  rb_define_method(ray_cDrawable, "initialize", ray_drawable_init, -1);
  rb_define_method(ray_cDrawable, "initialize_copy", ray_drawable_init_copy, 1);
  rb_define_method(ray_cDrawable, "origin", ray_drawable_origin, 0);
  rb_define_method(ray_cDrawable, "origin=", ray_drawable_set_origin, 1);
  rb_define_method(ray_cDrawable, "scale", ray_drawable_scale, 0);
  rb_define_method(ray_cDrawable, "scale=", ray_drawable_set_scale, 1);
  rb_define_method(ray_cDrawable, "pos", ray_drawable_pos, 0);
  rb_define_method(ray_cDrawable, "pos=", ray_drawable_set_pos, 1);
  rb_define_method(ray_cDrawable, "z", ray_drawable_z, 0);
  rb_define_method(ray_cDrawable, "z=", ray_drawable_set_z, 1);
  rb_define_method(ray_cDrawable, "angle", ray_drawable_angle, 0);
  rb_define_method(ray_cDrawable, "angle=", ray_drawable_set_angle, 1);
  rb_define_method(ray_cDrawable, "matrix_proc", ray_drawable_matrix_proc, 0);
  rb_define_method(ray_cDrawable, "matrix_proc=", ray_drawable_set_matrix_proc,
                   1);
  rb_define_method(ray_cDrawable, "matrix_changed!",
                   ray_drawable_matrix_changed, 0);
  rb_define_method(ray_cDrawable, "matrix", ray_drawable_matrix, 0);
  rb_define_method(ray_cDrawable, "matrix=", ray_drawable_set_matrix, 1);
  rb_define_method(ray_cDrawable, "default_matrix",
                   ray_drawable_default_matrix, 0);
  rb_define_method(ray_cDrawable, "transform", ray_drawable_transform, 1);
  rb_define_method(ray_cDrawable, "shader", ray_drawable_shader, 0);
  rb_define_method(ray_cDrawable, "shader=", ray_drawable_set_shader, 1);
  rb_define_method(ray_cDrawable, "vertex_count=",
                   ray_drawable_set_vertex_count, 1);
  rb_define_method(ray_cDrawable, "vertex_count", ray_drawable_vertex_count, 0);
  rb_define_method(ray_cDrawable, "index_count=", ray_drawable_set_index_count,
                   1);
  rb_define_method(ray_cDrawable, "index_count", ray_drawable_index_count, 0);
  rb_define_method(ray_cDrawable, "changed!", ray_drawable_set_changed, 0);
  rb_define_method(ray_cDrawable, "changed?", ray_drawable_has_changed, 0);
  rb_define_method(ray_cDrawable, "textured=", ray_drawable_set_textured, 1);
  rb_define_method(ray_cDrawable, "textured?", ray_drawable_is_textured, 0);
  rb_define_method(ray_cDrawable, "blend_mode=", ray_drawable_set_blend_mode,
                   1);
  rb_define_method(ray_cDrawable, "blend_mode", ray_drawable_blend_mode, 0);
}
void Init_ray_drawable ( ) { ray_cDrawable = rb_define_class_under ( ray_mRay , " " , rb_cObject ) ; rb_define_alloc_func ( ray_cDrawable , ray_drawable_alloc ) ; rb_define_method ( ray_cDrawable , " " , ray_drawable_init , -1 ) ; rb_define_method ( ray_cDrawable , " " , ray_drawable_init_copy , 1 ) ; rb_define_method ( ray_cDrawable , " " , ray_drawable_origin , 0 ) ; rb_define_method ( ray_cDrawable , " " , ray_drawable_set_origin , 1 ) ; rb_define_method ( ray_cDrawable , " " , ray_drawable_scale , 0 ) ; rb_define_method ( ray_cDrawable , " " , ray_drawable_set_scale , 1 ) ; rb_define_method ( ray_cDrawable , " " , ray_drawable_pos , 0 ) ; rb_define_method ( ray_cDrawable , " " , ray_drawable_set_pos , 1 ) ; rb_define_method ( ray_cDrawable , " " , ray_drawable_z , 0 ) ; rb_define_method ( ray_cDrawable , " " , ray_drawable_set_z , 1 ) ; rb_define_method ( ray_cDrawable , " " , ray_drawable_angle , 0 ) ; rb_define_method ( ray_cDrawable , " " , ray_drawable_set_angle , 1 ) ; rb_define_method ( ray_cDrawable , " " , ray_drawable_matrix_proc , 0 ) ; rb_define_method ( ray_cDrawable , " " , ray_drawable_set_matrix_proc , 1 ) ; rb_define_method ( ray_cDrawable , " " , ray_drawable_matrix_changed , 0 ) ; rb_define_method ( ray_cDrawable , " " , ray_drawable_matrix , 0 ) ; rb_define_method ( ray_cDrawable , " " , ray_drawable_set_matrix , 1 ) ; rb_define_method ( ray_cDrawable , " " , ray_drawable_default_matrix , 0 ) ; rb_define_method ( ray_cDrawable , " " , ray_drawable_transform , 1 ) ; rb_define_method ( ray_cDrawable , " " , ray_drawable_shader , 0 ) ; rb_define_method ( ray_cDrawable , " " , ray_drawable_set_shader , 1 ) ; rb_define_method ( ray_cDrawable , " " , ray_drawable_set_vertex_count , 1 ) ; rb_define_method ( ray_cDrawable , " " , ray_drawable_vertex_count , 0 ) ; rb_define_method ( ray_cDrawable , " " , ray_drawable_set_index_count , 1 ) ; rb_define_method ( ray_cDrawable , " " , ray_drawable_index_count , 0 ) ; rb_define_method ( ray_cDrawable , " " , ray_drawable_set_changed , 0 ) ; rb_define_method ( ray_cDrawable , " " , ray_drawable_has_changed , 0 ) ; rb_define_method ( ray_cDrawable , " " , ray_drawable_set_textured , 1 ) ; rb_define_method ( ray_cDrawable , " " , ray_drawable_is_textured , 0 ) ; rb_define_method ( ray_cDrawable , " " , ray_drawable_set_blend_mode , 1 ) ; rb_define_method ( ray_cDrawable , " " , ray_drawable_blend_mode , 0 ) ; }
Document-class: Ray::Drawable
 A drawable object represents anything that can be rendered on a target.
Document - class : Ray :: Drawable A drawable object represents anything that can be rendered on a target .
/* @group Transformations */ /* @endgroup */ /* @group Rendering options */ /* @endgroup */