rays 0.3.4 → 0.3.6
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 +4 -4
- data/.github/PULL_REQUEST_TEMPLATE.md +12 -0
- data/CONTRIBUTING.md +7 -0
- data/ChangeLog.md +13 -0
- data/README.md +45 -2
- data/VERSION +1 -1
- data/rays.gemspec +2 -2
- data/src/ios/bitmap.mm +2 -2
- data/src/ios/font.mm +7 -12
- data/src/osx/bitmap.mm +2 -2
- data/src/osx/font.mm +6 -12
- data/src/shader_source.cpp +2 -0
- metadata +12 -14
- data/src/ios/helper.h +0 -26
- data/src/ios/helper.mm +0 -25
- data/src/osx/helper.h +0 -26
- data/src/osx/helper.mm +0 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dcff3f4a96cbe344316a9ae2084009187e3364706f1fdbc8ca0d49a20edde320
|
4
|
+
data.tar.gz: 6284382f510a9b53e2092c9da68b24fde11ac3d8a05534d355b7330ded98f541
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07ea94e6601ee14cdff269202ebbd73f283ac4f3f39dd94b6ca59dfb33796108e118bd83af32d0c4ca98d277ef620189bee2accde9938e77aded3f1f9b158ba0
|
7
|
+
data.tar.gz: bdbbbe9ecddd55802899747b3c08b7fe1e9387cb09cc57bbecc3ff667793c19cc3c661f8245c58df89bed455aeee6888476a0fb2dbe35ceb4066bf7a472b432a
|
@@ -0,0 +1,12 @@
|
|
1
|
+
## Pull Requests Not Accepted 🚫
|
2
|
+
|
3
|
+
Thank you for your interest in contributing!
|
4
|
+
However, this repository does not accept pull requests directly.
|
5
|
+
|
6
|
+
### Where to Contribute?
|
7
|
+
|
8
|
+
Please submit your changes to the [xord/all](https://github.com/xord/all) monorepo, which serves as the primary repository for all our main libraries.
|
9
|
+
|
10
|
+
For more details, please refer to our [contribution guidelines](../CONTRIBUTING.md).
|
11
|
+
|
12
|
+
Thanks for your understanding! 🙌
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
# Contribution Guide
|
2
|
+
|
3
|
+
Thank you for your interest in contributing!
|
4
|
+
However, this repository does not accept pull requests.
|
5
|
+
Instead, please submit your changes to the [xord/all](https://github.com/xord/all) monorepo, which serves as the primary repository for all our main libraries.
|
6
|
+
|
7
|
+
For any questions, feel free to open an issue.
|
data/ChangeLog.md
CHANGED
@@ -1,6 +1,19 @@
|
|
1
1
|
# rays ChangeLog
|
2
2
|
|
3
3
|
|
4
|
+
## [v0.3.6] - 2025-04-08
|
5
|
+
|
6
|
+
- Update dependencies: xot, rucy
|
7
|
+
|
8
|
+
|
9
|
+
## [v0.3.5] - 2025-03-24
|
10
|
+
|
11
|
+
- Add PULL_REQUEST_TEMPLATE.md
|
12
|
+
- Add CONTRIBUTING.md
|
13
|
+
|
14
|
+
- Fix shader error on iOS
|
15
|
+
|
16
|
+
|
4
17
|
## [v0.3.4] - 2025-03-07
|
5
18
|
|
6
19
|
- Add msys2_mingw_dependencies for openal and glew
|
data/README.md
CHANGED
@@ -1,4 +1,47 @@
|
|
1
|
-
|
2
1
|
# Rays - A Drawing Engine using OpenGL.
|
3
2
|
|
4
|
-
|
3
|
+

|
4
|
+

|
5
|
+

|
6
|
+
|
7
|
+
## ⚠️ Notice
|
8
|
+
|
9
|
+
This repository is a read-only mirror of our monorepo.
|
10
|
+
We do not accept pull requests or direct contributions here.
|
11
|
+
|
12
|
+
### 🔄 Where to Contribute?
|
13
|
+
|
14
|
+
All development happens in our [xord/all](https://github.com/xord/all) monorepo, which contains all our main libraries.
|
15
|
+
If you'd like to contribute, please submit your changes there.
|
16
|
+
|
17
|
+
For more details, check out our [Contribution Guidelines](./CONTRIBUTING.md).
|
18
|
+
|
19
|
+
Thanks for your support! 🙌
|
20
|
+
|
21
|
+
## 🚀 About
|
22
|
+
|
23
|
+
**Rays** is a drawing engine that utilizes OpenGL for 2D rendering.
|
24
|
+
|
25
|
+
It is designed to provide efficient graphics capabilities, making it ideal for creating complex visualizations and graphics applications.
|
26
|
+
|
27
|
+
## 📦 Installation
|
28
|
+
|
29
|
+
Add this line to your Gemfile:
|
30
|
+
```ruby
|
31
|
+
$ gem 'rays'
|
32
|
+
```
|
33
|
+
|
34
|
+
Then, install gem:
|
35
|
+
```bash
|
36
|
+
$ bundle install
|
37
|
+
```
|
38
|
+
|
39
|
+
Or install it directly:
|
40
|
+
```bash
|
41
|
+
$ gem install rays
|
42
|
+
```
|
43
|
+
|
44
|
+
## 📜 License
|
45
|
+
|
46
|
+
**Rays** is licensed under the MIT License.
|
47
|
+
See the [LICENSE](./LICENSE) file for details.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.6
|
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.
|
29
|
-
s.add_dependency 'rucy', '~> 0.3.
|
28
|
+
s.add_dependency 'xot', '~> 0.3.6', '>= 0.3.6'
|
29
|
+
s.add_dependency 'rucy', '~> 0.3.6', '>= 0.3.6'
|
30
30
|
|
31
31
|
s.files = `git ls-files`.split $/
|
32
32
|
s.executables = s.files.grep(%r{^bin/}) {|f| File.basename f}
|
data/src/ios/bitmap.mm
CHANGED
@@ -4,12 +4,12 @@
|
|
4
4
|
|
5
5
|
#import <ImageIO/CGImageDestination.h>
|
6
6
|
#import <MobileCoreServices/UTCoreTypes.h>
|
7
|
+
#include <xot/util.h>
|
7
8
|
#include "rays/exception.h"
|
8
9
|
#include "../color_space.h"
|
9
10
|
#include "../font.h"
|
10
11
|
#include "../texture.h"
|
11
12
|
#include "../frame_buffer.h"
|
12
|
-
#include "helper.h"
|
13
13
|
|
14
14
|
|
15
15
|
namespace Rays
|
@@ -261,7 +261,7 @@ namespace Rays
|
|
261
261
|
|
262
262
|
std::shared_ptr<CGImageDestination> dest(
|
263
263
|
CGImageDestinationCreateWithURL((CFURLRef) url, type, 1, NULL),
|
264
|
-
safe_cfrelease);
|
264
|
+
Xot::safe_cfrelease);
|
265
265
|
if (!dest)
|
266
266
|
rays_error(__FILE__, __LINE__, "CGImageDestinationCreateWithURL() failed.");
|
267
267
|
|
data/src/ios/font.mm
CHANGED
@@ -5,8 +5,9 @@
|
|
5
5
|
#include <memory>
|
6
6
|
#import <CoreGraphics/CGContext.h>
|
7
7
|
#import <CoreText/CoreText.h>
|
8
|
+
#include <xot/string.h>
|
9
|
+
#include <xot/util.h>
|
8
10
|
#include "rays/exception.h"
|
9
|
-
#include "helper.h"
|
10
11
|
|
11
12
|
|
12
13
|
namespace Rays
|
@@ -66,7 +67,7 @@ namespace Rays
|
|
66
67
|
CFRelease);
|
67
68
|
|
68
69
|
CFAttributedStringPtr attrstr(
|
69
|
-
CFAttributedStringCreate(NULL, cfstring(str).get(), attr.get()),
|
70
|
+
CFAttributedStringCreate(NULL, Xot::cfstring(str).get(), attr.get()),
|
70
71
|
CFRelease);
|
71
72
|
|
72
73
|
return CTLinePtr(
|
@@ -128,7 +129,7 @@ namespace Rays
|
|
128
129
|
RawFont::RawFont (const char* name, coord size)
|
129
130
|
{
|
130
131
|
self->font = name
|
131
|
-
? CTFontCreateWithName(cfstring(name).get(), size, NULL)
|
132
|
+
? CTFontCreateWithName(Xot::cfstring(name).get(), size, NULL)
|
132
133
|
: CTFontCreateUIFontForLanguage(kCTFontSystemFontType, size, NULL);
|
133
134
|
}
|
134
135
|
|
@@ -138,7 +139,7 @@ namespace Rays
|
|
138
139
|
if (path)
|
139
140
|
*this = RawFont_load(path, size);
|
140
141
|
else
|
141
|
-
self->font = CTFontCreateWithName(cfstring(obj.name()).get(), size, NULL);
|
142
|
+
self->font = CTFontCreateWithName(Xot::cfstring(obj.name()).get(), size, NULL);
|
142
143
|
}
|
143
144
|
|
144
145
|
RawFont::~RawFont ()
|
@@ -189,14 +190,8 @@ namespace Rays
|
|
189
190
|
{
|
190
191
|
if (!*this) return "";
|
191
192
|
|
192
|
-
CFStringPtr str(CTFontCopyFullName(self->font), CFRelease);
|
193
|
-
|
194
|
-
enum {BUFSIZE = 2048};
|
195
|
-
char buf[BUFSIZE + 1];
|
196
|
-
if (!CFStringGetCString(str.get(), buf, BUFSIZE, kCFStringEncodingUTF8))
|
197
|
-
buf[0] = '\0';
|
198
|
-
|
199
|
-
return buf;
|
193
|
+
Xot::CFStringPtr str(CTFontCopyFullName(self->font), CFRelease);
|
194
|
+
return Xot::to_s(str);
|
200
195
|
}
|
201
196
|
|
202
197
|
coord
|
data/src/osx/bitmap.mm
CHANGED
@@ -3,12 +3,12 @@
|
|
3
3
|
|
4
4
|
|
5
5
|
#import <Cocoa/Cocoa.h>
|
6
|
+
#include <xot/util.h>
|
6
7
|
#include "rays/exception.h"
|
7
8
|
#include "../color_space.h"
|
8
9
|
#include "../font.h"
|
9
10
|
#include "../texture.h"
|
10
11
|
#include "../frame_buffer.h"
|
11
|
-
#include "helper.h"
|
12
12
|
|
13
13
|
|
14
14
|
namespace Rays
|
@@ -260,7 +260,7 @@ namespace Rays
|
|
260
260
|
|
261
261
|
std::shared_ptr<CGImageDestination> dest(
|
262
262
|
CGImageDestinationCreateWithURL((CFURLRef) url, type, 1, NULL),
|
263
|
-
safe_cfrelease);
|
263
|
+
Xot::safe_cfrelease);
|
264
264
|
if (!dest)
|
265
265
|
rays_error(__FILE__, __LINE__, "CGImageDestinationCreateWithURL() failed.");
|
266
266
|
|
data/src/osx/font.mm
CHANGED
@@ -5,8 +5,8 @@
|
|
5
5
|
#include <memory>
|
6
6
|
#import <ApplicationServices/ApplicationServices.h>
|
7
7
|
#import <AppKit/AppKit.h>
|
8
|
+
#include <xot/string.h>
|
8
9
|
#include "rays/exception.h"
|
9
|
-
#include "helper.h"
|
10
10
|
|
11
11
|
|
12
12
|
namespace Rays
|
@@ -66,7 +66,7 @@ namespace Rays
|
|
66
66
|
CFRelease);
|
67
67
|
|
68
68
|
CFAttributedStringPtr attrstr(
|
69
|
-
CFAttributedStringCreate(NULL, cfstring(str).get(), attr.get()),
|
69
|
+
CFAttributedStringCreate(NULL, Xot::cfstring(str).get(), attr.get()),
|
70
70
|
CFRelease);
|
71
71
|
|
72
72
|
return CTLinePtr(
|
@@ -130,7 +130,7 @@ namespace Rays
|
|
130
130
|
RawFont::RawFont (const char* name, coord size)
|
131
131
|
{
|
132
132
|
self->font = name
|
133
|
-
? CTFontCreateWithName(cfstring(name).get(), size, NULL)
|
133
|
+
? CTFontCreateWithName(Xot::cfstring(name).get(), size, NULL)
|
134
134
|
: CTFontCreateUIFontForLanguage(kCTFontUIFontSystem, size, NULL);
|
135
135
|
}
|
136
136
|
|
@@ -140,7 +140,7 @@ namespace Rays
|
|
140
140
|
if (path)
|
141
141
|
*this = RawFont_load(path, size);
|
142
142
|
else
|
143
|
-
self->font = CTFontCreateWithName(cfstring(obj.name()).get(), size, NULL);
|
143
|
+
self->font = CTFontCreateWithName(Xot::cfstring(obj.name()).get(), size, NULL);
|
144
144
|
}
|
145
145
|
|
146
146
|
RawFont::~RawFont ()
|
@@ -189,14 +189,8 @@ namespace Rays
|
|
189
189
|
{
|
190
190
|
if (!*this) return "";
|
191
191
|
|
192
|
-
CFStringPtr str(CTFontCopyFullName(self->font), CFRelease);
|
193
|
-
|
194
|
-
enum {BUFSIZE = 2048};
|
195
|
-
char buf[BUFSIZE + 1];
|
196
|
-
if (!CFStringGetCString(str.get(), buf, BUFSIZE, kCFStringEncodingUTF8))
|
197
|
-
buf[0] = '\0';
|
198
|
-
|
199
|
-
return buf;
|
192
|
+
Xot::CFStringPtr str(CTFontCopyFullName(self->font), CFRelease);
|
193
|
+
return Xot::to_s(str);
|
200
194
|
}
|
201
195
|
|
202
196
|
coord
|
data/src/shader_source.cpp
CHANGED
@@ -71,6 +71,7 @@ namespace Rays
|
|
71
71
|
}
|
72
72
|
#endif
|
73
73
|
|
74
|
+
#ifndef IOS
|
74
75
|
static const std::regex VERSION(R"(^\s*#\s*version\s+\d+)");
|
75
76
|
if (!std::regex_search(source, VERSION))
|
76
77
|
{
|
@@ -78,6 +79,7 @@ namespace Rays
|
|
78
79
|
*buffer = VERSION_HEADER + source;
|
79
80
|
source = buffer->c_str();
|
80
81
|
}
|
82
|
+
#endif
|
81
83
|
|
82
84
|
return source;
|
83
85
|
}
|
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.
|
4
|
+
version: 0.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- xordog
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: xot
|
@@ -16,40 +16,40 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.3.
|
19
|
+
version: 0.3.6
|
20
20
|
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.3.
|
22
|
+
version: 0.3.6
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - "~>"
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 0.3.
|
29
|
+
version: 0.3.6
|
30
30
|
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 0.3.
|
32
|
+
version: 0.3.6
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: rucy
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: 0.3.
|
39
|
+
version: 0.3.6
|
40
40
|
- - ">="
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: 0.3.
|
42
|
+
version: 0.3.6
|
43
43
|
type: :runtime
|
44
44
|
prerelease: false
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
47
|
- - "~>"
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: 0.3.
|
49
|
+
version: 0.3.6
|
50
50
|
- - ">="
|
51
51
|
- !ruby/object:Gem::Version
|
52
|
-
version: 0.3.
|
52
|
+
version: 0.3.6
|
53
53
|
description: This library helps you to develop graphics application with OpenGL.
|
54
54
|
email: xordog@gmail.com
|
55
55
|
executables: []
|
@@ -93,10 +93,12 @@ files:
|
|
93
93
|
- ".doc/ext/rays/rays.cpp"
|
94
94
|
- ".doc/ext/rays/shader.cpp"
|
95
95
|
- ".doc/ext/rays/util.cpp"
|
96
|
+
- ".github/PULL_REQUEST_TEMPLATE.md"
|
96
97
|
- ".github/workflows/release-gem.yml"
|
97
98
|
- ".github/workflows/tag.yml"
|
98
99
|
- ".github/workflows/test.yml"
|
99
100
|
- ".github/workflows/utils.rb"
|
101
|
+
- CONTRIBUTING.md
|
100
102
|
- ChangeLog.md
|
101
103
|
- Gemfile
|
102
104
|
- Gemfile.lock
|
@@ -198,8 +200,6 @@ files:
|
|
198
200
|
- src/ios/bitmap.mm
|
199
201
|
- src/ios/camera.mm
|
200
202
|
- src/ios/font.mm
|
201
|
-
- src/ios/helper.h
|
202
|
-
- src/ios/helper.mm
|
203
203
|
- src/ios/opengl.mm
|
204
204
|
- src/ios/rays.mm
|
205
205
|
- src/matrix.cpp
|
@@ -210,8 +210,6 @@ files:
|
|
210
210
|
- src/osx/bitmap.mm
|
211
211
|
- src/osx/camera.mm
|
212
212
|
- src/osx/font.mm
|
213
|
-
- src/osx/helper.h
|
214
|
-
- src/osx/helper.mm
|
215
213
|
- src/osx/opengl.mm
|
216
214
|
- src/osx/rays.mm
|
217
215
|
- src/painter.cpp
|
data/src/ios/helper.h
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
// -*- c++ -*-
|
2
|
-
#pragma once
|
3
|
-
#ifndef __RAYS_SRC_IOS_HELPER_H__
|
4
|
-
#define __RAYS_SRC_IOS_HELPER_H__
|
5
|
-
|
6
|
-
|
7
|
-
#include <memory>
|
8
|
-
#include <CoreFoundation/CoreFoundation.h>
|
9
|
-
|
10
|
-
|
11
|
-
namespace Rays
|
12
|
-
{
|
13
|
-
|
14
|
-
|
15
|
-
void safe_cfrelease (CFTypeRef ref);
|
16
|
-
|
17
|
-
|
18
|
-
typedef std::shared_ptr<const __CFString> CFStringPtr;
|
19
|
-
|
20
|
-
CFStringPtr cfstring (const char* str);
|
21
|
-
|
22
|
-
|
23
|
-
}// Rays
|
24
|
-
|
25
|
-
|
26
|
-
#endif//EOH
|
data/src/ios/helper.mm
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
// -*- objc -*-
|
2
|
-
#include "helper.h"
|
3
|
-
|
4
|
-
|
5
|
-
namespace Rays
|
6
|
-
{
|
7
|
-
|
8
|
-
|
9
|
-
void
|
10
|
-
safe_cfrelease (CFTypeRef ref)
|
11
|
-
{
|
12
|
-
if (ref) CFRelease(ref);
|
13
|
-
}
|
14
|
-
|
15
|
-
|
16
|
-
CFStringPtr
|
17
|
-
cfstring (const char* str)
|
18
|
-
{
|
19
|
-
CFStringRef ref = CFStringCreateWithCString(
|
20
|
-
kCFAllocatorDefault, str, kCFStringEncodingUTF8);
|
21
|
-
return CFStringPtr(ref, safe_cfrelease);
|
22
|
-
}
|
23
|
-
|
24
|
-
|
25
|
-
}// Rays
|
data/src/osx/helper.h
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
// -*- c++ -*-
|
2
|
-
#pragma once
|
3
|
-
#ifndef __RAYS_SRC_OSX_HELPER_H__
|
4
|
-
#define __RAYS_SRC_OSX_HELPER_H__
|
5
|
-
|
6
|
-
|
7
|
-
#include <memory>
|
8
|
-
#include <CoreFoundation/CoreFoundation.h>
|
9
|
-
|
10
|
-
|
11
|
-
namespace Rays
|
12
|
-
{
|
13
|
-
|
14
|
-
|
15
|
-
void safe_cfrelease (CFTypeRef ref);
|
16
|
-
|
17
|
-
|
18
|
-
typedef std::shared_ptr<const __CFString> CFStringPtr;
|
19
|
-
|
20
|
-
CFStringPtr cfstring (const char* str);
|
21
|
-
|
22
|
-
|
23
|
-
}// Rays
|
24
|
-
|
25
|
-
|
26
|
-
#endif//EOH
|
data/src/osx/helper.mm
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
// -*- objc -*-
|
2
|
-
#include "helper.h"
|
3
|
-
|
4
|
-
|
5
|
-
namespace Rays
|
6
|
-
{
|
7
|
-
|
8
|
-
|
9
|
-
void
|
10
|
-
safe_cfrelease (CFTypeRef ref)
|
11
|
-
{
|
12
|
-
if (ref) CFRelease(ref);
|
13
|
-
}
|
14
|
-
|
15
|
-
|
16
|
-
CFStringPtr
|
17
|
-
cfstring (const char* str)
|
18
|
-
{
|
19
|
-
CFStringRef ref = CFStringCreateWithCString(
|
20
|
-
kCFAllocatorDefault, str, kCFStringEncodingUTF8);
|
21
|
-
return CFStringPtr(ref, safe_cfrelease);
|
22
|
-
}
|
23
|
-
|
24
|
-
|
25
|
-
}// Rays
|