Sha256: d80e4715f7e8ac4b21f4a5183e0ef4f8e379eb29bfb6ae823116e0f3e94bee52

Contents?: true

Size: 691 Bytes

Versions: 43

Compression:

Stored size: 691 Bytes

Contents

include_theme("default")

proc_name = "gl-sample"

match(Slide) do |slides|

  slides.delete_post_draw_proc_by_name(proc_name)
  
  list_id = nil

  slides.each do |slide|
    break if not(slide.body.empty? and slide.headline.text == "GL")

    head = slide.headline
    head.add_post_draw_proc(proc_name) do |canvas, x, y, w, h, simulation|
      list_id ||= canvas.new_list_id
      if simulation
        canvas.gl_compile(list_id) do
          qobj = GLU.NewQuadric
          GLU.Sphere(qobj, 1.0, 50, 20)
        end
      else
        canvas.gl_call_list(list_id, x, y, 0, "blue")
        canvas.draw_teapot(true, w - x, y, 0, 1.0, "red")
      end
      [x, y, w, h]
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
rabbit-3.0.3 sample/rabbit/theme/gl-sample/gl-sample.rb
rabbit-3.0.2 sample/rabbit/theme/gl-sample/gl-sample.rb
rabbit-3.0.1 sample/rabbit/theme/gl-sample/gl-sample.rb
rabbit-3.0.0 sample/rabbit/theme/gl-sample/gl-sample.rb
rabbit-2.2.1 sample/rabbit/theme/gl-sample/gl-sample.rb
rabbit-2.2.0 sample/rabbit/theme/gl-sample/gl-sample.rb
rabbit-2.1.9 sample/rabbit/theme/gl-sample/gl-sample.rb
rabbit-2.1.8 sample/rabbit/theme/gl-sample/gl-sample.rb
rabbit-2.1.7 sample/rabbit/theme/gl-sample/gl-sample.rb
rabbit-2.1.6 sample/rabbit/theme/gl-sample/gl-sample.rb
rabbit-2.1.5 sample/rabbit/theme/gl-sample/gl-sample.rb
rabbit-2.1.4 sample/rabbit/theme/gl-sample/gl-sample.rb
rabbit-2.1.3 sample/rabbit/theme/gl-sample/gl-sample.rb
rabbit-2.1.2 sample/rabbit/theme/gl-sample/gl-sample.rb
rabbit-2.1.1 sample/rabbit/theme/gl-sample/gl-sample.rb
rabbit-2.1.0 sample/rabbit/theme/gl-sample/gl-sample.rb
rabbit-2.0.9 sample/rabbit/theme/gl-sample/gl-sample.rb
rabbit-2.0.8 sample/rabbit/theme/gl-sample/gl-sample.rb
rabbit-2.0.7 sample/rabbit/theme/gl-sample/gl-sample.rb
rabbit-2.0.6 sample/rabbit/theme/gl-sample/gl-sample.rb