rbgl 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ed4b8652d75f87149d87fa786b7736bec5be6cdf4be1f9ec807e874f473c55ee
4
- data.tar.gz: 71e77ebb64fea763007b1ab140eceb4119e3ebec7fdca5a216c677aaa51253c1
3
+ metadata.gz: 96b938c13e30dd1d4978ab1c2d458f5014779c3bea2080dafc87d2f8afe88e3f
4
+ data.tar.gz: 8a1e9e497fe9b19c43861a6b4485f1e6771386609487b9158371216584899e94
5
5
  SHA512:
6
- metadata.gz: e208d53d00554a54cd18e9e566f952b6dbce80bf222e9a390571b8a6c1a7516042ae8cab702a1fb1b2e72d8b2fbeed283a4777a5902b3d7a515a9124904bde4e
7
- data.tar.gz: cf698a98c5c90ccaf00aa77d12da808a6ee170be8bbc8ef8bd845a7e9930ae8eda2deffc79611866ca1870f9b6018a2940ccae01324cde46726b93e8388c5aac
6
+ metadata.gz: 3dd91c74afb397226ddf187a916819eacff50f5c080ac9405a011faeb5ff06e030afe3c9c36f24d130e5980a76669b7d1cd572b4fb0aa8256d1fba921613db41
7
+ data.tar.gz: 05f04f6e458a9cffb7759deef9744a20a0fa805266731a6e6405702bb2af29b9ae2967978b300365ebee995917e122d17425b24f9575936b11ce964ad9e0b8c9
data/.codespellignore ADDED
@@ -0,0 +1,4 @@
1
+ postion
2
+ bakc
3
+ alph
4
+ lod
data/.yamllint ADDED
@@ -0,0 +1,16 @@
1
+ extends: default
2
+ ignore: |
3
+ build/
4
+ node_modules/
5
+ runtime/build/
6
+ tmp/
7
+ **/*.dSYM/**
8
+
9
+ rules:
10
+ comments:
11
+ min-spaces-from-content: 1
12
+ document-start: disable
13
+ line-length:
14
+ max: 200
15
+ truthy:
16
+ check-keys: false
data/CHANGELOG.md CHANGED
@@ -1,12 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.2 - 2026-09-26
4
+
5
+ - Reject non-finite vertex components and invalid depth buffer values before rendering.
6
+
3
7
  ## 1.0.1 - 2026-09-25
4
8
 
5
9
  - Add PNG output and frame-limited file rendering.
6
10
  - Add a non-blocking window frame step API.
7
11
  - Fixed perspective depth interpolation, shared-edge coverage, NPOT mipmaps, repeat filtering, and shader numeric edge cases.
8
- - Fixed native window resize, close, and Wayland disconnect handling, including internal size synchronization during raw event polling.
9
- - Tightened vertex layout, index, draw-range, and texture data mutation contracts, and skipped unnecessary clipping and expired frame deadlines.
12
+ - Fix native window resize, close, and Wayland disconnect handling.
13
+ - Reject invalid vertex layouts, draw ranges, and texture mutations earlier.
10
14
 
11
15
  ## 1.0.0 - 2026-04-05
12
16
 
@@ -20,7 +20,12 @@ module RBGL
20
20
  def serialize(value)
21
21
  values = extract_values(value)
22
22
  validate_value_size!(values)
23
- values.first(@size).map { |component| Float(component) }
23
+ values.first(@size).map do |component|
24
+ number = Float(component)
25
+ raise ArgumentError, "non-finite component" unless number.finite?
26
+
27
+ number
28
+ end
24
29
  rescue ArgumentError, TypeError => e
25
30
  raise ArgumentError, "Invalid value for attribute #{name}: #{e.message}"
26
31
  end
@@ -55,6 +55,7 @@ module RBGL
55
55
  def set_depth(x, y, depth)
56
56
  return if x < 0 || x >= @width || y < 0 || y >= @height
57
57
 
58
+ validate_depth!(depth)
58
59
  @depth_buffer[(y * @width) + x] = depth
59
60
  end
60
61
 
@@ -71,6 +72,7 @@ module RBGL
71
72
  end
72
73
 
73
74
  def clear(color: Larb::Color.black, depth: Float::INFINITY)
75
+ validate_depth!(depth)
74
76
  @pixels.fill(pack_color(color))
75
77
  @depth_buffer.fill(depth)
76
78
  end
@@ -80,6 +82,7 @@ module RBGL
80
82
  end
81
83
 
82
84
  def clear_depth(depth = Float::INFINITY)
85
+ validate_depth!(depth)
83
86
  @depth_buffer.fill(depth)
84
87
  end
85
88
 
@@ -113,6 +116,12 @@ module RBGL
113
116
 
114
117
  private
115
118
 
119
+ def validate_depth!(depth)
120
+ return if depth.is_a?(Numeric) && depth.real? && (depth.finite? || depth == Float::INFINITY)
121
+
122
+ raise ArgumentError, "Depth must be finite or positive infinity"
123
+ end
124
+
116
125
  def validate_dimensions!(width, height)
117
126
  return if width.is_a?(Integer) && width.positive? && height.is_a?(Integer) && height.positive?
118
127
 
data/lib/rbgl/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RBGL
4
- VERSION = "1.0.1"
4
+ VERSION = "1.0.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbgl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yudai Takada
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-09-25 00:00:00.000000000 Z
11
+ date: 2026-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: larb
@@ -47,7 +47,9 @@ executables:
47
47
  extensions: []
48
48
  extra_rdoc_files: []
49
49
  files:
50
+ - ".codespellignore"
50
51
  - ".rubocop.yml"
52
+ - ".yamllint"
51
53
  - CHANGELOG.md
52
54
  - LICENSE
53
55
  - README.md