Class: Gosu::DrawOpQueue
- Inherits:
-
Object
- Object
- Gosu::DrawOpQueue
- Defined in:
- lib/gosu_android/graphics/drawOpQueue.rb
Instance Attribute Summary collapse
-
#op_pool ⇒ Object
readonly
Returns the value of attribute op_pool.
Instance Method Summary collapse
- #clear_queue ⇒ Object
- #gl=(gl) ⇒ Object
-
#initialize(gl) ⇒ DrawOpQueue
constructor
A new instance of DrawOpQueue.
- #perform_draw_ops_and_code ⇒ Object
- #schedule_draw_op(op) ⇒ Object
Constructor Details
#initialize(gl) ⇒ DrawOpQueue
Returns a new instance of DrawOpQueue.
6 7 8 9 10 |
# File 'lib/gosu_android/graphics/drawOpQueue.rb', line 6 def initialize(gl) @ops = [] @gl = gl @op_pool = DrawOpPool.new(@gl, 50) end |
Instance Attribute Details
#op_pool ⇒ Object (readonly)
Returns the value of attribute op_pool.
5 6 7 |
# File 'lib/gosu_android/graphics/drawOpQueue.rb', line 5 def op_pool @op_pool end |
Instance Method Details
#clear_queue ⇒ Object
33 34 35 36 |
# File 'lib/gosu_android/graphics/drawOpQueue.rb', line 33 def clear_queue @ops.clear @op_pool.clearPool end |
#gl=(gl) ⇒ Object
12 13 14 |
# File 'lib/gosu_android/graphics/drawOpQueue.rb', line 12 def gl= gl @gl = gl end |
#perform_draw_ops_and_code ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/gosu_android/graphics/drawOpQueue.rb', line 21 def perform_draw_ops_and_code #Sort by z @ops.sort! manager = RenderStateManager.new(@gl) @ops.each do |op| manager.render_state = op.render_state op.perform(nil) if op.vertices_or_block_index >= 0 end @op_pool.clearPool end |
#schedule_draw_op(op) ⇒ Object
16 17 18 19 |
# File 'lib/gosu_android/graphics/drawOpQueue.rb', line 16 def schedule_draw_op(op) #TODO Should do more stuff, check original code @ops.push op end |