Sha256: 4359d7d5717ef0b3012f872cee2e3781029bb8d5add62b33281b3a24e6874f57

Contents?: true

Size: 703 Bytes

Versions: 4

Compression:

Stored size: 703 Bytes

Contents

$:.unshift File.expand_path(File.dirname(__FILE__) + "/../../lib")
$:.unshift File.expand_path(File.dirname(__FILE__) + "/../../ext")

require 'ray'

Ray.game "Buffer renderer" do
  register { add_hook :quit, method(:exit!) }

  scene :many_polygons do
    @buffer = Ray::BufferRenderer.new :static, Ray::Vertex

    1000.times do
       @buffer << Ray::Polygon.circle([rand(640), rand(480)],
                                      rand(50) + 1,
                                      Ray::Color.new(rand(256), rand(256),
                                                     rand(256)))
    end

    @buffer.update

    render do |win|
      win.draw @buffer
    end
  end

  scenes << :many_polygons
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ray-0.2.1 samples/buffer/renderer.rb
ray-0.2.0 samples/buffer/renderer.rb
ray-0.1.1 samples/buffer/renderer.rb
ray-0.1.0 samples/buffer/renderer.rb