Class: Mittsu::RenderTarget
- Includes:
- EventDispatcher
- Defined in:
- lib/mittsu/textures/render_target.rb
Direct Known Subclasses
Constant Summary
Constants inherited from Texture
Texture::DEFAULT_IMAGE, Texture::DEFAULT_MAPPING
Instance Attribute Summary collapse
-
#anisotropy ⇒ Object
Returns the value of attribute anisotropy.
-
#depth_buffer ⇒ Object
Returns the value of attribute depth_buffer.
-
#format ⇒ Object
Returns the value of attribute format.
-
#framebuffer ⇒ Object
readonly
Returns the value of attribute framebuffer.
-
#generate_mipmaps ⇒ Object
Returns the value of attribute generate_mipmaps.
-
#height ⇒ Object
Returns the value of attribute height.
-
#mag_filter ⇒ Object
Returns the value of attribute mag_filter.
-
#min_filter ⇒ Object
Returns the value of attribute min_filter.
-
#offset ⇒ Object
Returns the value of attribute offset.
-
#renderer ⇒ Object
writeonly
Sets the attribute renderer.
-
#repeat ⇒ Object
Returns the value of attribute repeat.
-
#share_depth_from ⇒ Object
Returns the value of attribute share_depth_from.
-
#stencil_buffer ⇒ Object
Returns the value of attribute stencil_buffer.
-
#type ⇒ Object
Returns the value of attribute type.
-
#width ⇒ Object
Returns the value of attribute width.
-
#wrap_s ⇒ Object
Returns the value of attribute wrap_s.
-
#wrap_t ⇒ Object
Returns the value of attribute wrap_t.
Attributes inherited from Texture
#filp_y, #id, #image, #mapping, #mipmaps, #name, #on_update, #premultiply_alpha, #source_file, #unpack_alignment, #uuid
Instance Method Summary collapse
- #clone ⇒ Object
- #dispose ⇒ Object
-
#initialize(width, height, options = {}) ⇒ RenderTarget
constructor
A new instance of RenderTarget.
- #needs_update? ⇒ Boolean
- #set_size(width, height) ⇒ Object
Methods included from EventDispatcher
#add_event_listener, #dispatch_event, #has_event_listener, #remove_event_listener
Methods inherited from Texture
Constructor Details
#initialize(width, height, options = {}) ⇒ RenderTarget
Returns a new instance of RenderTarget.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/mittsu/textures/render_target.rb', line 25 def initialize(width, height, = {}) super(self, nil) @width = width @height = height @wrap_s = .fetch(:wrap_s, ClampToEdgeWrapping) @wrap_t = .fetch(:wrap_t, ClampToEdgeWrapping) @mag_filter = .fetch(:mag_filter, LinearFilter) @min_filter = .fetch(:min_filter, LinearMipMapLinearFilter) @anisotropy = .fetch(:anisotropy, 1.0); @offset = Vector2.new(0.0, 0.0) @repeat = Vector2.new(1.0, 1.0) @format = .fetch(:format, RGBAFormat) @type = .fetch(:type, UnsignedByteType) @depth_buffer = .fetch(:depth_buffer, true) @stencil_buffer = .fetch(:stencil_buffer, true) @generate_mipmaps = true @share_depth_from = .fetch(:share_depth_from, nil) end |
Instance Attribute Details
#anisotropy ⇒ Object
Returns the value of attribute anisotropy.
5 6 7 |
# File 'lib/mittsu/textures/render_target.rb', line 5 def anisotropy @anisotropy end |
#depth_buffer ⇒ Object
Returns the value of attribute depth_buffer.
5 6 7 |
# File 'lib/mittsu/textures/render_target.rb', line 5 def depth_buffer @depth_buffer end |
#format ⇒ Object
Returns the value of attribute format.
5 6 7 |
# File 'lib/mittsu/textures/render_target.rb', line 5 def format @format end |
#framebuffer ⇒ Object (readonly)
Returns the value of attribute framebuffer.
21 22 23 |
# File 'lib/mittsu/textures/render_target.rb', line 21 def framebuffer @framebuffer end |
#generate_mipmaps ⇒ Object
Returns the value of attribute generate_mipmaps.
5 6 7 |
# File 'lib/mittsu/textures/render_target.rb', line 5 def generate_mipmaps @generate_mipmaps end |
#height ⇒ Object
Returns the value of attribute height.
5 6 7 |
# File 'lib/mittsu/textures/render_target.rb', line 5 def height @height end |
#mag_filter ⇒ Object
Returns the value of attribute mag_filter.
5 6 7 |
# File 'lib/mittsu/textures/render_target.rb', line 5 def mag_filter @mag_filter end |
#min_filter ⇒ Object
Returns the value of attribute min_filter.
5 6 7 |
# File 'lib/mittsu/textures/render_target.rb', line 5 def min_filter @min_filter end |
#offset ⇒ Object
Returns the value of attribute offset.
5 6 7 |
# File 'lib/mittsu/textures/render_target.rb', line 5 def offset @offset end |
#renderer=(value) ⇒ Object (writeonly)
Sets the attribute renderer
23 24 25 |
# File 'lib/mittsu/textures/render_target.rb', line 23 def renderer=(value) @renderer = value end |
#repeat ⇒ Object
Returns the value of attribute repeat.
5 6 7 |
# File 'lib/mittsu/textures/render_target.rb', line 5 def repeat @repeat end |
#share_depth_from ⇒ Object
Returns the value of attribute share_depth_from.
5 6 7 |
# File 'lib/mittsu/textures/render_target.rb', line 5 def share_depth_from @share_depth_from end |
#stencil_buffer ⇒ Object
Returns the value of attribute stencil_buffer.
5 6 7 |
# File 'lib/mittsu/textures/render_target.rb', line 5 def stencil_buffer @stencil_buffer end |
#type ⇒ Object
Returns the value of attribute type.
5 6 7 |
# File 'lib/mittsu/textures/render_target.rb', line 5 def type @type end |
#width ⇒ Object
Returns the value of attribute width.
5 6 7 |
# File 'lib/mittsu/textures/render_target.rb', line 5 def width @width end |
#wrap_s ⇒ Object
Returns the value of attribute wrap_s.
5 6 7 |
# File 'lib/mittsu/textures/render_target.rb', line 5 def wrap_s @wrap_s end |
#wrap_t ⇒ Object
Returns the value of attribute wrap_t.
5 6 7 |
# File 'lib/mittsu/textures/render_target.rb', line 5 def wrap_t @wrap_t end |
Instance Method Details
#clone ⇒ Object
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/mittsu/textures/render_target.rb', line 62 def clone RenderTarget.new(@width, @height).tap do |tmp| tmp.renderer = @renderer tmp.wrap_s = @wrap_s tmp.wrap_t = @wrap_t tmp.mag_filter = @mag_filter tmp.min_filter = @min_filter tmp.anisotropy = @anisotropy tmp.offset.copy(@offset) tmp.repeat.copy(@repeat) tmp.format = @format tmp.type = @type tmp.depth_buffer = @depth_buffer tmp.stencil_buffer = @stencil_buffer tmp.generate_mipmaps = @generate_mipmaps tmp.share_depth_from = @share_depth_from end end |
#dispose ⇒ Object
89 90 91 |
# File 'lib/mittsu/textures/render_target.rb', line 89 def dispose dispatch_event(type: :dispose) end |
#needs_update? ⇒ Boolean
58 59 60 |
# File 'lib/mittsu/textures/render_target.rb', line 58 def needs_update? false end |
#set_size(width, height) ⇒ Object
53 54 55 56 |
# File 'lib/mittsu/textures/render_target.rb', line 53 def set_size(width, height) @width = width @height = height end |