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 +4 -4
- data/ChangeLog.md +15 -1
- data/VERSION +1 -1
- data/lib/rubysketch/glsl.rb +10 -4
- data/lib/rubysketch/processing.rb +983 -702
- data/lib/rubysketch/window.rb +91 -64
- data/lib/rubysketch-glsl.rb +2 -1
- data/rubysketch.gemspec +1 -1
- data/test/processing/helper.rb +11 -0
- data/test/processing/test_graphics.rb +21 -0
- data/test/processing/test_shader.rb +47 -0
- data/test/processing/test_utility.rb +20 -13
- data/test/processing/test_vector.rb +1 -1
- metadata +10 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37319632030509f708c8ee98cbb6e4d8512b50ad7475cae37d595e3649a81c26
|
4
|
+
data.tar.gz: c61938eefd83489171e8eff04721dfd08edcbae0ecb8472b34c58d1c09afc92a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|
1
|
+
0.3.22
|
data/lib/rubysketch/glsl.rb
CHANGED
@@ -10,11 +10,17 @@ module RubySketch
|
|
10
10
|
class Context
|
11
11
|
|
12
12
|
# @private
|
13
|
-
def initialize(window
|
14
|
-
|
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
|