nanovg-bindings 0.2.0-aarch64-linux

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 8f39c6d8ff75396af162aaa4aac05de655ad6c4a2d4b1059a5eaa6c5cf3c4d5f
4
+ data.tar.gz: 656e056b20213a8a014611aa566786d907fbab0958556fd14152748b53287110
5
+ SHA512:
6
+ metadata.gz: c23669c8f18238b3f3941e3310d64066cde1742539531fb2a20bf5c5d14ff71b37c00588f17b9dc2cec1e157135dc1aeafd59dc0b5af7e78b855b94256f3fa5a
7
+ data.tar.gz: 25aaac6fc2dfa1aed1b85dfaf0c455b87a961d77db04609c517342dd455d454c2cc71e269b0f315b52f7f803ebf54ad179cacda06d349e27bd754ed10dcd1c52
data/ChangeLog ADDED
@@ -0,0 +1,78 @@
1
+ 2024-01-05 vaiorabbit <http://twitter.com/vaiorabbit>
2
+
3
+ * macOS : Generate libraries for each platform
4
+ * Updated using the latest nanovg ( https://github.com/memononen/nanovg/commit/f93799c078fa11ed61c078c65a53914c8782c00b )
5
+
6
+ 2023-02-01 vaiorabbit <http://twitter.com/vaiorabbit>
7
+
8
+ * Updated using the latest nanovg ( https://github.com/memononen/nanovg/commit/7544c114e83db7cf67bd1c9e012349b70caacc2f )
9
+
10
+ 2022-04-29 vaiorabbit <http://twitter.com/vaiorabbit>
11
+
12
+ * Updated using the latest nanovg ( https://github.com/memononen/nanovg/commit/397f3300bc14bdb856ec429c71c345ab0340b0a6 )
13
+
14
+ 2022-01-08 vaiorabbit <http://twitter.com/vaiorabbit>
15
+
16
+ * Changed API
17
+
18
+ 2022-01-07 vaiorabbit <http://twitter.com/vaiorabbit>
19
+
20
+ * Use opengl-bindings2
21
+
22
+ 2022-01-01 vaiorabbit <http://twitter.com/vaiorabbit>
23
+
24
+ * nanovg-bindings.gemspec: Added
25
+
26
+ 2021-12-31 vaiorabbit <http://twitter.com/vaiorabbit>
27
+
28
+ * libnanovg_gl2.dll, libnanovg_gl3.dll: Added Windows binary
29
+ * demo/util: Added for automatic library loading
30
+ * nanovg_dll/nanovg.c: Fixed for Windows build
31
+
32
+ 2021-12-30 vaiorabbit <http://twitter.com/vaiorabbit>
33
+
34
+ * libnanovg_gl2.dylib, libnanovg_gl3.dylib: Built with latest nanovg ( https://github.com/memononen/nanovg/tree/645e9147a8701c98f52240257af0c9d5fa640e86 )
35
+ * nanovg_dll: Use CMake / Scripts are now M1 mac ready
36
+ * demo: Reorganized directory structure / Added several codes to run hole_polygon.ry demo / Fixed qrc.rb for the latest RQRCoce library
37
+
38
+ 2018-10-20 vaiorabbit <http://twitter.com/vaiorabbit>
39
+
40
+ * nanovg.rb: Now compatible with the latest APIs (NanoVG Commit f4069e6a1ad5da430fb0a9c57476d5ddc2ff89b2 https://github.com/memononen/nanovg/commit/f4069e6a1ad5da430fb0a9c57476d5ddc2ff89b2 ).
41
+
42
+ 2017-07-22 vaiorabbit <http://twitter.com/vaiorabbit>
43
+
44
+ * nanovg.rb: Now compatible with the latest APIs (NanoVG Commit 30e1c98175b30bcfd8f979f0813a97333329dfe2 https://github.com/memononen/nanovg/commit/30e1c98175b30bcfd8f979f0813a97333329dfe2).
45
+
46
+ 2017-03-21 vaiorabbit <http://twitter.com/vaiorabbit>
47
+
48
+ * nanovg.rb: Now compatible with the latest APIs (NanoVG Commit c75fc0bfcf3a72fb61dcd46df0522a60b59c6cc2 https://github.com/memononen/nanovg/commit/c75fc0bfcf3a72fb61dcd46df0522a60b59c6cc2).
49
+
50
+ 2016-12-03 vaiorabbit <http://twitter.com/vaiorabbit>
51
+
52
+ * nanovg.rb, nanovg_dll: Now compatible with the latest APIs (NanoVG Commit cacb00b852079db23c180f2e6cbff41eef673783).
53
+ * demo/emojifont.rb, etc.: Added.
54
+
55
+ 2016-08-17 vaiorabbit <http://twitter.com/vaiorabbit>
56
+
57
+ * nanovg.rb, nanovg_dll: Now compatible with the latest APIs (NanoVG Commit 09dc767e3f25ec97e7398c18eca6a4c6bb3763f5).
58
+
59
+ 2015-09-07 vaiorabbit <http://twitter.com/vaiorabbit>
60
+
61
+ * demo: Removed some uninformative samples.
62
+
63
+ 2015-08-22 vaiorabbit
64
+
65
+ * nanovg_dll.c: Fixed include file name for Mac OS X.
66
+
67
+ 2015-07-16 vaiorabbit
68
+
69
+ * demo/qrc.rb: Added.
70
+
71
+ 2015-07-13 vaiorabbit
72
+
73
+ * nanovg.rb, nanovg_dll.c (nvgSetupGL2, nvgSetupGL3): Minimal OpenGL proc-address setup function (mainly for Windows)
74
+ * nanovg_dll (nanovg_gl2.def, nanovg_gl3.def): Module definition file to build DLLs on Visual Studio.
75
+
76
+ 2015-07-12 vaiorabbit
77
+
78
+ * First release.
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ NanoVG-Bindings : A Ruby bindings of NanoVG
2
+ Copyright (c) 2015-2024 vaiorabbit
3
+
4
+ This software is provided 'as-is', without any express or implied
5
+ warranty. In no event will the authors be held liable for any damages
6
+ arising from the use of this software.
7
+
8
+ Permission is granted to anyone to use this software for any purpose,
9
+ including commercial applications, and to alter it and redistribute it
10
+ freely, subject to the following restrictions:
11
+
12
+ 1. The origin of this software must not be misrepresented; you must not
13
+ claim that you wrote the original software. If you use this software
14
+ in a product, an acknowledgment in the product documentation would be
15
+ appreciated but is not required.
16
+
17
+ 2. Altered source versions must be plainly marked as such, and must not be
18
+ misrepresented as being the original software.
19
+
20
+ 3. This notice may not be removed or altered from any source
21
+ distribution.
data/README.md ADDED
@@ -0,0 +1,60 @@
1
+ # NanoVG-Bindings : A Ruby bindings of NanoVG #
2
+
3
+ Provides NanoVG ( https://github.com/memononen/nanovg ) interfaces for ruby (MRI).
4
+
5
+ * Created : 2015-07-12
6
+ * Last modified : 2024-01-05
7
+
8
+ <img src="https://raw.githubusercontent.com/vaiorabbit/nanovg-bindings/master/doc/example_rb.png" width="150"> <img src="https://raw.githubusercontent.com/vaiorabbit/nanovg-bindings/master/doc/emojifont_rb.png" width="150"> <img src="https://raw.githubusercontent.com/vaiorabbit/nanovg-bindings/master/doc/hex_gol_glider5_rb.png" width="150"> <img src="https://raw.githubusercontent.com/vaiorabbit/nanovg-bindings/master/doc/jpfont_rb.png" width="150"> <img src="https://raw.githubusercontent.com/vaiorabbit/nanovg-bindings/master/doc/mandelbrot_rb.png" width="150">
9
+
10
+
11
+ ## Prerequisites ##
12
+
13
+ * Ruby-FFI ( https://github.com/ffi/ffi )
14
+ * $ gem install ffi
15
+
16
+ * OpenGL context provider
17
+ * ex.) glut.rb or glfw.rb in opengl-bindings ( https://github.com/vaiorabbit/ruby-opengl )
18
+ * $ gem install opengl-bindings
19
+
20
+ ## How to Use ##
21
+
22
+ 1. Build NanoVG shared library
23
+ * See nanovg_dll
24
+
25
+ 2. Include nanovg.rb in your script.
26
+ * ex.) require_relative 'nanovg'
27
+
28
+ 3. Load shared library
29
+ * ex.) NanoVG.load_dll('libnanovg_gl2.dylib', render_backend: :gl2)
30
+
31
+ 4. Setup OpenGL
32
+ * nvgSetupGL2() / nvgSetupGL3
33
+
34
+ See demo/example.rb for details.
35
+
36
+ ## License ##
37
+
38
+ All source codes are available under the terms of the zlib/libpng license.
39
+
40
+ NanoVG-Bindings : A Ruby bindings of NanoVG
41
+ Copyright (c) 2015-2024 vaiorabbit
42
+
43
+ This software is provided 'as-is', without any express or implied
44
+ warranty. In no event will the authors be held liable for any damages
45
+ arising from the use of this software.
46
+
47
+ Permission is granted to anyone to use this software for any purpose,
48
+ including commercial applications, and to alter it and redistribute it
49
+ freely, subject to the following restrictions:
50
+
51
+ 1. The origin of this software must not be misrepresented; you must not
52
+ claim that you wrote the original software. If you use this software
53
+ in a product, an acknowledgment in the product documentation would be
54
+ appreciated but is not required.
55
+
56
+ 2. Altered source versions must be plainly marked as such, and must not be
57
+ misrepresented as being the original software.
58
+
59
+ 3. This notice may not be removed or altered from any source
60
+ distribution.
Binary file
Binary file
data/lib/nanovg.rb ADDED
@@ -0,0 +1,295 @@
1
+ require 'ffi'
2
+
3
+ module NVG
4
+ extend FFI::Library
5
+
6
+ #
7
+ # define/enum
8
+ #
9
+
10
+ # NVGwinding
11
+ CCW = 1
12
+ CW = 2
13
+
14
+ # NVGsolidity
15
+ SOLID = 1
16
+ HOLE = 2
17
+
18
+ # NVGlineCap
19
+ BUTT = 0
20
+ ROUND = 1
21
+ SQUARE = 2
22
+ BEVEL = 3
23
+ MITER = 4
24
+
25
+ # NVGalign
26
+ # Horizontal align
27
+ ALIGN_LEFT = 1
28
+ ALIGN_CENTER = 2
29
+ ALIGN_RIGHT = 4
30
+ # Vertical align
31
+ ALIGN_TOP = 8
32
+ ALIGN_MIDDLE = 16
33
+ ALIGN_BOTTOM = 32
34
+ ALIGN_BASELINE = 64
35
+
36
+ # NVGblendFactor
37
+ ZERO = 1 << 0
38
+ ONE = 1 << 1
39
+ SRC_COLOR = 1 << 2
40
+ ONE_MINUS_SRC_COLOR = 1 << 3
41
+ DST_COLOR = 1 << 4
42
+ ONE_MINUS_DST_COLOR = 1 << 5
43
+ SRC_ALPHA = 1 << 6
44
+ ONE_MINUS_SRC_ALPHA = 1 << 7
45
+ DST_ALPHA = 1 << 8
46
+ ONE_MINUS_DST_ALPHA = 1 << 9
47
+ SRC_ALPHA_SATURATE = 1 << 10
48
+
49
+ # NVGcompositeOperation
50
+ SOURCE_OVER = 0
51
+ SOURCE_IN = 1
52
+ SOURCE_OUT = 2
53
+ ATOP = 3
54
+ DESTINATION_OVER = 4
55
+ DESTINATION_IN = 5
56
+ DESTINATION_OUT = 6
57
+ DESTINATION_ATOP = 7
58
+ LIGHTER = 8
59
+ COPY = 9
60
+ XOR = 10
61
+
62
+ # NVGimageFlags
63
+ IMAGE_GENERATE_MIPMAPS = 1
64
+ IMAGE_REPEATX = 2
65
+ IMAGE_REPEATY = 4
66
+ IMAGE_FLIPY = 8
67
+ IMAGE_PREMULTIPLIED = 16
68
+ IMAGE_NEAREST = 32
69
+
70
+ # NVGcreateFlags
71
+ ANTIALIAS = 1
72
+ STENCIL_STROKES = 2
73
+ DEBUG = 4
74
+
75
+ #
76
+ # struct
77
+ #
78
+
79
+ class Color < FFI::Struct
80
+ layout(
81
+ :rgba, [:float, 4]
82
+ )
83
+ end
84
+
85
+ class Paint < FFI::Struct
86
+ layout(
87
+ :xform, [:float, 6],
88
+ :extent, [:float, 2],
89
+ :radius, :float,
90
+ :feather, :float,
91
+ :innerColor, Color,
92
+ :outerColor, Color,
93
+ :image, :int32
94
+ )
95
+ end
96
+
97
+ class CompositeOperationState < FFI::Struct
98
+ layout(
99
+ :srcRGB, :int32,
100
+ :dstRGB, :int32,
101
+ :srcAlpha, :int32,
102
+ :dstAlpha, :int32
103
+ )
104
+ end
105
+
106
+ class GlyphPosition < FFI::Struct
107
+ layout(
108
+ :str, :pointer,
109
+ :x, :float,
110
+ :minx, :float,
111
+ :maxx, :float
112
+ )
113
+ end
114
+
115
+ class TextRow < FFI::Struct
116
+ layout(
117
+ :start, :pointer,
118
+ :end, :pointer,
119
+ :next, :pointer,
120
+ :width, :float,
121
+ :minx, :float,
122
+ :maxx, :float
123
+ )
124
+ end
125
+
126
+ #
127
+ # Load native library.
128
+ #
129
+ @@nanovg_import_done = false
130
+
131
+ def self.load_lib(libpath = './libnanovg.dylib', render_backend: :gl2)
132
+ ffi_lib_flags :now, :global # to force FFI to access nvgCreateInternal from nvgCreateGL2
133
+ ffi_lib libpath
134
+ import_symbols(render_backend) unless @@nanovg_import_done
135
+ end
136
+
137
+ def self.import_symbols(render_backend)
138
+ #
139
+ # Common API
140
+ #
141
+ attach_function :BeginFrame, :nvgBeginFrame, [:pointer, :float, :float, :float], :void
142
+ attach_function :CancelFrame, :nvgCancelFrame, [:pointer], :void
143
+ attach_function :EndFrame, :nvgEndFrame, [:pointer], :void
144
+
145
+ attach_function :GlobalCompositeOperation, :nvgGlobalCompositeOperation, [:pointer, :int32], :void
146
+ attach_function :GlobalCompositeBlendFunc, :nvgGlobalCompositeBlendFunc, [:pointer, :int32, :int32], :void
147
+ attach_function :GlobalCompositeBlendFuncSeparate, :nvgGlobalCompositeBlendFuncSeparate, [:pointer, :int32, :int32, :int32, :int32], :void
148
+
149
+ attach_function :RGB, :nvgRGB, [:uint8, :uint8, :uint8], Color.by_value
150
+ attach_function :RGBf, :nvgRGBf, [:float, :float, :float], Color.by_value
151
+ attach_function :RGBA, :nvgRGBA, [:uint8, :uint8, :uint8, :uint8], Color.by_value
152
+ attach_function :RGBAf, :nvgRGBAf, [:float, :float, :float, :float], Color.by_value
153
+
154
+ attach_function :LerpRGBA, :nvgLerpRGBA, [Color.by_value, Color.by_value, :float], Color.by_value
155
+ attach_function :TransRGBA, :nvgTransRGBA, [Color.by_value, :uint8], Color.by_value
156
+ attach_function :TransRGBAf, :nvgTransRGBAf, [Color.by_value, :float], Color.by_value
157
+ attach_function :HSL, :nvgHSL, [:float, :float, :float], Color.by_value
158
+ attach_function :HSLA, :nvgHSLA, [:float, :float, :float, :uint8], Color.by_value
159
+
160
+ attach_function :Save, :nvgSave, [:pointer], :void
161
+ attach_function :Restore, :nvgRestore, [:pointer], :void
162
+ attach_function :Reset, :nvgReset, [:pointer], :void
163
+
164
+ attach_function :ShapeAntiAlias, :nvgShapeAntiAlias, [:pointer, Color.by_value], :void
165
+ attach_function :StrokeColor, :nvgStrokeColor, [:pointer, Color.by_value], :void
166
+ attach_function :StrokePaint, :nvgStrokePaint, [:pointer, Paint.by_value], :void
167
+ attach_function :FillColor, :nvgFillColor, [:pointer, Color.by_value], :void
168
+ attach_function :FillPaint, :nvgFillPaint, [:pointer, Paint.by_value], :void
169
+ attach_function :MiterLimit, :nvgMiterLimit, [:pointer, :float], :void
170
+ attach_function :StrokeWidth, :nvgStrokeWidth, [:pointer, :float], :void
171
+ attach_function :LineCap, :nvgLineCap, [:pointer, :int32], :void
172
+ attach_function :LineJoin, :nvgLineJoin, [:pointer, :int32], :void
173
+ attach_function :GlobalAlpha, :nvgGlobalAlpha, [:pointer, :float], :void
174
+
175
+ attach_function :ResetTransform, :nvgResetTransform, [:pointer], :void
176
+ attach_function :Transform, :nvgTransform, [:pointer, :float, :float, :float, :float, :float, :float], :void
177
+ attach_function :Translate, :nvgTranslate, [:pointer, :float, :float], :void
178
+ attach_function :Rotate, :nvgRotate, [:pointer, :float], :void
179
+ attach_function :SkewX, :nvgSkewX, [:pointer, :float], :void
180
+ attach_function :SkewY, :nvgSkewY, [:pointer, :float], :void
181
+ attach_function :Scale, :nvgScale, [:pointer, :float, :float], :void
182
+ attach_function :CurrentTransform, :nvgCurrentTransform, [:pointer, :pointer], :void
183
+
184
+ attach_function :TransformIdentity, :nvgTransformIdentity, [:pointer], :void
185
+ attach_function :TransformTranslate, :nvgTransformTranslate, [:pointer, :float, :float], :void
186
+ attach_function :TransformScale, :nvgTransformScale, [:pointer, :float, :float], :void
187
+ attach_function :TransformRotate, :nvgTransformRotate, [:pointer, :float], :void
188
+ attach_function :TransformSkewX, :nvgTransformSkewX, [:pointer, :float], :void
189
+ attach_function :TransformSkewY, :nvgTransformSkewY, [:pointer, :float], :void
190
+ attach_function :TransformMultiply, :nvgTransformMultiply, [:pointer, :pointer], :void
191
+ attach_function :TransformPremultiply, :nvgTransformPremultiply, [:pointer, :pointer], :void
192
+ attach_function :TransformInverse, :nvgTransformInverse, [:pointer, :pointer], :int32
193
+ attach_function :TransformPoint, :nvgTransformPoint, [:pointer, :pointer, :pointer, :float, :float], :void
194
+
195
+ attach_function :DegToRad, :nvgDegToRad, [:float], :float
196
+ attach_function :RadToDeg, :nvgRadToDeg, [:float], :float
197
+
198
+ attach_function :CreateImage, :nvgCreateImage, [:pointer, :pointer, :int32], :int32
199
+ attach_function :CreateImageMem, :nvgCreateImageMem, [:pointer, :int32, :pointer, :int32], :int32
200
+ attach_function :CreateImageRGBA, :nvgCreateImageRGBA, [:pointer, :int32, :int32, :int32, :pointer], :int32
201
+ attach_function :UpdateImage, :nvgUpdateImage, [:pointer, :int32, :pointer], :void
202
+ attach_function :ImageSize, :nvgImageSize, [:pointer, :int32, :pointer, :pointer], :void
203
+ attach_function :DeleteImage, :nvgDeleteImage, [:pointer, :int32], :void
204
+
205
+ attach_function :LinearGradient, :nvgLinearGradient, [:pointer, :float, :float, :float, :float, Color.by_value, Color.by_value], Paint.by_value
206
+ attach_function :BoxGradient, :nvgBoxGradient, [:pointer, :float, :float, :float, :float, :float, :float, Color.by_value, Color.by_value], Paint.by_value
207
+ attach_function :RadialGradient, :nvgRadialGradient, [:pointer, :float, :float, :float, :float, Color.by_value, Color.by_value], Paint.by_value
208
+ attach_function :ImagePattern, :nvgImagePattern, [:pointer, :float, :float, :float, :float, :float, :int32, :float], Paint.by_value
209
+
210
+ attach_function :Scissor, :nvgScissor, [:pointer, :float, :float, :float, :float], :void
211
+ attach_function :IntersectScissor, :nvgIntersectScissor, [:pointer, :float, :float, :float, :float], :void
212
+ attach_function :ResetScissor, :nvgResetScissor, [:pointer], :void
213
+
214
+ attach_function :BeginPath, :nvgBeginPath, [:pointer], :void
215
+ attach_function :MoveTo, :nvgMoveTo, [:pointer, :float, :float], :void
216
+ attach_function :LineTo, :nvgLineTo, [:pointer, :float, :float], :void
217
+ attach_function :BezierTo, :nvgBezierTo, [:pointer, :float, :float, :float, :float, :float, :float], :void
218
+ attach_function :QuadTo, :nvgQuadTo, [:pointer, :float, :float, :float, :float], :void
219
+ attach_function :ArcTo, :nvgArcTo, [:pointer, :float, :float, :float, :float, :float], :void
220
+ attach_function :ClosePath, :nvgClosePath, [:pointer], :void
221
+ attach_function :PathWinding, :nvgPathWinding, [:pointer, :int32], :void
222
+ attach_function :Arc, :nvgArc, [:pointer, :float, :float, :float, :float, :float, :int32], :void
223
+ attach_function :Rect, :nvgRect, [:pointer, :float, :float, :float, :float], :void
224
+ attach_function :RoundedRect, :nvgRoundedRect, [:pointer, :float, :float, :float, :float, :float], :void
225
+ attach_function :RoundedRectVarying, :nvgRoundedRectVarying, [:pointer, :float, :float, :float, :float, :float, :float, :float, :float], :void
226
+ attach_function :Ellipse, :nvgEllipse, [:pointer, :float, :float, :float, :float], :void
227
+ attach_function :Circle, :nvgCircle, [:pointer, :float, :float, :float], :void
228
+ attach_function :Fill, :nvgFill, [:pointer], :void
229
+ attach_function :Stroke, :nvgStroke, [:pointer], :void
230
+
231
+ attach_function :CreateFont, :nvgCreateFont, [:pointer, :pointer, :pointer], :int32
232
+ attach_function :CreateFontMem, :nvgCreateFontMem, [:pointer, :pointer, :pointer, :int32, :int32], :int32
233
+ attach_function :FindFont, :nvgFindFont, [:pointer, :pointer], :int32
234
+ attach_function :AddFallbackFontId, :nvgAddFallbackFontId, [:pointer, :int32, :int32], :int32
235
+ attach_function :AddFallbackFont, :nvgAddFallbackFont, [:pointer, :pointer, :pointer], :int32
236
+ attach_function :FontSize, :nvgFontSize, [:pointer, :float], :void
237
+ attach_function :FontBlur, :nvgFontBlur, [:pointer, :float], :void
238
+ attach_function :TextLetterSpacing, :nvgTextLetterSpacing, [:pointer, :float], :void
239
+ attach_function :TextLineHeight, :nvgTextLineHeight, [:pointer, :float], :void
240
+ attach_function :TextAlign, :nvgTextAlign, [:pointer, :int32], :void
241
+ attach_function :FontFaceId, :nvgFontFaceId, [:pointer, :int32], :void
242
+ attach_function :FontFace, :nvgFontFace, [:pointer, :pointer], :void
243
+ attach_function :Text, :nvgText, [:pointer, :float, :float, :pointer, :pointer], :float
244
+ attach_function :TextBox, :nvgTextBox, [:pointer, :float, :float, :float, :pointer, :pointer], :void
245
+ attach_function :TextBounds, :nvgTextBounds, [:pointer, :float, :float, :pointer, :pointer, :pointer], :float
246
+ attach_function :TextBoxBounds, :nvgTextBoxBounds, [:pointer, :float, :float, :float, :pointer, :pointer, :pointer], :void
247
+ attach_function :TextGlyphPositions, :nvgTextGlyphPositions, [:pointer, :float, :float, :pointer, :pointer, :pointer, :int32], :int32
248
+ attach_function :TextMetrics, :nvgTextMetrics, [:pointer, :pointer, :pointer, :pointer], :void
249
+ attach_function :TextBreakLines, :nvgTextBreakLines, [:pointer, :pointer, :pointer, :float, :pointer, :int32], :int32
250
+
251
+ #
252
+ # GL2-specific API (nanovg_gl)
253
+ #
254
+ if render_backend == :gl2
255
+ attach_function :CreateGL2, :nvgCreateGL2, [:int32], :pointer
256
+ attach_function :DeleteGL2, :nvgDeleteGL2, [:pointer], :void
257
+ attach_function :SetupGL2, :nvgSetupGL2, [], :void
258
+ end
259
+
260
+ #
261
+ # GL3-specific API (nanovg_gl)
262
+ #
263
+ if render_backend == :gl3
264
+ attach_function :CreateGL3, :nvgCreateGL3, [:int32], :pointer
265
+ attach_function :DeleteGL3, :nvgDeleteGL3, [:pointer], :void
266
+ attach_function :SetupGL3, :nvgSetupGL3, [], :void
267
+ end
268
+
269
+ @@nanovg_import_done = true
270
+ end
271
+ end
272
+
273
+ =begin
274
+ NanoVG-Bindings : A Ruby bindings of NanoVG
275
+ Copyright (c) 2015-2022 vaiorabbit
276
+
277
+ This software is provided 'as-is', without any express or implied
278
+ warranty. In no event will the authors be held liable for any damages
279
+ arising from the use of this software.
280
+
281
+ Permission is granted to anyone to use this software for any purpose,
282
+ including commercial applications, and to alter it and redistribute it
283
+ freely, subject to the following restrictions:
284
+
285
+ 1. The origin of this software must not be misrepresented; you must not
286
+ claim that you wrote the original software. If you use this software
287
+ in a product, an acknowledgment in the product documentation would be
288
+ appreciated but is not required.
289
+
290
+ 2. Altered source versions must be plainly marked as such, and must not be
291
+ misrepresented as being the original software.
292
+
293
+ 3. This notice may not be removed or altered from any source
294
+ distribution.
295
+ =end
metadata ADDED
@@ -0,0 +1,79 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: nanovg-bindings
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: aarch64-linux
6
+ authors:
7
+ - vaiorabbit
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2024-01-05 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: ffi
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.16'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.16'
27
+ - !ruby/object:Gem::Dependency
28
+ name: opengl-bindings2
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2'
41
+ description: 'Ruby bindings for NanoVG ( https://github.com/memononen/nanovg ).
42
+
43
+ '
44
+ email:
45
+ - vaiorabbit@gmail.com
46
+ executables: []
47
+ extensions: []
48
+ extra_rdoc_files: []
49
+ files:
50
+ - ChangeLog
51
+ - LICENSE.txt
52
+ - README.md
53
+ - lib/libnanovg_gl2.aarch64.so
54
+ - lib/libnanovg_gl3.aarch64.so
55
+ - lib/nanovg.rb
56
+ homepage: https://github.com/vaiorabbit/nanovg-bindings
57
+ licenses:
58
+ - Zlib
59
+ metadata: {}
60
+ post_install_message:
61
+ rdoc_options: []
62
+ require_paths:
63
+ - lib
64
+ required_ruby_version: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: 3.0.0
69
+ required_rubygems_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ requirements: []
75
+ rubygems_version: 3.5.3
76
+ signing_key:
77
+ specification_version: 4
78
+ summary: Bindings for NanoVG
79
+ test_files: []