Sha256: 05ab7edb6ae9dd7621160fab047d06bbc8ffbb4c3075aa95efb795cbb06b2d94

Contents?: true

Size: 615 Bytes

Versions: 6

Compression:

Stored size: 615 Bytes

Contents

module Processing


  # Draws graphics into an offscreen buffer
  #
  class Graphics

    include GraphicsContext

    # Initialize graphics object.
    #
    def initialize(width, height)
      image = Rays::Image.new width, height
      init__ image, image.painter
    end

    # Start drawing.
    #
    def beginDraw(&block)
      beginDraw__
      @painter__.__send__ :begin_paint
      push
      if block
        block.call
        endDraw
      end
    end

    # End drawing.
    #
    def endDraw()
      pop
      @painter__.__send__ :end_paint
      endDraw__
    end

  end# Graphics


end# Processing

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
processing-0.5.5 lib/processing/graphics.rb
processing-0.5.4 lib/processing/graphics.rb
processing-0.5.3 lib/processing/graphics.rb
processing-0.5.2 lib/processing/graphics.rb
processing-0.5.1 lib/processing/graphics.rb
processing-0.5.0 lib/processing/graphics.rb