rays 0.3.14 → 0.3.15

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: 5fa20f3c4f80a73ff84e55e1fed4f8d717168754b019eab1c9f9c72eb74f7a28
4
- data.tar.gz: 370a485548263b5e7e62f5951051c895fb2fab3863630387bac590867326dac4
3
+ metadata.gz: d7db44a97618f3cd6081b111e3c923915c7a8873002be9a9b805bfa8761c209c
4
+ data.tar.gz: c92ed846754bf2ae84b557110556f912c701f9876ad407a6cad6d5b3f39125fc
5
5
  SHA512:
6
- metadata.gz: 32f5d93615ef97b87724a90017a846f386e3acb32580e14d7651d101b0fdbad5d1a33a0aff660ade35d0b6ce1fef3eacd4e8c4af8e3ea37ac6e54156ed19bb93
7
- data.tar.gz: a6602c899376aabd7daf9c0e53949dde9a7ddb0cce7cf3ff84bbac3d07629201a1c13ebf6148a0e839659e4cea0f010a440cb437de96367ac0adf4ce26e43d76
6
+ metadata.gz: 36c42ca8fec81ebe1709bdcc4d761c5702c62b98964b85c0bdb56fd24e1b9b393b9a6d1116856b041376f6da04803430dc5244ea3e6e39e316d8cc4c86e408ec
7
+ data.tar.gz: 102f8a4803066d014eceaba6b3f2bcf575c43cf5ffcd1ff0d111da2d700d36f34df29b13ff7a55775b739ca2ce5972559f37d5f3a497ab85a40474e53af6c532
data/ChangeLog.md CHANGED
@@ -1,6 +1,13 @@
1
1
  # rays ChangeLog
2
2
 
3
3
 
4
+ ## [v0.3.15] - 2026-06-12
5
+
6
+ - Share single offscreen GL context across windows
7
+ - Drop NSOpenGLPFAAccelerated/NoRecovery from offscreen pixel format for headless macOS
8
+ - Tighten Win32 window lifecycle around rebind / unbind
9
+
10
+
4
11
  ## [v0.3.14] - 2026-05-20
5
12
 
6
13
  - Skip glGetError on WASM build for performance
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.14
1
+ 0.3.15
data/rays.gemspec CHANGED
@@ -25,8 +25,8 @@ Gem::Specification.new do |s|
25
25
  s.platform = Gem::Platform::RUBY
26
26
  s.required_ruby_version = '>= 3.0.0'
27
27
 
28
- s.add_dependency 'xot', '~> 0.3.13'
29
- s.add_dependency 'rucy', '~> 0.3.13'
28
+ s.add_dependency 'xot', '~> 0.3.14'
29
+ s.add_dependency 'rucy', '~> 0.3.14'
30
30
 
31
31
  s.files = `git ls-files`.split $/
32
32
  s.executables = s.files.grep(%r{^bin/}) {|f| File.basename f}
@@ -21,7 +21,7 @@ namespace Rays
21
21
  {
22
22
  //NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core,
23
23
  //NSOpenGLPFAAccelerated, NSOpenGLPFANoRecovery,
24
- //NSOpenGLPFADoubleBuffer,
24
+ NSOpenGLPFADoubleBuffer,
25
25
  NSOpenGLPFAAllowOfflineRenderers,
26
26
  NSOpenGLPFAColorSize, 32,
27
27
  NSOpenGLPFADepthSize, 32,
@@ -93,7 +93,10 @@ namespace Rays
93
93
  Context
94
94
  get_offscreen_context ()
95
95
  {
96
- return get_opengl_offscreen_context();
96
+ const auto* c = get_opengl_offscreen_context();
97
+ if (!c) return NULL;
98
+
99
+ return (Context) c->context;
97
100
  }
98
101
 
99
102
  void
@@ -14,6 +14,20 @@ namespace Rays
14
14
  static const char* WINDOW_CLASS = "Rays:OffscreenWindow";
15
15
 
16
16
 
17
+ const PIXELFORMATDESCRIPTOR*
18
+ get_pixel_format_descriptor ()
19
+ {
20
+ static const PIXELFORMATDESCRIPTOR PFD =
21
+ {
22
+ sizeof(PIXELFORMATDESCRIPTOR), 1,
23
+ PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER,
24
+ PFD_TYPE_RGBA, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0,
25
+ PFD_MAIN_PLANE, 0, 0, 0, 0
26
+ };
27
+ return &PFD;
28
+ }
29
+
30
+
17
31
  struct OffscreenContext
18
32
  {
19
33
 
@@ -25,14 +39,6 @@ namespace Rays
25
39
 
26
40
  OffscreenContext ()
27
41
  {
28
- static const PIXELFORMATDESCRIPTOR PFD =
29
- {
30
- sizeof(PIXELFORMATDESCRIPTOR), 1,
31
- PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL,
32
- PFD_TYPE_RGBA, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0,
33
- PFD_MAIN_PLANE, 0, 0, 0, 0
34
- };
35
-
36
42
  WNDCLASS wc = {0};
37
43
  wc.lpfnWndProc = DefWindowProc;
38
44
  wc.hInstance = GetModuleHandle(NULL);
@@ -51,9 +57,10 @@ namespace Rays
51
57
  if (!hwnd)
52
58
  system_error(__FILE__, __LINE__);
53
59
 
54
- hdc = GetDC(hwnd);
55
- int pf = ChoosePixelFormat(hdc, &PFD);
56
- if (!SetPixelFormat(hdc, pf, &PFD))
60
+ hdc = GetDC(hwnd);
61
+ const auto* pfd = get_pixel_format_descriptor();
62
+ int pf = ChoosePixelFormat(hdc, pfd);
63
+ if (!SetPixelFormat(hdc, pf, pfd))
57
64
  system_error(__FILE__, __LINE__);
58
65
 
59
66
  hrc = wglCreateContext(hdc);
@@ -113,14 +120,15 @@ namespace Rays
113
120
  Context
114
121
  get_offscreen_context ()
115
122
  {
116
- return get_opengl_offscreen_context();
123
+ return (Context) get_opengl_offscreen_context()->hrc;
117
124
  }
118
125
 
119
126
  void
120
127
  activate_offscreen_context ()
121
128
  {
122
129
  const auto* c = get_opengl_offscreen_context();
123
- wglMakeCurrent(c->hdc, c->hrc);
130
+ if (!wglMakeCurrent(c->hdc, c->hrc))
131
+ system_error(__FILE__, __LINE__);
124
132
  }
125
133
 
126
134
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rays
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.14
4
+ version: 0.3.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - xordog
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-05-20 00:00:00.000000000 Z
11
+ date: 2026-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xot
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.3.13
19
+ version: 0.3.14
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.3.13
26
+ version: 0.3.14
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rucy
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.3.13
33
+ version: 0.3.14
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.3.13
40
+ version: 0.3.14
41
41
  description: This library helps you to develop graphics application with OpenGL.
42
42
  email: xordog@gmail.com
43
43
  executables: []