Sha256: 01f8218d76caedb634597f1ece91acd264e31ea18d59c58599a18507307180cf

Contents?: true

Size: 387 Bytes

Versions: 7

Compression:

Stored size: 387 Bytes

Contents

module Ashton
  # A texture that is the same size as the Gosu::Window.
  class WindowBuffer < Texture
    def initialize
      super $window.width, $window.height
    end

    public
    # Copy the window contents into the buffer.
    def capture
      glBindTexture GL_TEXTURE_2D, id
      glCopyTexImage2D GL_TEXTURE_2D, 0, GL_RGBA8, 0, 0, width, height, 0
      self
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ashton-0.1.3 lib/ashton/window_buffer.rb
ashton-0.1.2 lib/ashton/window_buffer.rb
ashton-0.1.1 lib/ashton/window_buffer.rb
ashton-0.1.0 lib/ashton/window_buffer.rb
ashton-0.0.4alpha lib/ashton/window_buffer.rb
ashton-0.0.3alpha lib/ashton/window_buffer.rb
ashton-0.0.2alpha lib/ashton/window_buffer.rb