ext/gl.c
void Init_ray_gl() {
  ray_mGL = rb_define_module_under(ray_mRay, "GL");

  ray_gl_primitives = rb_hash_new();
  rb_hash_aset(ray_gl_primitives, RAY_SYM("points"), INT2FIX(GL_POINTS));
  rb_hash_aset(ray_gl_primitives, RAY_SYM("line_strip"),
               INT2FIX(GL_LINE_STRIP));
  rb_hash_aset(ray_gl_primitives, RAY_SYM("line_loop"), INT2FIX(GL_LINE_LOOP));
  rb_hash_aset(ray_gl_primitives, RAY_SYM("lines"), INT2FIX(GL_LINES));
  rb_hash_aset(ray_gl_primitives, RAY_SYM("triangle_strip"),
               INT2FIX(GL_TRIANGLE_STRIP));
  rb_hash_aset(ray_gl_primitives, RAY_SYM("triangle_fan"),
               INT2FIX(GL_TRIANGLE_FAN));
  rb_hash_aset(ray_gl_primitives, RAY_SYM("triangles"), INT2FIX(GL_TRIANGLES));

  /* @return [Hash] Available primitives. */
  rb_define_const(ray_mGL, "Primitives", ray_gl_primitives);

  /* @group Context configuration */
  rb_define_module_function(ray_mGL, "depth_size", ray_gl_depth_size, 0);
  rb_define_module_function(ray_mGL, "depth_size=", ray_gl_set_depth_size, 1);

  rb_define_module_function(ray_mGL, "stencil_size", ray_gl_stencil_size, 0);
  rb_define_module_function(ray_mGL, "stencil_size=", ray_gl_set_stencil_size,
                            1);

  rb_define_module_function(ray_mGL, "major_version", ray_gl_major_version, 0);
  rb_define_module_function(ray_mGL, "major_version=", ray_gl_set_major_version,
                            1);

  rb_define_module_function(ray_mGL, "minor_version", ray_gl_minor_version, 0);
  rb_define_module_function(ray_mGL, "minor_version=", ray_gl_set_minor_version,
                            1);

  rb_define_module_function(ray_mGL, "core_profile?", ray_gl_core_profile, 0);
  rb_define_module_function(ray_mGL, "core_profile=", ray_gl_set_core_profile,
                            1);

  rb_define_module_function(ray_mGL, "debug?", ray_gl_debug, 0);
  rb_define_module_function(ray_mGL, "debug=", ray_gl_set_debug, 1);
  /* @endgroup */


  /* @group Low-level rendering */
  rb_define_module_function(ray_mGL, "draw_arrays", ray_gl_draw_arrays, 3);
  rb_define_module_function(ray_mGL, "draw_elements", ray_gl_draw_elements, 3);

  rb_define_module_function(ray_mGL, "draw_arrays_instanced",
                            ray_gl_draw_arrays_instanced, 4);
  rb_define_module_function(ray_mGL, "draw_elements_instanced",
                            ray_gl_draw_elements_instanced, 4);

  rb_define_module_function(ray_mGL, "multi_draw_arrays",
                            ray_gl_multi_draw_arrays, 3);
  rb_define_module_function(ray_mGL, "multi_draw_elements",
                            ray_gl_multi_draw_elements, 3);
  /* @endgroup */

  rb_define_module_function(ray_mGL, "has_callback?", ray_gl_has_callback, 0);
  rb_define_module_function(ray_mGL, "callback=", ray_gl_set_callback, 1);

  rb_define_module_function(ray_mGL, "ensure_context", ray_gl_ensure_context,
                            0);
}
/*
 * Document-Class: Ray::GL
 *
 * The GL module is used to give access to low-level OpenGL features in Ray.
 */
Document-Class: Ray::GL
The GL module is used to give access to low-level OpenGL features in Ray.
Document - Class : Ray :: GL The GL module is used to give access to low - level OpenGL features in Ray .
void Init_ray_gl() {
  ray_mGL = rb_define_module_under(ray_mRay, "GL");
  ray_gl_primitives = rb_hash_new();
  rb_hash_aset(ray_gl_primitives, RAY_SYM("points"), INT2FIX(GL_POINTS));
  rb_hash_aset(ray_gl_primitives, RAY_SYM("line_strip"),
               INT2FIX(GL_LINE_STRIP));
  rb_hash_aset(ray_gl_primitives, RAY_SYM("line_loop"), INT2FIX(GL_LINE_LOOP));
  rb_hash_aset(ray_gl_primitives, RAY_SYM("lines"), INT2FIX(GL_LINES));
  rb_hash_aset(ray_gl_primitives, RAY_SYM("triangle_strip"),
               INT2FIX(GL_TRIANGLE_STRIP));
  rb_hash_aset(ray_gl_primitives, RAY_SYM("triangle_fan"),
               INT2FIX(GL_TRIANGLE_FAN));
  rb_hash_aset(ray_gl_primitives, RAY_SYM("triangles"), INT2FIX(GL_TRIANGLES));
  rb_define_const(ray_mGL, "Primitives", ray_gl_primitives);
  rb_define_module_function(ray_mGL, "depth_size", ray_gl_depth_size, 0);
  rb_define_module_function(ray_mGL, "depth_size=", ray_gl_set_depth_size, 1);
  rb_define_module_function(ray_mGL, "stencil_size", ray_gl_stencil_size, 0);
  rb_define_module_function(ray_mGL, "stencil_size=", ray_gl_set_stencil_size,
                            1);
  rb_define_module_function(ray_mGL, "major_version", ray_gl_major_version, 0);
  rb_define_module_function(ray_mGL, "major_version=", ray_gl_set_major_version,
                            1);
  rb_define_module_function(ray_mGL, "minor_version", ray_gl_minor_version, 0);
  rb_define_module_function(ray_mGL, "minor_version=", ray_gl_set_minor_version,
                            1);
  rb_define_module_function(ray_mGL, "core_profile?", ray_gl_core_profile, 0);
  rb_define_module_function(ray_mGL, "core_profile=", ray_gl_set_core_profile,
                            1);
  rb_define_module_function(ray_mGL, "debug?", ray_gl_debug, 0);
  rb_define_module_function(ray_mGL, "debug=", ray_gl_set_debug, 1);
  rb_define_module_function(ray_mGL, "draw_arrays", ray_gl_draw_arrays, 3);
  rb_define_module_function(ray_mGL, "draw_elements", ray_gl_draw_elements, 3);
  rb_define_module_function(ray_mGL, "draw_arrays_instanced",
                            ray_gl_draw_arrays_instanced, 4);
  rb_define_module_function(ray_mGL, "draw_elements_instanced",
                            ray_gl_draw_elements_instanced, 4);
  rb_define_module_function(ray_mGL, "multi_draw_arrays",
                            ray_gl_multi_draw_arrays, 3);
  rb_define_module_function(ray_mGL, "multi_draw_elements",
                            ray_gl_multi_draw_elements, 3);
  rb_define_module_function(ray_mGL, "has_callback?", ray_gl_has_callback, 0);
  rb_define_module_function(ray_mGL, "callback=", ray_gl_set_callback, 1);
  rb_define_module_function(ray_mGL, "ensure_context", ray_gl_ensure_context,
                            0);
}
void Init_ray_gl ( ) { ray_mGL = rb_define_module_under ( ray_mRay , " " ) ; ray_gl_primitives = rb_hash_new ( ) ; rb_hash_aset ( ray_gl_primitives , RAY_SYM ( " " ) , INT2FIX ( GL_POINTS ) ) ; rb_hash_aset ( ray_gl_primitives , RAY_SYM ( " " ) , INT2FIX ( GL_LINE_STRIP ) ) ; rb_hash_aset ( ray_gl_primitives , RAY_SYM ( " " ) , INT2FIX ( GL_LINE_LOOP ) ) ; rb_hash_aset ( ray_gl_primitives , RAY_SYM ( " " ) , INT2FIX ( GL_LINES ) ) ; rb_hash_aset ( ray_gl_primitives , RAY_SYM ( " " ) , INT2FIX ( GL_TRIANGLE_STRIP ) ) ; rb_hash_aset ( ray_gl_primitives , RAY_SYM ( " " ) , INT2FIX ( GL_TRIANGLE_FAN ) ) ; rb_hash_aset ( ray_gl_primitives , RAY_SYM ( " " ) , INT2FIX ( GL_TRIANGLES ) ) ; rb_define_const ( ray_mGL , " " , ray_gl_primitives ) ; rb_define_module_function ( ray_mGL , " " , ray_gl_depth_size , 0 ) ; rb_define_module_function ( ray_mGL , " " , ray_gl_set_depth_size , 1 ) ; rb_define_module_function ( ray_mGL , " " , ray_gl_stencil_size , 0 ) ; rb_define_module_function ( ray_mGL , " " , ray_gl_set_stencil_size , 1 ) ; rb_define_module_function ( ray_mGL , " " , ray_gl_major_version , 0 ) ; rb_define_module_function ( ray_mGL , " " , ray_gl_set_major_version , 1 ) ; rb_define_module_function ( ray_mGL , " " , ray_gl_minor_version , 0 ) ; rb_define_module_function ( ray_mGL , " " , ray_gl_set_minor_version , 1 ) ; rb_define_module_function ( ray_mGL , " " , ray_gl_core_profile , 0 ) ; rb_define_module_function ( ray_mGL , " " , ray_gl_set_core_profile , 1 ) ; rb_define_module_function ( ray_mGL , " " , ray_gl_debug , 0 ) ; rb_define_module_function ( ray_mGL , " " , ray_gl_set_debug , 1 ) ; rb_define_module_function ( ray_mGL , " " , ray_gl_draw_arrays , 3 ) ; rb_define_module_function ( ray_mGL , " " , ray_gl_draw_elements , 3 ) ; rb_define_module_function ( ray_mGL , " " , ray_gl_draw_arrays_instanced , 4 ) ; rb_define_module_function ( ray_mGL , " " , ray_gl_draw_elements_instanced , 4 ) ; rb_define_module_function ( ray_mGL , " " , ray_gl_multi_draw_arrays , 3 ) ; rb_define_module_function ( ray_mGL , " " , ray_gl_multi_draw_elements , 3 ) ; rb_define_module_function ( ray_mGL , " " , ray_gl_has_callback , 0 ) ; rb_define_module_function ( ray_mGL , " " , ray_gl_set_callback , 1 ) ; rb_define_module_function ( ray_mGL , " " , ray_gl_ensure_context , 0 ) ; }
Document-Class: Ray::GL
 The GL module is used to give access to low-level OpenGL features in Ray.
Document - Class : Ray :: GL The GL module is used to give access to low - level OpenGL features in Ray .
/* @return [Hash] Available primitives. */ /* @group Context configuration */ /* @endgroup */ /* @group Low-level rendering */ /* @endgroup */