Class: Mittsu::OpenGLDefaultTarget
- Inherits:
-
Object
- Object
- Mittsu::OpenGLDefaultTarget
- Defined in:
- lib/mittsu/renderers/opengl/opengl_default_target.rb
Instance Attribute Summary collapse
-
#viewport_height ⇒ Object
(also: #height)
Returns the value of attribute viewport_height.
-
#viewport_width ⇒ Object
(also: #width)
Returns the value of attribute viewport_width.
-
#viewport_x ⇒ Object
Returns the value of attribute viewport_x.
-
#viewport_y ⇒ Object
Returns the value of attribute viewport_y.
Instance Method Summary collapse
- #framebuffer ⇒ Object
-
#initialize(renderer) ⇒ OpenGLDefaultTarget
constructor
A new instance of OpenGLDefaultTarget.
- #set_and_use_viewport(x, y, width, height) ⇒ Object
- #set_viewport(x, y, width, height) ⇒ Object
- #set_viewport_size(width, height) ⇒ Object
- #setup_buffers ⇒ Object
- #update_mipmap ⇒ Object
- #use ⇒ Object
- #use_viewport ⇒ Object
Constructor Details
#initialize(renderer) ⇒ OpenGLDefaultTarget
Returns a new instance of OpenGLDefaultTarget.
7 8 9 10 11 12 13 |
# File 'lib/mittsu/renderers/opengl/opengl_default_target.rb', line 7 def initialize renderer @renderer = renderer @viewport_width = 0 @viewport_height = 0 @viewport_x = 0 @viewport_y = 0 end |
Instance Attribute Details
#viewport_height ⇒ Object Also known as: height
Returns the value of attribute viewport_height.
3 4 5 |
# File 'lib/mittsu/renderers/opengl/opengl_default_target.rb', line 3 def @viewport_height end |
#viewport_width ⇒ Object Also known as: width
Returns the value of attribute viewport_width.
3 4 5 |
# File 'lib/mittsu/renderers/opengl/opengl_default_target.rb', line 3 def @viewport_width end |
#viewport_x ⇒ Object
Returns the value of attribute viewport_x.
3 4 5 |
# File 'lib/mittsu/renderers/opengl/opengl_default_target.rb', line 3 def @viewport_x end |
#viewport_y ⇒ Object
Returns the value of attribute viewport_y.
3 4 5 |
# File 'lib/mittsu/renderers/opengl/opengl_default_target.rb', line 3 def @viewport_y end |
Instance Method Details
#framebuffer ⇒ Object
15 16 17 |
# File 'lib/mittsu/renderers/opengl/opengl_default_target.rb', line 15 def framebuffer 0 end |
#set_and_use_viewport(x, y, width, height) ⇒ Object
36 37 38 39 |
# File 'lib/mittsu/renderers/opengl/opengl_default_target.rb', line 36 def (x, y, width, height) (x, y, width, height) end |
#set_viewport(x, y, width, height) ⇒ Object
41 42 43 44 |
# File 'lib/mittsu/renderers/opengl/opengl_default_target.rb', line 41 def (x, y, width, height) @viewport_x, @viewport_y = x, y (width, height) end |
#set_viewport_size(width, height) ⇒ Object
46 47 48 |
# File 'lib/mittsu/renderers/opengl/opengl_default_target.rb', line 46 def (width, height) @viewport_width, @viewport_height = width, height end |
#setup_buffers ⇒ Object
23 24 25 |
# File 'lib/mittsu/renderers/opengl/opengl_default_target.rb', line 23 def setup_buffers # NOOP end |
#update_mipmap ⇒ Object
19 20 21 |
# File 'lib/mittsu/renderers/opengl/opengl_default_target.rb', line 19 def update_mipmap # NOOP end |
#use ⇒ Object
27 28 29 30 |
# File 'lib/mittsu/renderers/opengl/opengl_default_target.rb', line 27 def use glBindFramebuffer(GL_FRAMEBUFFER, 0) end |
#use_viewport ⇒ Object
32 33 34 |
# File 'lib/mittsu/renderers/opengl/opengl_default_target.rb', line 32 def glViewport(@viewport_x, @viewport_y, @viewport_width, @viewport_height) end |