rubysketch 0.3.21 → 0.3.22

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: acfaff485263c8e6557c8610df2a4643e53d1046e55cf813c79b648492e84d52
4
- data.tar.gz: d7beb5170988d554771d50d5a726b1f51c961cded8a3cf3370dc55ccc91059fb
3
+ metadata.gz: 37319632030509f708c8ee98cbb6e4d8512b50ad7475cae37d595e3649a81c26
4
+ data.tar.gz: c61938eefd83489171e8eff04721dfd08edcbae0ecb8472b34c58d1c09afc92a
5
5
  SHA512:
6
- metadata.gz: 95ce0e61b8db2f0046bfd43070dd9d10f24b48f7838b267509b98e9a4b6930aa8958c065ae7af253c3877c754a5187ce970b80722421c32e6fbb9de4d1ebc05a
7
- data.tar.gz: a810edf5f210a8a505fc3830697a46a76a743860a90118d1de38e99192d0cf43639dd5410409baf040c4b6feb0275a90d2cb330230b7457890d8555b9f257d5e
6
+ metadata.gz: e37b6b72fd7d3960434d47b302aec206332e85476a7e2cde3d4f56fd8b8946de685c27fc39d06094ddb0203141ba8282a2b521281218dd25970fceb18e80a83f
7
+ data.tar.gz: 9c65761f2df604c2c79b30ccc5c6b23403d7aae5f2ea6858b62979b825d66ef1d54a9106ad37b4dfd5902697a91bd47c0c034e6fd21c93fe1593a58642fb20eb
data/ChangeLog.md CHANGED
@@ -1,7 +1,21 @@
1
1
  # RubySketch ChangeLog
2
2
 
3
3
 
4
- ## [0.3.21] - 2022-x-x
4
+ ## [0.3.22] - 2022-11-14
5
+
6
+ RubySketch::Processing
7
+ - add Shader class
8
+ - add shader(), resetShader(), createShader(), loadShader(), and filter()
9
+ - update the pixel density of context if the screen pixel density is changed
10
+ - setUniform() can also take array of numbers, vector, and texture image.
11
+ - pushStyle() manages states of textAlign, tint, and filter
12
+ - push/pushMatrix/pushStyle call pop() on ensure
13
+
14
+ RubySketch::GLSL
15
+ - displays with pixel density 1.0
16
+
17
+
18
+ ## [0.3.21] - 2022-09-05
5
19
 
6
20
  - add rubysketch-glsl.rb
7
21
  - add blend(), createImage(), setTitle(), tint() and noTint()
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.21
1
+ 0.3.22
@@ -10,11 +10,17 @@ module RubySketch
10
10
  class Context
11
11
 
12
12
  # @private
13
- def initialize(window, shader_source)
14
- shader = Rays::Shader.new shader_source
13
+ def initialize(window)
14
+ @window = window
15
+ @window.__send__ :resize_canvas, window.width, window.height, 1
16
+ end
17
+
18
+ def run(shader_source)
19
+ shader = Rays::Shader.new(
20
+ shader_source, ignore_no_uniform_location_error: true)
15
21
  start = now__
16
- window.draw = proc do |e|
17
- i, p = window.canvas_image, window.canvas_painter
22
+ @window.draw = proc do |e|
23
+ i, p = @window.canvas_image, @window.canvas_painter
18
24
  w, h = i.width, i.height
19
25
  p.shader shader, resolution: [w, h], time: now__ - start
20
26
  p.fill 1