sfml.js 1.0.0 → 1.2.1

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.
Files changed (313) hide show
  1. package/README.ja.md +10 -9
  2. package/README.ko.md +10 -9
  3. package/README.md +10 -9
  4. package/README.zh-CN.md +10 -9
  5. package/binding.gyp +23 -16
  6. package/dist/audio/effect-processor.js +9 -3
  7. package/dist/audio/input-sound-file.js +41 -15
  8. package/dist/audio/listener.js +33 -11
  9. package/dist/audio/music.js +41 -18
  10. package/dist/audio/output-sound-file.js +4 -2
  11. package/dist/audio/playback-device.js +11 -3
  12. package/dist/audio/sound-buffer-recorder.js +8 -5
  13. package/dist/audio/sound-buffer.js +40 -17
  14. package/dist/audio/sound-file-factory.js +21 -9
  15. package/dist/audio/sound-file-reader.js +21 -7
  16. package/dist/audio/sound-recorder.js +36 -15
  17. package/dist/audio/sound-source.js +117 -40
  18. package/dist/audio/sound-stream.js +14 -5
  19. package/dist/audio/sound.js +9 -4
  20. package/dist/audio/value.js +42 -16
  21. package/dist/graphics/blend-mode.js +2 -1
  22. package/dist/graphics/boolean-vector.d.ts +1 -2
  23. package/dist/graphics/boolean-vector.js +19 -9
  24. package/dist/graphics/color.js +2 -1
  25. package/dist/graphics/convex-shape.js +7 -3
  26. package/dist/graphics/font.js +52 -23
  27. package/dist/graphics/glsl-matrix.js +8 -3
  28. package/dist/graphics/glsl.js +47 -16
  29. package/dist/graphics/glyph.js +27 -10
  30. package/dist/graphics/image.js +30 -14
  31. package/dist/graphics/rect.js +15 -8
  32. package/dist/graphics/render-states.js +18 -9
  33. package/dist/graphics/render-target.js +49 -23
  34. package/dist/graphics/render-texture.js +24 -12
  35. package/dist/graphics/render-window.js +6 -3
  36. package/dist/graphics/shader.js +67 -32
  37. package/dist/graphics/shape.js +25 -13
  38. package/dist/graphics/sprite.js +19 -9
  39. package/dist/graphics/stencil-mode.js +10 -6
  40. package/dist/graphics/swap.js +2 -1
  41. package/dist/graphics/text.js +123 -48
  42. package/dist/graphics/texture.js +48 -24
  43. package/dist/graphics/transform.js +29 -13
  44. package/dist/graphics/transformable.js +2 -1
  45. package/dist/graphics/vertex-array.js +40 -18
  46. package/dist/graphics/vertex-buffer.js +39 -19
  47. package/dist/graphics/vertex.js +6 -3
  48. package/dist/graphics/view.js +30 -14
  49. package/dist/index.d.ts +4 -4
  50. package/dist/internal/audio-codec-registry.js +12 -6
  51. package/dist/internal/audio-input-stream.js +2 -1
  52. package/dist/internal/audio-music-pump.js +58 -24
  53. package/dist/internal/audio-recorder-session.js +17 -7
  54. package/dist/internal/audio-worker-session.js +28 -10
  55. package/dist/internal/audio-worker.js +40 -21
  56. package/dist/internal/glsl-value.d.ts +3 -1
  57. package/dist/internal/glsl-value.js +18 -8
  58. package/dist/internal/graphics-state.js +29 -15
  59. package/dist/internal/input-stream.d.ts +3 -1
  60. package/dist/internal/input-stream.js +16 -7
  61. package/dist/internal/numeric-properties.js +2 -1
  62. package/dist/internal/render-states.js +2 -1
  63. package/dist/internal/scalar.js +22 -13
  64. package/dist/internal/shaped-glyph.d.ts +3 -1
  65. package/dist/internal/shaped-glyph.js +12 -4
  66. package/dist/internal/struct-view.d.ts +3 -1
  67. package/dist/internal/struct-view.js +3 -1
  68. package/dist/internal/transformable.js +2 -1
  69. package/dist/network/common.js +23 -11
  70. package/dist/network/dns.js +25 -17
  71. package/dist/network/ftp.js +43 -18
  72. package/dist/network/http.js +126 -56
  73. package/dist/network/ip-address.js +50 -25
  74. package/dist/network/packet.js +63 -25
  75. package/dist/network/sftp.js +175 -74
  76. package/dist/network/socket-selector.js +28 -14
  77. package/dist/network/socket.js +71 -30
  78. package/dist/network/tcp-listener.js +42 -19
  79. package/dist/network/tcp-socket.js +111 -53
  80. package/dist/network/tls-material.js +2 -1
  81. package/dist/network/udp-socket.js +68 -33
  82. package/dist/system/angle.js +2 -1
  83. package/dist/system/clock.js +4 -2
  84. package/dist/system/err.js +5 -2
  85. package/dist/system/file-input-stream.js +8 -4
  86. package/dist/system/input-stream.js +6 -3
  87. package/dist/system/operators.d.ts +1 -1
  88. package/dist/system/operators.js +90 -50
  89. package/dist/system/sleep.js +4 -2
  90. package/dist/system/time.js +12 -6
  91. package/dist/system/vector2.js +6 -7
  92. package/dist/system/vector3.js +11 -6
  93. package/dist/window/clipboard.js +2 -1
  94. package/dist/window/context.js +10 -5
  95. package/dist/window/cursor.js +2 -1
  96. package/dist/window/event.js +9 -5
  97. package/dist/window/mouse.js +4 -2
  98. package/dist/window/video-mode.js +2 -1
  99. package/dist/window/window.js +19 -12
  100. package/native/addon.cc +25 -12
  101. package/native/audio-binding.cc +266 -126
  102. package/native/audio-codec-binding.cc +147 -77
  103. package/native/audio-device-binding.cc +76 -49
  104. package/native/audio-file-binding.cc +116 -67
  105. package/native/audio-recorder-binding.cc +147 -98
  106. package/native/audio-recorder.h +1 -1
  107. package/native/audio-state.h +53 -30
  108. package/native/audio-stream-binding.cc +148 -94
  109. package/native/audio-stream.h +5 -4
  110. package/native/audio-worker-binding.cc +163 -81
  111. package/native/audio-worker.h +35 -19
  112. package/native/batch-drawable.cc +29 -16
  113. package/native/batch-drawable.h +11 -8
  114. package/native/context-binding.cc +40 -27
  115. package/native/context-settings.h +15 -8
  116. package/native/deferred-delete.cc +9 -6
  117. package/native/deferred-delete.h +7 -8
  118. package/native/error-stream-binding.cc +42 -28
  119. package/native/font-binding.cc +89 -48
  120. package/native/graphics-binding.cc +122 -72
  121. package/native/graphics-state.h +50 -36
  122. package/native/image-binding.cc +38 -24
  123. package/native/image-state.h +26 -18
  124. package/native/input-binding.cc +42 -27
  125. package/native/render-window-binding.cc +38 -23
  126. package/native/shader-binding.cc +115 -50
  127. package/native/shape-binding.cc +94 -49
  128. package/native/shape-state.h +18 -9
  129. package/native/shaped-glyph-storage.h +9 -5
  130. package/native/stream-binding.cc +143 -117
  131. package/native/system-binding.cc +17 -12
  132. package/native/text-binding.cc +68 -35
  133. package/native/text-state.h +25 -18
  134. package/native/texture-binding.cc +42 -33
  135. package/native/texture-resource.h +20 -12
  136. package/native/time-value.h +3 -1
  137. package/native/transformable-binding.cc +12 -6
  138. package/native/transformable-state.h +6 -6
  139. package/native/value-binding.h +46 -28
  140. package/native/value-layout.h +10 -10
  141. package/native/values-binding.cc +29 -23
  142. package/native/vertex-binding.cc +18 -12
  143. package/native/vertex-buffer-binding.cc +38 -24
  144. package/native/vertex-storage.h +2 -2
  145. package/native/view-data.h +4 -3
  146. package/native/window-binding.cc +75 -45
  147. package/native/window-event.h +20 -11
  148. package/native/window-owner.h +15 -12
  149. package/package.json +44 -51
  150. package/src/audio/effect-processor.ts +9 -3
  151. package/src/audio/input-sound-file.ts +108 -36
  152. package/src/audio/listener.ts +39 -13
  153. package/src/audio/music.ts +112 -47
  154. package/src/audio/output-sound-file.ts +40 -11
  155. package/src/audio/playback-device.ts +23 -8
  156. package/src/audio/sound-buffer-recorder.ts +35 -13
  157. package/src/audio/sound-buffer.ts +166 -58
  158. package/src/audio/sound-file-factory.ts +127 -49
  159. package/src/audio/sound-file-reader.ts +49 -15
  160. package/src/audio/sound-recorder.ts +100 -34
  161. package/src/audio/sound-source.ts +142 -45
  162. package/src/audio/sound-stream.ts +15 -5
  163. package/src/audio/sound.ts +12 -4
  164. package/src/audio/value.ts +89 -26
  165. package/src/graphics/blend-mode.ts +3 -1
  166. package/src/graphics/boolean-vector.ts +56 -26
  167. package/src/graphics/color.ts +3 -1
  168. package/src/graphics/convex-shape.ts +10 -3
  169. package/src/graphics/font.ts +171 -50
  170. package/src/graphics/glsl-matrix.ts +9 -3
  171. package/src/graphics/glsl.ts +81 -35
  172. package/src/graphics/glyph.ts +67 -26
  173. package/src/graphics/image.ts +119 -45
  174. package/src/graphics/rect.ts +56 -24
  175. package/src/graphics/render-states.ts +31 -14
  176. package/src/graphics/render-target.ts +197 -81
  177. package/src/graphics/render-texture.ts +36 -12
  178. package/src/graphics/render-window.ts +9 -3
  179. package/src/graphics/shader.ts +186 -61
  180. package/src/graphics/shape.ts +93 -35
  181. package/src/graphics/sprite.ts +64 -25
  182. package/src/graphics/stencil-mode.ts +12 -6
  183. package/src/graphics/swap.ts +3 -2
  184. package/src/graphics/text.ts +229 -74
  185. package/src/graphics/texture.ts +180 -61
  186. package/src/graphics/transform.ts +132 -47
  187. package/src/graphics/transformable.ts +3 -1
  188. package/src/graphics/vertex-array.ts +87 -35
  189. package/src/graphics/vertex-buffer.ts +97 -33
  190. package/src/graphics/vertex.ts +9 -3
  191. package/src/graphics/view.ts +59 -21
  192. package/src/index.ts +101 -23
  193. package/src/internal/audio-codec-registry.ts +18 -6
  194. package/src/internal/audio-input-stream.ts +6 -2
  195. package/src/internal/audio-music-pump.ts +116 -41
  196. package/src/internal/audio-native.ts +249 -96
  197. package/src/internal/audio-recorder-session.ts +68 -24
  198. package/src/internal/audio-worker-session.ts +65 -21
  199. package/src/internal/audio-worker.ts +85 -41
  200. package/src/internal/glsl-value.ts +26 -11
  201. package/src/internal/graphics-state.ts +57 -20
  202. package/src/internal/input-stream.ts +23 -10
  203. package/src/internal/native.ts +252 -99
  204. package/src/internal/numeric-properties.ts +2 -1
  205. package/src/internal/render-states.ts +3 -1
  206. package/src/internal/scalar.ts +33 -14
  207. package/src/internal/shaped-glyph.ts +25 -12
  208. package/src/internal/struct-view.ts +40 -13
  209. package/src/internal/transformable.ts +3 -1
  210. package/src/network/common.ts +35 -11
  211. package/src/network/dns.ts +95 -38
  212. package/src/network/ftp.ts +129 -47
  213. package/src/network/http.ts +232 -77
  214. package/src/network/ip-address.ts +118 -48
  215. package/src/network/packet.ts +161 -54
  216. package/src/network/sftp.ts +498 -168
  217. package/src/network/socket-selector.ts +66 -26
  218. package/src/network/socket.ts +133 -46
  219. package/src/network/tcp-listener.ts +78 -29
  220. package/src/network/tcp-socket.ts +240 -95
  221. package/src/network/tls-material.ts +6 -2
  222. package/src/network/udp-socket.ts +147 -53
  223. package/src/system/angle.ts +3 -1
  224. package/src/system/clock.ts +12 -4
  225. package/src/system/err.ts +5 -2
  226. package/src/system/file-input-stream.ts +12 -4
  227. package/src/system/input-stream.ts +9 -3
  228. package/src/system/operators.ts +290 -115
  229. package/src/system/sleep.ts +6 -2
  230. package/src/system/time.ts +18 -6
  231. package/src/system/timeout-with-predicate.ts +19 -8
  232. package/src/system/vector2.ts +101 -49
  233. package/src/system/vector3.ts +85 -36
  234. package/src/window/clipboard.ts +3 -1
  235. package/src/window/context.ts +15 -5
  236. package/src/window/cursor.ts +3 -1
  237. package/src/window/event.ts +26 -12
  238. package/src/window/mouse.ts +6 -2
  239. package/src/window/video-mode.ts +3 -1
  240. package/src/window/window.ts +119 -37
  241. package/test/native/audio-probes.cc +74 -36
  242. package/test/native/deferred-delete-probes.cc +17 -11
  243. package/test/native/drawable-probes.cc +70 -36
  244. package/test/native/exception-probes.cc +14 -9
  245. package/test/native/image-probes.cc +20 -10
  246. package/test/native/matrix-probes.cc +8 -4
  247. package/test/native/network-oracle.cc +17 -11
  248. package/test/native/render-texture-probes.cc +33 -24
  249. package/test/native/shader-probes.cc +9 -9
  250. package/test/native/shape-probes.cc +37 -23
  251. package/test/native/sprite-probes.cc +41 -25
  252. package/test/native/system-probes.cc +58 -35
  253. package/test/native/text-probes.cc +77 -44
  254. package/test/native/texture-probes.cc +43 -26
  255. package/test/native/time-probes.cc +18 -12
  256. package/test/native/transform-probes.cc +15 -10
  257. package/test/native/transformable-probes.cc +23 -17
  258. package/test/native/value-oracle.h +9 -4
  259. package/test/native/value-probes.cc +31 -23
  260. package/test/native/vertex-array-probes.cc +22 -14
  261. package/test/native/vertex-buffer-probes.cc +28 -17
  262. package/test/native/view-probes.cc +29 -17
  263. package/test/native/window-probes.cc +66 -33
  264. package/tools/ensure-sfml.cjs +9 -0
  265. package/tools/generate-network-constants.cjs +11 -6
  266. package/tools/generate-window-constants.cjs +31 -12
  267. package/docs/README.ja.md +0 -30
  268. package/docs/README.ko.md +0 -30
  269. package/docs/README.md +0 -30
  270. package/docs/README.zh-CN.md +0 -30
  271. package/docs/api.ja.md +0 -84
  272. package/docs/api.ko.md +0 -84
  273. package/docs/api.md +0 -81
  274. package/docs/api.zh-CN.md +0 -81
  275. package/docs/audio.ja.md +0 -249
  276. package/docs/audio.ko.md +0 -251
  277. package/docs/audio.md +0 -252
  278. package/docs/audio.zh-CN.md +0 -252
  279. package/docs/concepts.ja.md +0 -130
  280. package/docs/concepts.ko.md +0 -130
  281. package/docs/concepts.md +0 -131
  282. package/docs/concepts.zh-CN.md +0 -131
  283. package/docs/development.ja.md +0 -144
  284. package/docs/development.ko.md +0 -144
  285. package/docs/development.md +0 -146
  286. package/docs/development.zh-CN.md +0 -146
  287. package/docs/getting-started.ja.md +0 -154
  288. package/docs/getting-started.ko.md +0 -154
  289. package/docs/getting-started.md +0 -156
  290. package/docs/getting-started.zh-CN.md +0 -156
  291. package/docs/graphics.ja.md +0 -256
  292. package/docs/graphics.ko.md +0 -254
  293. package/docs/graphics.md +0 -255
  294. package/docs/graphics.zh-CN.md +0 -257
  295. package/docs/network.ja.md +0 -214
  296. package/docs/network.ko.md +0 -216
  297. package/docs/network.md +0 -218
  298. package/docs/network.zh-CN.md +0 -218
  299. package/docs/system.ja.md +0 -169
  300. package/docs/system.ko.md +0 -171
  301. package/docs/system.md +0 -173
  302. package/docs/system.zh-CN.md +0 -173
  303. package/docs/window.ja.md +0 -138
  304. package/docs/window.ko.md +0 -140
  305. package/docs/window.md +0 -141
  306. package/docs/window.zh-CN.md +0 -141
  307. package/native/exception-boundary.h +0 -97
  308. package/native/numeric-fields.h +0 -96
  309. package/native/shared-handle.h +0 -107
  310. package/test/tsconfig.json +0 -8
  311. package/tools/configure-lsp.cjs +0 -23
  312. package/tools/lib_downloader.cjs +0 -92
  313. package/tools/lib_downloader_urls.cjs +0 -23
@@ -1,10 +1,4 @@
1
- #include "graphics-state.h"
2
- #include "exception-boundary.h"
3
- #include "shared-handle.h"
4
-
5
- #include <SFML/Window/Context.hpp>
6
1
  #define GL_SILENCE_DEPRECATION
7
- #include <SFML/OpenGL.hpp>
8
2
 
9
3
  #include <array>
10
4
  #include <exception>
@@ -13,6 +7,12 @@
13
7
  #include <string>
14
8
  #include <vector>
15
9
 
10
+ #include "exception-boundary.h"
11
+ #include "graphics-state.h"
12
+ #include "shared-handle.h"
13
+ #include <SFML/OpenGL.hpp>
14
+ #include <SFML/Window/Context.hpp>
15
+
16
16
  namespace {
17
17
 
18
18
  using State = sfmljs::ShaderState;
@@ -29,12 +29,16 @@ NAN_METHOD(CreateShader) {
29
29
  auto state = sfmljs::MakeThreadOwned<State>(owner, id);
30
30
  owner->shaders.emplace(id, state);
31
31
  auto result = Nan::New<v8::Object>();
32
- Nan::Set(result, Nan::New("handle").ToLocalChecked(),
33
- Handle::Create(state)).FromJust();
32
+ Nan::Set(result, Nan::New("handle").ToLocalChecked(), Handle::Create(state))
33
+ .FromJust();
34
34
  Nan::Set(result, Nan::New("id").ToLocalChecked(), Nan::New(id)).FromJust();
35
- Nan::Set(result, Nan::New("buffer").ToLocalChecked(),
36
- sfmljs::MapShared(info.GetIsolate(), state, &state->programId,
37
- sizeof(state->programId))).FromJust();
35
+ Nan::Set(result,
36
+ Nan::New("buffer").ToLocalChecked(),
37
+ sfmljs::MapShared(info.GetIsolate(),
38
+ state,
39
+ &state->programId,
40
+ sizeof(state->programId)))
41
+ .FromJust();
38
42
  info.GetReturnValue().Set(result);
39
43
  } catch (const std::exception& error) {
40
44
  sfmljs::ThrowError(error.what());
@@ -46,7 +50,8 @@ using Sources = std::array<std::optional<std::string>, 3>;
46
50
  class CompileWorker final : public sfmljs::AsyncWorker {
47
51
  public:
48
52
  CompileWorker(Nan::Callback* callback, bool memory, Sources sources)
49
- : sfmljs::AsyncWorker(callback, "sfml:Shader"), memory_(memory),
53
+ : sfmljs::AsyncWorker(callback, "sfml:Shader"),
54
+ memory_(memory),
50
55
  sources_(std::move(sources)) {}
51
56
 
52
57
  void ExecuteWork() override {
@@ -58,12 +63,13 @@ class CompileWorker final : public sfmljs::AsyncWorker {
58
63
  for (std::size_t i = 0; i < paths.size(); ++i) {
59
64
  if (sources_[i]) {
60
65
  const auto& text = *sources_[i];
61
- paths[i] = std::filesystem::path(std::u8string(text.begin(), text.end()));
66
+ paths[i] =
67
+ std::filesystem::path(std::u8string(text.begin(), text.end()));
62
68
  }
63
69
  }
64
70
  }
65
71
  const auto count = static_cast<unsigned>(sources_[0].has_value()) +
66
- sources_[1].has_value() + sources_[2].has_value();
72
+ sources_[1].has_value() + sources_[2].has_value();
67
73
  if (count == 1) {
68
74
  const unsigned i = sources_[0] ? 0 : sources_[1] ? 1 : 2;
69
75
  const auto type = static_cast<sf::Shader::Type>(i);
@@ -74,7 +80,7 @@ class CompileWorker final : public sfmljs::AsyncWorker {
74
80
  : program_->loadFromFile(paths[0], paths[2]);
75
81
  } else {
76
82
  ok_ = memory_ ? program_->loadFromMemory(
77
- *sources_[0], *sources_[1], *sources_[2])
83
+ *sources_[0], *sources_[1], *sources_[2])
78
84
  : program_->loadFromFile(paths[0], paths[1], paths[2]);
79
85
  }
80
86
  } catch (const std::exception& error) {
@@ -104,19 +110,21 @@ NAN_METHOD(CompileShader) {
104
110
  return Nan::ThrowTypeError("Expected shader sources and callback");
105
111
  }
106
112
  auto array = info[1].As<v8::Array>();
107
- if (array->Length() != 3) return Nan::ThrowTypeError("Expected three shader stages");
113
+ if (array->Length() != 3)
114
+ return Nan::ThrowTypeError("Expected three shader stages");
108
115
  try {
109
116
  Sources sources;
110
117
  for (unsigned i = 0; i < sources.size(); ++i) {
111
118
  v8::Local<v8::Value> value;
112
119
  if (!Nan::Get(array, i).ToLocal(&value)) return;
113
120
  if (value->IsNull()) continue;
114
- if (!value->IsString()) return Nan::ThrowTypeError("Expected shader source");
121
+ if (!value->IsString())
122
+ return Nan::ThrowTypeError("Expected shader source");
115
123
  Nan::Utf8String text(value);
116
124
  sources[i] = std::string(*text, text.length());
117
125
  }
118
126
  const unsigned count = static_cast<unsigned>(sources[0].has_value()) +
119
- sources[1].has_value() + sources[2].has_value();
127
+ sources[1].has_value() + sources[2].has_value();
120
128
  if (count == 0 || (count == 2 && (!sources[0] || !sources[2]))) {
121
129
  return Nan::ThrowTypeError("Invalid shader stage combination");
122
130
  }
@@ -141,15 +149,21 @@ NAN_METHOD(CommitShader) {
141
149
  }
142
150
 
143
151
  template <typename T, std::size_t Size>
144
- void SetArray(sf::Shader& shader, const std::string& name, const float* data,
152
+ void SetArray(sf::Shader& shader, // NOLINT(runtime/references)
153
+ const std::string& name,
154
+ const float* data,
145
155
  std::size_t count) {
146
156
  std::vector<T> values;
147
157
  values.reserve(count);
148
158
  for (std::size_t i = 0; i < count; ++i, data += Size) {
149
- if constexpr (Size == 2) values.emplace_back(data[0], data[1]);
150
- else if constexpr (Size == 3) values.emplace_back(data[0], data[1], data[2]);
151
- else if constexpr (Size == 4) values.emplace_back(data[0], data[1], data[2], data[3]);
152
- else values.emplace_back(data);
159
+ if constexpr (Size == 2)
160
+ values.emplace_back(data[0], data[1]);
161
+ else if constexpr (Size == 3)
162
+ values.emplace_back(data[0], data[1], data[2]);
163
+ else if constexpr (Size == 4)
164
+ values.emplace_back(data[0], data[1], data[2], data[3]);
165
+ else
166
+ values.emplace_back(data);
153
167
  }
154
168
  shader.setUniformArray(name, values.data(), values.size());
155
169
  }
@@ -158,10 +172,12 @@ NAN_METHOD(SetShaderUniform) {
158
172
  auto* handle = Handle::From(info[0]);
159
173
  if (!handle) return;
160
174
  if (!info[1]->IsString() || !info[2]->IsUint32() || !info[4]->IsBoolean()) {
161
- return Nan::ThrowTypeError("Expected a uniform name, type, data and array flag");
175
+ return Nan::ThrowTypeError(
176
+ "Expected a uniform name, type, data and array flag");
162
177
  }
163
178
  const auto type = Nan::To<unsigned>(info[2]).FromJust();
164
- constexpr std::array<std::size_t, 14> sizes{1, 1, 1, 2, 3, 4, 2, 3, 4, 2, 3, 4, 9, 16};
179
+ constexpr std::array<std::size_t, 14> sizes{
180
+ 1, 1, 1, 2, 3, 4, 2, 3, 4, 2, 3, 4, 9, 16};
165
181
  if (type >= sizes.size()) return Nan::ThrowRangeError("Invalid uniform type");
166
182
  const bool floating = type == 0 || (type >= 3 && type <= 5) || type >= 12;
167
183
  const bool array = info[4]->IsTrue();
@@ -184,35 +200,78 @@ NAN_METHOD(SetShaderUniform) {
184
200
  if (array) {
185
201
  const auto count = length / sizes[type];
186
202
  switch (type) {
187
- case 0: shader.setUniformArray(name, v, count); break;
188
- case 3: SetArray<sf::Glsl::Vec2, 2>(shader, name, v, count); break;
189
- case 4: SetArray<sf::Glsl::Vec3, 3>(shader, name, v, count); break;
190
- case 5: SetArray<sf::Glsl::Vec4, 4>(shader, name, v, count); break;
191
- case 12: SetArray<sf::Glsl::Mat3, 9>(shader, name, v, count); break;
192
- case 13: SetArray<sf::Glsl::Mat4, 16>(shader, name, v, count); break;
203
+ case 0:
204
+ shader.setUniformArray(name, v, count);
205
+ break;
206
+ case 3:
207
+ SetArray<sf::Glsl::Vec2, 2>(shader, name, v, count);
208
+ break;
209
+ case 4:
210
+ SetArray<sf::Glsl::Vec3, 3>(shader, name, v, count);
211
+ break;
212
+ case 5:
213
+ SetArray<sf::Glsl::Vec4, 4>(shader, name, v, count);
214
+ break;
215
+ case 12:
216
+ SetArray<sf::Glsl::Mat3, 9>(shader, name, v, count);
217
+ break;
218
+ case 13:
219
+ SetArray<sf::Glsl::Mat4, 16>(shader, name, v, count);
220
+ break;
193
221
  }
194
222
  } else {
195
223
  switch (type) {
196
- case 0: shader.setUniform(name, v[0]); break;
197
- case 3: shader.setUniform(name, sf::Glsl::Vec2(v[0], v[1])); break;
198
- case 4: shader.setUniform(name, sf::Glsl::Vec3(v[0], v[1], v[2])); break;
199
- case 5: shader.setUniform(name, sf::Glsl::Vec4(v[0], v[1], v[2], v[3])); break;
200
- case 12: shader.setUniform(name, sf::Glsl::Mat3(v)); break;
201
- case 13: shader.setUniform(name, sf::Glsl::Mat4(v)); break;
224
+ case 0:
225
+ shader.setUniform(name, v[0]);
226
+ break;
227
+ case 3:
228
+ shader.setUniform(name, sf::Glsl::Vec2(v[0], v[1]));
229
+ break;
230
+ case 4:
231
+ shader.setUniform(name, sf::Glsl::Vec3(v[0], v[1], v[2]));
232
+ break;
233
+ case 5:
234
+ shader.setUniform(name, sf::Glsl::Vec4(v[0], v[1], v[2], v[3]));
235
+ break;
236
+ case 12:
237
+ shader.setUniform(name, sf::Glsl::Mat3(v));
238
+ break;
239
+ case 13:
240
+ shader.setUniform(name, sf::Glsl::Mat4(v));
241
+ break;
202
242
  }
203
243
  }
204
244
  } else {
205
245
  Nan::TypedArrayContents<int> values(info[3]);
206
246
  const auto* v = *values;
207
247
  switch (type) {
208
- case 1: shader.setUniform(name, v[0]); break;
209
- case 2: shader.setUniform(name, v[0] != 0); break;
210
- case 6: shader.setUniform(name, sf::Glsl::Ivec2(v[0], v[1])); break;
211
- case 7: shader.setUniform(name, sf::Glsl::Ivec3(v[0], v[1], v[2])); break;
212
- case 8: shader.setUniform(name, sf::Glsl::Ivec4(v[0], v[1], v[2], v[3])); break;
213
- case 9: shader.setUniform(name, sf::Glsl::Bvec2(v[0] != 0, v[1] != 0)); break;
214
- case 10: shader.setUniform(name, sf::Glsl::Bvec3(v[0] != 0, v[1] != 0, v[2] != 0)); break;
215
- case 11: shader.setUniform(name, sf::Glsl::Bvec4(v[0] != 0, v[1] != 0, v[2] != 0, v[3] != 0)); break;
248
+ case 1:
249
+ shader.setUniform(name, v[0]);
250
+ break;
251
+ case 2:
252
+ shader.setUniform(name, v[0] != 0);
253
+ break;
254
+ case 6:
255
+ shader.setUniform(name, sf::Glsl::Ivec2(v[0], v[1]));
256
+ break;
257
+ case 7:
258
+ shader.setUniform(name, sf::Glsl::Ivec3(v[0], v[1], v[2]));
259
+ break;
260
+ case 8:
261
+ shader.setUniform(name, sf::Glsl::Ivec4(v[0], v[1], v[2], v[3]));
262
+ break;
263
+ case 9:
264
+ shader.setUniform(name, sf::Glsl::Bvec2(v[0] != 0, v[1] != 0));
265
+ break;
266
+ case 10:
267
+ shader.setUniform(name,
268
+ sf::Glsl::Bvec3(v[0] != 0, v[1] != 0, v[2] != 0));
269
+ break;
270
+ case 11:
271
+ shader.setUniform(
272
+ name,
273
+ sf::Glsl::Bvec4(v[0] != 0, v[1] != 0, v[2] != 0, v[3] != 0));
274
+ break;
216
275
  }
217
276
  }
218
277
  } catch (const std::exception& error) {
@@ -223,7 +282,8 @@ NAN_METHOD(SetShaderUniform) {
223
282
  NAN_METHOD(SetShaderTexture) {
224
283
  auto* handle = Handle::From(info[0]);
225
284
  if (!handle) return;
226
- if (!info[1]->IsString()) return Nan::ThrowTypeError("Expected a uniform name");
285
+ if (!info[1]->IsString())
286
+ return Nan::ThrowTypeError("Expected a uniform name");
227
287
  Nan::Utf8String text(info[1]);
228
288
  const std::string name(*text, text.length());
229
289
  auto& state = *handle->owner();
@@ -238,7 +298,8 @@ NAN_METHOD(SetShaderTexture) {
238
298
  // Keep its pointer table alive even when CurrentTexture or a scalar is set.
239
299
  const State::Lock lock;
240
300
  #ifdef SFML_SYSTEM_WINDOWS
241
- using Location = int (__stdcall*)(unsigned, const char*);
301
+ // Function-pointer type, not a C-style cast.
302
+ using Location = int(__stdcall*)(unsigned, const char*); // NOLINT
242
303
  #else
243
304
  using Location = int (*)(unsigned, const char*);
244
305
  #endif
@@ -249,7 +310,8 @@ NAN_METHOD(SetShaderTexture) {
249
310
  const int location = locationFunction(program, name.c_str());
250
311
  GLint maximum{};
251
312
  glGetIntegerv(0x8B4D /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */, &maximum);
252
- const bool accepted = location >= 0 &&
313
+ const bool accepted =
314
+ location >= 0 &&
253
315
  (state.textures.contains(location) ||
254
316
  state.textures.size() + 1 < static_cast<std::size_t>(maximum));
255
317
  state.current->setUniform(name, *texture);
@@ -264,7 +326,9 @@ NAN_METHOD(SetShaderTexture) {
264
326
 
265
327
  NAN_METHOD(GetShaderNativeHandle) {
266
328
  auto* handle = Handle::From(info[0]);
267
- if (handle) info.GetReturnValue().Set(Nan::New(handle->owner()->current->getNativeHandle()));
329
+ if (handle)
330
+ info.GetReturnValue().Set(
331
+ Nan::New(handle->owner()->current->getNativeHandle()));
268
332
  }
269
333
 
270
334
  NAN_METHOD(BindShader) {
@@ -275,7 +339,8 @@ NAN_METHOD(BindShader) {
275
339
 
276
340
  NAN_METHOD(IsShaderAvailable) {
277
341
  info.GetReturnValue().Set(info[0]->IsTrue()
278
- ? sf::Shader::isGeometryAvailable() : sf::Shader::isAvailable());
342
+ ? sf::Shader::isGeometryAvailable()
343
+ : sf::Shader::isAvailable());
279
344
  }
280
345
 
281
346
  } // namespace
@@ -1,16 +1,18 @@
1
- #include "shape-state.h"
1
+ #include <cmath>
2
+ #include <limits>
3
+
2
4
  #include "exception-boundary.h"
5
+ #include "shape-state.h"
3
6
  #include "value-binding.h"
4
7
  #include "window-event.h"
5
- #include <cmath>
6
- #include <limits>
7
8
 
8
9
  namespace {
9
10
  using State = sfmljs::ShapeState;
10
11
  using Handle = sfmljs::SharedHandle<State>;
11
12
  constexpr std::uint32_t maxPoints = 0x7fffffff / (6 * sizeof(sf::Vertex)) - 2;
12
13
 
13
- bool Number(v8::Local<v8::Value> input, float& value) {
14
+ bool Number(v8::Local<v8::Value> input,
15
+ float& value) { // NOLINT(runtime/references)
14
16
  if (!input->IsNumber()) {
15
17
  Nan::ThrowTypeError("Expected a number");
16
18
  return false;
@@ -23,7 +25,8 @@ bool Number(v8::Local<v8::Value> input, float& value) {
23
25
  return true;
24
26
  }
25
27
 
26
- bool Count(v8::Local<v8::Value> input, std::uint32_t& count) {
28
+ bool Count(v8::Local<v8::Value> input,
29
+ std::uint32_t& count) { // NOLINT(runtime/references)
27
30
  if (!input->IsUint32() ||
28
31
  (count = Nan::To<std::uint32_t>(input).FromJust()) > maxPoints) {
29
32
  Nan::ThrowRangeError("Shape point count exceeds the buffer limit");
@@ -33,25 +36,28 @@ bool Count(v8::Local<v8::Value> input, std::uint32_t& count) {
33
36
  }
34
37
 
35
38
  v8::Local<v8::Object> MapShape(const std::shared_ptr<State>& state) {
36
- using namespace sfmljs;
37
39
  auto& shape = *state->shape;
38
- const auto& bounds = Field<ShapeBounds>(shape);
39
- NumericFields fields;
40
- fields.Add("left", bounds.position.x).Add("top", bounds.position.y)
41
- .Add("boundsWidth", bounds.size.x).Add("boundsHeight", bounds.size.y)
42
- .Add("thickness", Field<ShapeThickness>(shape))
43
- .Add("miterLimit", Field<ShapeMiterLimit>(shape));
40
+ const auto& bounds = sfmljs::Field<sfmljs::ShapeBounds>(shape);
41
+ sfmljs::NumericFields fields;
42
+ fields.Add("left", bounds.position.x)
43
+ .Add("top", bounds.position.y)
44
+ .Add("boundsWidth", bounds.size.x)
45
+ .Add("boundsHeight", bounds.size.y)
46
+ .Add("thickness", sfmljs::Field<sfmljs::ShapeThickness>(shape))
47
+ .Add("miterLimit", sfmljs::Field<sfmljs::ShapeMiterLimit>(shape));
44
48
  if (state->kind == 1) {
45
49
  auto& circle = static_cast<sf::CircleShape&>(shape);
46
- fields.Add("radius", Field<CircleRadius>(circle))
47
- .Add("count", Field<CircleCount>(circle),
50
+ fields.Add("radius", sfmljs::Field<sfmljs::CircleRadius>(circle))
51
+ .Add("count",
52
+ sfmljs::Field<sfmljs::CircleCount>(circle),
48
53
  sizeof(std::size_t) == 8 ? "size64" : "u32");
49
54
  } else {
50
55
  state->pointCount = static_cast<std::uint32_t>(shape.getPointCount());
51
56
  fields.Add("count", state->pointCount);
52
57
  }
53
58
  if (state->kind == 2) {
54
- const auto& size = Field<RectangleSize>(static_cast<sf::RectangleShape&>(shape));
59
+ const auto& size = sfmljs::Field<sfmljs::RectangleSize>(
60
+ static_cast<sf::RectangleShape&>(shape));
55
61
  fields.Add("width", size.x).Add("height", size.y);
56
62
  }
57
63
  return fields.Map(state);
@@ -88,26 +94,41 @@ NAN_METHOD(CreateShape) {
88
94
  if (source) {
89
95
  const auto& raw = *source->owner()->shape;
90
96
  switch (kind) {
91
- case 0: shape = std::make_unique<sfmljs::PointShape>(
92
- static_cast<const sfmljs::PointShape&>(raw)); break;
93
- case 1: shape = std::make_unique<sf::CircleShape>(
94
- static_cast<const sf::CircleShape&>(raw)); break;
95
- case 2: shape = std::make_unique<sf::RectangleShape>(
96
- static_cast<const sf::RectangleShape&>(raw)); break;
97
- case 3: shape = std::make_unique<sf::ConvexShape>(
98
- static_cast<const sf::ConvexShape&>(raw)); break;
97
+ case 0:
98
+ shape = std::make_unique<sfmljs::PointShape>(
99
+ static_cast<const sfmljs::PointShape&>(raw));
100
+ break;
101
+ case 1:
102
+ shape = std::make_unique<sf::CircleShape>(
103
+ static_cast<const sf::CircleShape&>(raw));
104
+ break;
105
+ case 2:
106
+ shape = std::make_unique<sf::RectangleShape>(
107
+ static_cast<const sf::RectangleShape&>(raw));
108
+ break;
109
+ case 3:
110
+ shape = std::make_unique<sf::ConvexShape>(
111
+ static_cast<const sf::ConvexShape&>(raw));
112
+ break;
99
113
  }
100
114
  } else {
101
115
  switch (kind) {
102
- case 0: shape = std::make_unique<sfmljs::PointShape>(); break;
103
- case 1: shape = std::make_unique<sf::CircleShape>(x, count); break;
104
- case 2: shape = std::make_unique<sf::RectangleShape>(
105
- sf::Vector2f{x, y}); break;
106
- case 3: shape = std::make_unique<sf::ConvexShape>(count); break;
116
+ case 0:
117
+ shape = std::make_unique<sfmljs::PointShape>();
118
+ break;
119
+ case 1:
120
+ shape = std::make_unique<sf::CircleShape>(x, count);
121
+ break;
122
+ case 2:
123
+ shape = std::make_unique<sf::RectangleShape>(sf::Vector2f{x, y});
124
+ break;
125
+ case 3:
126
+ shape = std::make_unique<sf::ConvexShape>(count);
127
+ break;
107
128
  }
108
129
  }
109
- auto state = sfmljs::MakeThreadOwned<State>(context->owner(),
110
- context->owner()->nextId++, kind, std::move(shape));
130
+ auto state = sfmljs::MakeThreadOwned<State>(
131
+ context->owner(), context->owner()->nextId++, kind, std::move(shape));
111
132
  if (source) {
112
133
  state->values = source->owner()->values;
113
134
  state->appearance = source->owner()->appearance;
@@ -116,16 +137,22 @@ NAN_METHOD(CreateShape) {
116
137
  }
117
138
  state->context->shapes.emplace(state->id, state);
118
139
  auto result = Nan::New<v8::Object>();
119
- #define MAP(name, value) \
120
- Nan::Set(result, Nan::New(name).ToLocalChecked(), value).FromJust()
140
+ #define MAP(name, value) \
141
+ Nan::Set(result, Nan::New(name).ToLocalChecked(), value).FromJust()
121
142
  MAP("handle", Handle::Create(state));
122
143
  MAP("id", Nan::New(state->id));
123
144
  MAP("info", MapShape(state));
124
145
  MAP("transformable", sfmljs::TransformableHandle(state));
125
- MAP("buffer", sfmljs::MapShared(info.GetIsolate(), state,
126
- state->values.data(), sizeof(state->values)));
127
- MAP("appearance", sfmljs::MapShared(info.GetIsolate(), state,
128
- &state->appearance, sizeof(state->appearance)));
146
+ MAP("buffer",
147
+ sfmljs::MapShared(info.GetIsolate(),
148
+ state,
149
+ state->values.data(),
150
+ sizeof(state->values)));
151
+ MAP("appearance",
152
+ sfmljs::MapShared(info.GetIsolate(),
153
+ state,
154
+ &state->appearance,
155
+ sizeof(state->appearance)));
129
156
  #undef MAP
130
157
  info.GetReturnValue().Set(result);
131
158
  } catch (const std::exception& error) {
@@ -170,17 +197,30 @@ NAN_METHOD(ChangeShapeGeometry) {
170
197
  try {
171
198
  state.SyncShape();
172
199
  switch (operation) {
173
- case 0: shape.setOutlineThickness(x); break;
174
- case 1: shape.setMiterLimit(x); break;
175
- case 2: static_cast<sf::CircleShape&>(shape).setRadius(x); break;
176
- case 3: static_cast<sf::RectangleShape&>(shape).setSize({x, y}); break;
200
+ case 0:
201
+ shape.setOutlineThickness(x);
202
+ break;
203
+ case 1:
204
+ shape.setMiterLimit(x);
205
+ break;
206
+ case 2:
207
+ static_cast<sf::CircleShape&>(shape).setRadius(x);
208
+ break;
209
+ case 3:
210
+ static_cast<sf::RectangleShape&>(shape).setSize({x, y});
211
+ break;
177
212
  case 4:
178
213
  if (state.kind == 1) {
179
214
  static_cast<sf::CircleShape&>(shape).setPointCount(count);
180
- } else static_cast<sf::ConvexShape&>(shape).setPointCount(count);
215
+ } else {
216
+ static_cast<sf::ConvexShape&>(shape).setPointCount(count);
217
+ }
218
+ break;
219
+ case 5:
220
+ static_cast<sf::ConvexShape&>(shape).setPoint(count, {x, y});
181
221
  break;
182
- case 5: static_cast<sf::ConvexShape&>(shape).setPoint(count, {x, y}); break;
183
- default: return Nan::ThrowRangeError("Unknown shape operation");
222
+ default:
223
+ return Nan::ThrowRangeError("Unknown shape operation");
184
224
  }
185
225
  state.pointCount = static_cast<std::uint32_t>(shape.getPointCount());
186
226
  } catch (const std::exception& error) {
@@ -238,8 +278,9 @@ NAN_METHOD(GetShapePoint) {
238
278
 
239
279
  NAN_METHOD(GetShapeCenter) {
240
280
  auto* handle = Handle::From(info[0]);
241
- if (handle) info.GetReturnValue().Set(
242
- sfmljs::EventValue(handle->owner()->shape->getGeometricCenter()));
281
+ if (handle)
282
+ info.GetReturnValue().Set(
283
+ sfmljs::EventValue(handle->owner()->shape->getGeometricCenter()));
243
284
  }
244
285
 
245
286
  NAN_METHOD(SetShapeTexture) {
@@ -258,16 +299,20 @@ NAN_METHOD(SetShapeTexture) {
258
299
  found->second.lock() != texture) {
259
300
  return Nan::ThrowTypeError("Texture does not belong to this context");
260
301
  }
261
- } else if (id != 0) return Nan::ThrowTypeError("Expected zero texture ID");
302
+ } else if (id != 0) {
303
+ return Nan::ThrowTypeError("Expected zero texture ID");
304
+ }
262
305
  handle->owner()->texture = std::move(texture);
263
306
  handle->owner()->appearance.textureId = id;
264
307
  }
265
308
 
266
309
  NAN_METHOD(ShapeTextureRect) {
267
310
  auto* handle = Handle::From(info[0]);
268
- if (handle) sfmljs::values::ReturnMapped(info,
269
- std::shared_ptr<sf::IntRect>(handle->owner(),
270
- &handle->owner()->appearance.rectangle));
311
+ if (handle)
312
+ sfmljs::values::ReturnMapped(
313
+ info,
314
+ std::shared_ptr<sf::IntRect>(handle->owner(),
315
+ &handle->owner()->appearance.rectangle));
271
316
  }
272
317
 
273
318
  } // namespace
@@ -2,8 +2,8 @@
2
2
 
3
3
  #include "graphics-state.h"
4
4
  #include <SFML/Graphics/CircleShape.hpp>
5
- #include <SFML/Graphics/RectangleShape.hpp>
6
5
  #include <SFML/Graphics/ConvexShape.hpp>
6
+ #include <SFML/Graphics/RectangleShape.hpp>
7
7
 
8
8
  namespace sfmljs {
9
9
 
@@ -18,7 +18,9 @@ SFMLJS_MEMBER(RectangleSize, sf::RectangleShape, sf::Vector2f, m_size);
18
18
  struct PointShape : sf::Shape {
19
19
  std::vector<sf::Vector2f> points;
20
20
  std::size_t getPointCount() const override { return points.size(); }
21
- sf::Vector2f getPoint(std::size_t index) const override { return points[index]; }
21
+ sf::Vector2f getPoint(std::size_t index) const override {
22
+ return points[index];
23
+ }
22
24
  void Replace(std::vector<sf::Vector2f> input) {
23
25
  points = std::move(input);
24
26
  update();
@@ -35,8 +37,10 @@ struct ShapeAppearance {
35
37
  static_assert(sizeof(ShapeAppearance) == 28);
36
38
  static_assert(offsetof(ShapeAppearance, rectangle) == 12);
37
39
 
38
- inline void ApplyShapeAppearance(sf::Shape& shape, const sf::Texture* texture,
39
- const ShapeAppearance& appearance) {
40
+ inline void ApplyShapeAppearance(
41
+ sf::Shape& shape, // NOLINT(runtime/references)
42
+ const sf::Texture* texture,
43
+ const ShapeAppearance& appearance) {
40
44
  shape.setTexture(texture);
41
45
  shape.setTextureRect(appearance.rectangle);
42
46
  shape.setFillColor(sf::Color(appearance.fill));
@@ -44,10 +48,15 @@ inline void ApplyShapeAppearance(sf::Shape& shape, const sf::Texture* texture,
44
48
  }
45
49
 
46
50
  struct ShapeState : TransformableState {
47
- ShapeState(std::shared_ptr<GraphicsContext> context, std::uint32_t id,
48
- unsigned kind, std::unique_ptr<sf::Shape> shape)
49
- : TransformableState(shape.get()), context(std::move(context)),
50
- id(id), kind(kind), shape(std::move(shape)) {}
51
+ ShapeState(std::shared_ptr<GraphicsContext> context,
52
+ std::uint32_t id,
53
+ unsigned kind,
54
+ std::unique_ptr<sf::Shape> shape)
55
+ : TransformableState(shape.get()),
56
+ context(std::move(context)),
57
+ id(id),
58
+ kind(kind),
59
+ shape(std::move(shape)) {}
51
60
  ~ShapeState() { context->shapes.erase(id); }
52
61
 
53
62
  void SyncShape() {
@@ -57,7 +66,7 @@ struct ShapeState : TransformableState {
57
66
 
58
67
  std::shared_ptr<GraphicsContext> context;
59
68
  std::uint32_t id;
60
- unsigned kind; // 0 custom, 1 circle, 2 rectangle, 3 convex
69
+ unsigned kind; // 0 custom, 1 circle, 2 rectangle, 3 convex
61
70
  std::unique_ptr<sf::Shape> shape;
62
71
  std::shared_ptr<const sf::Texture> texture;
63
72
  ShapeAppearance appearance;
@@ -1,12 +1,12 @@
1
1
  #pragma once
2
2
 
3
- #include <SFML/Graphics/Text.hpp>
4
-
5
3
  #include <cstddef>
6
4
  #include <cstdint>
7
5
  #include <type_traits>
8
6
  #include <vector>
9
7
 
8
+ #include <SFML/Graphics/Text.hpp>
9
+
10
10
  namespace sfmljs {
11
11
 
12
12
  // Fixed wire layout across 32/64-bit targets. Vertex indices are doubles,
@@ -21,9 +21,12 @@ struct ShapedGlyphData {
21
21
  double vertexCount;
22
22
 
23
23
  explicit ShapedGlyphData(const sf::Text::ShapedGlyph& source)
24
- : glyph(source.glyph), position(source.position), cluster(source.cluster),
24
+ : glyph(source.glyph),
25
+ position(source.position),
26
+ cluster(source.cluster),
25
27
  textDirection(static_cast<std::uint32_t>(source.textDirection)),
26
- baseline(source.baseline), vertexOffset(source.vertexOffset),
28
+ baseline(source.baseline),
29
+ vertexOffset(source.vertexOffset),
27
30
  vertexCount(source.vertexCount) {}
28
31
  };
29
32
 
@@ -39,7 +42,8 @@ static_assert(offsetof(ShapedGlyphData, vertexOffset) == 64);
39
42
  static_assert(offsetof(ShapedGlyphData, vertexCount) == 72);
40
43
 
41
44
  // Never mutate or resize an allocation after publishing its mapped buffer.
42
- // New layouts replace the allocation; escaped buffers/members retain the old one.
45
+ // New layouts replace the allocation; escaped buffers/members retain the old
46
+ // one.
43
47
  using ShapedGlyphStorage = std::vector<ShapedGlyphData>;
44
48
 
45
49
  } // namespace sfmljs