Sha256: c0586d894c612dbffb7ecbdc9a7d3b149db3c23040180a5424369128a60263e6

Contents?: true

Size: 419 Bytes

Versions: 10

Compression:

Stored size: 419 Bytes

Contents

attr_reader :cube

def setup
  size(400, 400, P3D)
  smooth
  @cube = create_shape(BOX, 100)
end

def draw
  background(120)    
  lights    
  translate(mouse_x, mouse_y)
  rotate_x(frame_count * 0.01)
  rotate_y(frame_count * 0.01)    
  shape(cube)    
end

def key_pressed
  # Changing the smooth configuration restarts the OpenGL surface. 
  # Automatically recreates all the current GL resources.
  no_smooth
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ruby-processing-2.6.3 samples/processing_app/demos/tests/restart_test.rb
ruby-processing-2.6.2 samples/processing_app/demos/tests/restart_test.rb
ruby-processing-2.6.1 samples/processing_app/demos/tests/restart_test.rb
ruby-processing-2.6.0 samples/processing_app/demos/tests/restart_test.rb
ruby-processing-2.5.1 samples/processing_app/demos/tests/restart_test.rb
ruby-processing-2.5.0 samples/processing_app/demos/tests/restart_test.rb
ruby-processing-2.4.4 samples/processing_app/demos/tests/restart_test.rb
ruby-processing-2.4.3 samples/processing_app/demos/tests/restart_test.rb
ruby-processing-2.4.2 samples/processing_app/demos/tests/restart_test.rb
ruby-processing-2.4.1 samples/processing_app/demos/tests/restart_test.rb