nanovg-bindings 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/ChangeLog +57 -0
- data/LICENSE.txt +21 -0
- data/README.md +60 -0
- data/lib/libnanovg_gl2.dll +0 -0
- data/lib/libnanovg_gl2.dylib +0 -0
- data/lib/libnanovg_gl3.dll +0 -0
- data/lib/libnanovg_gl3.dylib +0 -0
- data/lib/nanovg.rb +295 -0
- metadata +53 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: c7e8c5be891171a53172368b4a2f9218d993e9be5b087f5fcc8a878312a56858
|
4
|
+
data.tar.gz: 9c33d617510b7e0cb2403365676663268251d07910ff6e09f3affb65657c60dc
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 5974fb38d3219d91c4ecbc262df860e392e3d922f0d6966df52011a2ce2d740691c82150ff68e5f1df65c0eaaa795ec89d147e85a1de7505212e009ddb17fd71
|
7
|
+
data.tar.gz: c6c799cfa0a311a0690c31cea55f2a03c78e4a46740cf476fb977f0ba916305bdb7ee6ff7afd916b7929bd3ae3cf09d1305cb97c007f7f0b72a4c4dbb2e44584
|
data/ChangeLog
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
2022-01-01 vaiorabbit <http://twitter.com/vaiorabbit>
|
2
|
+
|
3
|
+
* nanovg-bindings.gemspec: Added
|
4
|
+
|
5
|
+
2021-12-31 vaiorabbit <http://twitter.com/vaiorabbit>
|
6
|
+
|
7
|
+
* libnanovg_gl2.dll, libnanovg_gl3.dll: Added Windows binary
|
8
|
+
* demo/util: Added for automatic library loading
|
9
|
+
* nanovg_dll/nanovg.c: Fixed for Windows build
|
10
|
+
|
11
|
+
2021-12-30 vaiorabbit <http://twitter.com/vaiorabbit>
|
12
|
+
|
13
|
+
* libnanovg_gl2.dylib, libnanovg_gl3.dylib: Built with latest nanovg ( https://github.com/memononen/nanovg/tree/645e9147a8701c98f52240257af0c9d5fa640e86 )
|
14
|
+
* nanovg_dll: Use CMake / Scripts are now M1 mac ready
|
15
|
+
* demo: Reorganized directory structure / Added several codes to run hole_polygon.ry demo / Fixed qrc.rb for the latest RQRCoce library
|
16
|
+
|
17
|
+
2018-10-20 vaiorabbit <http://twitter.com/vaiorabbit>
|
18
|
+
|
19
|
+
* nanovg.rb: Now compatible with the latest APIs (NanoVG Commit f4069e6a1ad5da430fb0a9c57476d5ddc2ff89b2 https://github.com/memononen/nanovg/commit/f4069e6a1ad5da430fb0a9c57476d5ddc2ff89b2 ).
|
20
|
+
|
21
|
+
2017-07-22 vaiorabbit <http://twitter.com/vaiorabbit>
|
22
|
+
|
23
|
+
* nanovg.rb: Now compatible with the latest APIs (NanoVG Commit 30e1c98175b30bcfd8f979f0813a97333329dfe2 https://github.com/memononen/nanovg/commit/30e1c98175b30bcfd8f979f0813a97333329dfe2).
|
24
|
+
|
25
|
+
2017-03-21 vaiorabbit <http://twitter.com/vaiorabbit>
|
26
|
+
|
27
|
+
* nanovg.rb: Now compatible with the latest APIs (NanoVG Commit c75fc0bfcf3a72fb61dcd46df0522a60b59c6cc2 https://github.com/memononen/nanovg/commit/c75fc0bfcf3a72fb61dcd46df0522a60b59c6cc2).
|
28
|
+
|
29
|
+
2016-12-03 vaiorabbit <http://twitter.com/vaiorabbit>
|
30
|
+
|
31
|
+
* nanovg.rb, nanovg_dll: Now compatible with the latest APIs (NanoVG Commit cacb00b852079db23c180f2e6cbff41eef673783).
|
32
|
+
* demo/emojifont.rb, etc.: Added.
|
33
|
+
|
34
|
+
2016-08-17 vaiorabbit <http://twitter.com/vaiorabbit>
|
35
|
+
|
36
|
+
* nanovg.rb, nanovg_dll: Now compatible with the latest APIs (NanoVG Commit 09dc767e3f25ec97e7398c18eca6a4c6bb3763f5).
|
37
|
+
|
38
|
+
2015-09-07 vaiorabbit <http://twitter.com/vaiorabbit>
|
39
|
+
|
40
|
+
* demo: Removed some uninformative samples.
|
41
|
+
|
42
|
+
2015-08-22 vaiorabbit
|
43
|
+
|
44
|
+
* nanovg_dll.c: Fixed include file name for Mac OS X.
|
45
|
+
|
46
|
+
2015-07-16 vaiorabbit
|
47
|
+
|
48
|
+
* demo/qrc.rb: Added.
|
49
|
+
|
50
|
+
2015-07-13 vaiorabbit
|
51
|
+
|
52
|
+
* nanovg.rb, nanovg_dll.c (nvgSetupGL2, nvgSetupGL3): Minimal OpenGL proc-address setup function (mainly for Windows)
|
53
|
+
* nanovg_dll (nanovg_gl2.def, nanovg_gl3.def): Module definition file to build DLLs on Visual Studio.
|
54
|
+
|
55
|
+
2015-07-12 vaiorabbit
|
56
|
+
|
57
|
+
* First release.
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
NanoVG-Bindings : A Ruby bindings of NanoVG
|
2
|
+
Copyright (c) 2015-2022 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 : 2022-01-01
|
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-2022 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
|
Binary file
|
Binary file
|
data/lib/nanovg.rb
ADDED
@@ -0,0 +1,295 @@
|
|
1
|
+
require 'ffi'
|
2
|
+
|
3
|
+
module NanoVG
|
4
|
+
extend FFI::Library
|
5
|
+
|
6
|
+
#
|
7
|
+
# define/enum
|
8
|
+
#
|
9
|
+
|
10
|
+
# NVGwinding
|
11
|
+
NVG_CCW = 1
|
12
|
+
NVG_CW = 2
|
13
|
+
|
14
|
+
# NVGsolidity
|
15
|
+
NVG_SOLID = 1
|
16
|
+
NVG_HOLE = 2
|
17
|
+
|
18
|
+
# NVGlineCap
|
19
|
+
NVG_BUTT = 0
|
20
|
+
NVG_ROUND = 1
|
21
|
+
NVG_SQUARE = 2
|
22
|
+
NVG_BEVEL = 3
|
23
|
+
NVG_MITER = 4
|
24
|
+
|
25
|
+
# NVGalign
|
26
|
+
# Horizontal align
|
27
|
+
NVG_ALIGN_LEFT = 1
|
28
|
+
NVG_ALIGN_CENTER = 2
|
29
|
+
NVG_ALIGN_RIGHT = 4
|
30
|
+
# Vertical align
|
31
|
+
NVG_ALIGN_TOP = 8
|
32
|
+
NVG_ALIGN_MIDDLE = 16
|
33
|
+
NVG_ALIGN_BOTTOM = 32
|
34
|
+
NVG_ALIGN_BASELINE = 64
|
35
|
+
|
36
|
+
# NVGblendFactor
|
37
|
+
NVG_ZERO = 1 << 0
|
38
|
+
NVG_ONE = 1 << 1
|
39
|
+
NVG_SRC_COLOR = 1 << 2
|
40
|
+
NVG_ONE_MINUS_SRC_COLOR = 1 << 3
|
41
|
+
NVG_DST_COLOR = 1 << 4
|
42
|
+
NVG_ONE_MINUS_DST_COLOR = 1 << 5
|
43
|
+
NVG_SRC_ALPHA = 1 << 6
|
44
|
+
NVG_ONE_MINUS_SRC_ALPHA = 1 << 7
|
45
|
+
NVG_DST_ALPHA = 1 << 8
|
46
|
+
NVG_ONE_MINUS_DST_ALPHA = 1 << 9
|
47
|
+
NVG_SRC_ALPHA_SATURATE = 1 << 10
|
48
|
+
|
49
|
+
# NVGcompositeOperation
|
50
|
+
NVG_SOURCE_OVER = 0
|
51
|
+
NVG_SOURCE_IN = 1
|
52
|
+
NVG_SOURCE_OUT = 2
|
53
|
+
NVG_ATOP = 3
|
54
|
+
NVG_DESTINATION_OVER = 4
|
55
|
+
NVG_DESTINATION_IN = 5
|
56
|
+
NVG_DESTINATION_OUT = 6
|
57
|
+
NVG_DESTINATION_ATOP = 7
|
58
|
+
NVG_LIGHTER = 8
|
59
|
+
NVG_COPY = 9
|
60
|
+
NVG_XOR = 10
|
61
|
+
|
62
|
+
# NVGimageFlags
|
63
|
+
NVG_IMAGE_GENERATE_MIPMAPS = 1
|
64
|
+
NVG_IMAGE_REPEATX = 2
|
65
|
+
NVG_IMAGE_REPEATY = 4
|
66
|
+
NVG_IMAGE_FLIPY = 8
|
67
|
+
NVG_IMAGE_PREMULTIPLIED = 16
|
68
|
+
NVG_IMAGE_NEAREST = 32
|
69
|
+
|
70
|
+
# NVGcreateFlags
|
71
|
+
NVG_ANTIALIAS = 1
|
72
|
+
NVG_STENCIL_STROKES = 2
|
73
|
+
NVG_DEBUG = 4
|
74
|
+
|
75
|
+
#
|
76
|
+
# struct
|
77
|
+
#
|
78
|
+
|
79
|
+
class NVGcolor < FFI::Struct
|
80
|
+
layout(
|
81
|
+
:rgba, [:float, 4]
|
82
|
+
)
|
83
|
+
end
|
84
|
+
|
85
|
+
class NVGpaint < FFI::Struct
|
86
|
+
layout(
|
87
|
+
:xform, [:float, 6],
|
88
|
+
:extent, [:float, 2],
|
89
|
+
:radius, :float,
|
90
|
+
:feather, :float,
|
91
|
+
:innerColor, NVGcolor,
|
92
|
+
:outerColor, NVGcolor,
|
93
|
+
:image, :int32
|
94
|
+
)
|
95
|
+
end
|
96
|
+
|
97
|
+
class NVGcompositeOperationState < FFI::Struct
|
98
|
+
layout(
|
99
|
+
:srcRGB, :int32,
|
100
|
+
:dstRGB, :int32,
|
101
|
+
:srcAlpha, :int32,
|
102
|
+
:dstAlpha, :int32
|
103
|
+
)
|
104
|
+
end
|
105
|
+
|
106
|
+
class NVGglyphPosition < FFI::Struct
|
107
|
+
layout(
|
108
|
+
:str, :pointer,
|
109
|
+
:x, :float,
|
110
|
+
:minx, :float,
|
111
|
+
:maxx, :float
|
112
|
+
)
|
113
|
+
end
|
114
|
+
|
115
|
+
class NVGtextRow < 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 :nvgBeginFrame, :nvgBeginFrame, [:pointer, :float, :float, :float], :void
|
142
|
+
attach_function :nvgCancelFrame, :nvgCancelFrame, [:pointer], :void
|
143
|
+
attach_function :nvgEndFrame, :nvgEndFrame, [:pointer], :void
|
144
|
+
|
145
|
+
attach_function :nvgGlobalCompositeOperation, [:pointer, :int32], :void
|
146
|
+
attach_function :nvgGlobalCompositeBlendFunc, [:pointer, :int32, :int32], :void
|
147
|
+
attach_function :nvgGlobalCompositeBlendFuncSeparate, [:pointer, :int32, :int32, :int32, :int32], :void
|
148
|
+
|
149
|
+
attach_function :nvgRGB, :nvgRGB, [:uint8, :uint8, :uint8], NVGcolor.by_value
|
150
|
+
attach_function :nvgRGBf, :nvgRGBf, [:float, :float, :float], NVGcolor.by_value
|
151
|
+
attach_function :nvgRGBA, :nvgRGBA, [:uint8, :uint8, :uint8, :uint8], NVGcolor.by_value
|
152
|
+
attach_function :nvgRGBAf, :nvgRGBAf, [:float, :float, :float, :float], NVGcolor.by_value
|
153
|
+
|
154
|
+
attach_function :nvgLerpRGBA, :nvgLerpRGBA, [NVGcolor.by_value, NVGcolor.by_value, :float], NVGcolor.by_value
|
155
|
+
attach_function :nvgTransRGBA, :nvgTransRGBA, [NVGcolor.by_value, :uint8], NVGcolor.by_value
|
156
|
+
attach_function :nvgTransRGBAf, :nvgTransRGBAf, [NVGcolor.by_value, :float], NVGcolor.by_value
|
157
|
+
attach_function :nvgHSL, :nvgHSL, [:float, :float, :float], NVGcolor.by_value
|
158
|
+
attach_function :nvgHSLA, :nvgHSLA, [:float, :float, :float, :uint8], NVGcolor.by_value
|
159
|
+
|
160
|
+
attach_function :nvgSave, :nvgSave, [:pointer], :void
|
161
|
+
attach_function :nvgRestore, :nvgRestore, [:pointer], :void
|
162
|
+
attach_function :nvgReset, :nvgReset, [:pointer], :void
|
163
|
+
|
164
|
+
attach_function :nvgShapeAntiAlias, :nvgShapeAntiAlias, [:pointer, NVGcolor.by_value], :void
|
165
|
+
attach_function :nvgStrokeColor, :nvgStrokeColor, [:pointer, NVGcolor.by_value], :void
|
166
|
+
attach_function :nvgStrokePaint, [:pointer, NVGpaint.by_value], :void
|
167
|
+
attach_function :nvgFillColor, [:pointer, NVGcolor.by_value], :void
|
168
|
+
attach_function :nvgFillPaint, [:pointer, NVGpaint.by_value], :void
|
169
|
+
attach_function :nvgMiterLimit, [:pointer, :float], :void
|
170
|
+
attach_function :nvgStrokeWidth, [:pointer, :float], :void
|
171
|
+
attach_function :nvgLineCap, [:pointer, :int32], :void
|
172
|
+
attach_function :nvgLineJoin, [:pointer, :int32], :void
|
173
|
+
attach_function :nvgGlobalAlpha, [:pointer, :float], :void
|
174
|
+
|
175
|
+
attach_function :nvgResetTransform, :nvgResetTransform, [:pointer], :void
|
176
|
+
attach_function :nvgTransform, :nvgTransform, [:pointer, :float, :float, :float, :float, :float, :float], :void
|
177
|
+
attach_function :nvgTranslate, :nvgTranslate, [:pointer, :float, :float], :void
|
178
|
+
attach_function :nvgRotate, :nvgRotate, [:pointer, :float], :void
|
179
|
+
attach_function :nvgSkewX, :nvgSkewX, [:pointer, :float], :void
|
180
|
+
attach_function :nvgSkewY, :nvgSkewY, [:pointer, :float], :void
|
181
|
+
attach_function :nvgScale, :nvgScale, [:pointer, :float, :float], :void
|
182
|
+
attach_function :nvgCurrentTransform, :nvgCurrentTransform, [:pointer, :pointer], :void
|
183
|
+
|
184
|
+
attach_function :nvgTransformIdentity, :nvgTransformIdentity, [:pointer], :void
|
185
|
+
attach_function :nvgTransformTranslate, :nvgTransformTranslate, [:pointer, :float, :float], :void
|
186
|
+
attach_function :nvgTransformScale, :nvgTransformScale, [:pointer, :float, :float], :void
|
187
|
+
attach_function :nvgTransformRotate, :nvgTransformRotate, [:pointer, :float], :void
|
188
|
+
attach_function :nvgTransformSkewX, :nvgTransformSkewX, [:pointer, :float], :void
|
189
|
+
attach_function :nvgTransformSkewY, :nvgTransformSkewY, [:pointer, :float], :void
|
190
|
+
attach_function :nvgTransformMultiply, :nvgTransformMultiply, [:pointer, :pointer], :void
|
191
|
+
attach_function :nvgTransformPremultiply, :nvgTransformPremultiply, [:pointer, :pointer], :void
|
192
|
+
attach_function :nvgTransformInverse, :nvgTransformInverse, [:pointer, :pointer], :int32
|
193
|
+
attach_function :nvgTransformPoint, :nvgTransformPoint, [:pointer, :pointer, :pointer, :float, :float], :void
|
194
|
+
|
195
|
+
attach_function :nvgDegToRad, :nvgDegToRad, [:float], :float
|
196
|
+
attach_function :nvgRadToDeg, :nvgRadToDeg, [:float], :float
|
197
|
+
|
198
|
+
attach_function :nvgCreateImage, :nvgCreateImage, [:pointer, :pointer, :int32], :int32
|
199
|
+
attach_function :nvgCreateImageMem, :nvgCreateImageMem, [:pointer, :int32, :pointer, :int32], :int32
|
200
|
+
attach_function :nvgCreateImageRGBA, :nvgCreateImageRGBA, [:pointer, :int32, :int32, :int32, :pointer], :int32
|
201
|
+
attach_function :nvgUpdateImage, :nvgUpdateImage, [:pointer, :int32, :pointer], :void
|
202
|
+
attach_function :nvgImageSize, :nvgImageSize, [:pointer, :int32, :pointer, :pointer], :void
|
203
|
+
attach_function :nvgDeleteImage, :nvgDeleteImage, [:pointer, :int32], :void
|
204
|
+
|
205
|
+
attach_function :nvgLinearGradient, :nvgLinearGradient, [:pointer, :float, :float, :float, :float, NVGcolor.by_value, NVGcolor.by_value], NVGpaint.by_value
|
206
|
+
attach_function :nvgBoxGradient, :nvgBoxGradient, [:pointer, :float, :float, :float, :float, :float, :float, NVGcolor.by_value, NVGcolor.by_value], NVGpaint.by_value
|
207
|
+
attach_function :nvgRadialGradient, :nvgRadialGradient, [:pointer, :float, :float, :float, :float, NVGcolor.by_value, NVGcolor.by_value], NVGpaint.by_value
|
208
|
+
attach_function :nvgImagePattern, :nvgImagePattern, [:pointer, :float, :float, :float, :float, :float, :int32, :float], NVGpaint.by_value
|
209
|
+
|
210
|
+
attach_function :nvgScissor, :nvgScissor, [:pointer, :float, :float, :float, :float], :void
|
211
|
+
attach_function :nvgIntersectScissor, :nvgIntersectScissor, [:pointer, :float, :float, :float, :float], :void
|
212
|
+
attach_function :nvgResetScissor, :nvgResetScissor, [:pointer], :void
|
213
|
+
|
214
|
+
attach_function :nvgBeginPath, :nvgBeginPath, [:pointer], :void
|
215
|
+
attach_function :nvgMoveTo, :nvgMoveTo, [:pointer, :float, :float], :void
|
216
|
+
attach_function :nvgLineTo, :nvgLineTo, [:pointer, :float, :float], :void
|
217
|
+
attach_function :nvgBezierTo, :nvgBezierTo, [:pointer, :float, :float, :float, :float, :float, :float], :void
|
218
|
+
attach_function :nvgQuadTo, :nvgQuadTo, [:pointer, :float, :float, :float, :float], :void
|
219
|
+
attach_function :nvgArcTo, :nvgArcTo, [:pointer, :float, :float, :float, :float, :float], :void
|
220
|
+
attach_function :nvgClosePath, :nvgClosePath, [:pointer], :void
|
221
|
+
attach_function :nvgPathWinding, :nvgPathWinding, [:pointer, :int32], :void
|
222
|
+
attach_function :nvgArc, :nvgArc, [:pointer, :float, :float, :float, :float, :float, :int32], :void
|
223
|
+
attach_function :nvgRect, :nvgRect, [:pointer, :float, :float, :float, :float], :void
|
224
|
+
attach_function :nvgRoundedRect, :nvgRoundedRect, [:pointer, :float, :float, :float, :float, :float], :void
|
225
|
+
attach_function :nvgRoundedRectVarying, :nvgRoundedRectVarying, [:pointer, :float, :float, :float, :float, :float, :float, :float, :float], :void
|
226
|
+
attach_function :nvgEllipse, :nvgEllipse, [:pointer, :float, :float, :float, :float], :void
|
227
|
+
attach_function :nvgCircle, :nvgCircle, [:pointer, :float, :float, :float], :void
|
228
|
+
attach_function :nvgFill, :nvgFill, [:pointer], :void
|
229
|
+
attach_function :nvgStroke, :nvgStroke, [:pointer], :void
|
230
|
+
|
231
|
+
attach_function :nvgCreateFont, :nvgCreateFont, [:pointer, :pointer, :pointer], :int32
|
232
|
+
attach_function :nvgCreateFontMem, :nvgCreateFontMem, [:pointer, :pointer, :pointer, :int32, :int32], :int32
|
233
|
+
attach_function :nvgFindFont, :nvgFindFont, [:pointer, :pointer], :int32
|
234
|
+
attach_function :nvgAddFallbackFontId, :nvgAddFallbackFontId, [:pointer, :int32, :int32], :int32
|
235
|
+
attach_function :nvgAddFallbackFont, :nvgAddFallbackFont, [:pointer, :pointer, :pointer], :int32
|
236
|
+
attach_function :nvgFontSize, :nvgFontSize, [:pointer, :float], :void
|
237
|
+
attach_function :nvgFontBlur, :nvgFontBlur, [:pointer, :float], :void
|
238
|
+
attach_function :nvgTextLetterSpacing, :nvgTextLetterSpacing, [:pointer, :float], :void
|
239
|
+
attach_function :nvgTextLineHeight, :nvgTextLineHeight, [:pointer, :float], :void
|
240
|
+
attach_function :nvgTextAlign, :nvgTextAlign, [:pointer, :int32], :void
|
241
|
+
attach_function :nvgFontFaceId, :nvgFontFaceId, [:pointer, :int32], :void
|
242
|
+
attach_function :nvgFontFace, :nvgFontFace, [:pointer, :pointer], :void
|
243
|
+
attach_function :nvgText, :nvgText, [:pointer, :float, :float, :pointer, :pointer], :float
|
244
|
+
attach_function :nvgTextBox, :nvgTextBox, [:pointer, :float, :float, :float, :pointer, :pointer], :void
|
245
|
+
attach_function :nvgTextBounds, :nvgTextBounds, [:pointer, :float, :float, :pointer, :pointer, :pointer], :float
|
246
|
+
attach_function :nvgTextBoxBounds, :nvgTextBoxBounds, [:pointer, :float, :float, :float, :pointer, :pointer, :pointer], :void
|
247
|
+
attach_function :nvgTextGlyphPositions, :nvgTextGlyphPositions, [:pointer, :float, :float, :pointer, :pointer, :pointer, :int32], :int32
|
248
|
+
attach_function :nvgTextMetrics, :nvgTextMetrics, [:pointer, :pointer, :pointer, :pointer], :void
|
249
|
+
attach_function :nvgTextBreakLines, :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 :nvgCreateGL2, :nvgCreateGL2, [:int32], :pointer
|
256
|
+
attach_function :nvgDeleteGL2, :nvgDeleteGL2, [:pointer], :void
|
257
|
+
attach_function :nvgSetupGL2, :nvgSetupGL2, [], :void
|
258
|
+
end
|
259
|
+
|
260
|
+
#
|
261
|
+
# GL3-specific API (nanovg_gl)
|
262
|
+
#
|
263
|
+
if render_backend == :gl3
|
264
|
+
attach_function :nvgCreateGL3, :nvgCreateGL3, [:int32], :pointer
|
265
|
+
attach_function :nvgDeleteGL3, :nvgDeleteGL3, [:pointer], :void
|
266
|
+
attach_function :nvgSetupGL3, :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,53 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: nanovg-bindings
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- vaiorabbit
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2022-01-01 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: 'Ruby bindings for NanoVG.
|
14
|
+
|
15
|
+
'
|
16
|
+
email:
|
17
|
+
- vaiorabbit@gmail.com
|
18
|
+
executables: []
|
19
|
+
extensions: []
|
20
|
+
extra_rdoc_files: []
|
21
|
+
files:
|
22
|
+
- ChangeLog
|
23
|
+
- LICENSE.txt
|
24
|
+
- README.md
|
25
|
+
- lib/libnanovg_gl2.dll
|
26
|
+
- lib/libnanovg_gl2.dylib
|
27
|
+
- lib/libnanovg_gl3.dll
|
28
|
+
- lib/libnanovg_gl3.dylib
|
29
|
+
- lib/nanovg.rb
|
30
|
+
homepage: https://github.com/vaiorabbit/nanovg-bindings
|
31
|
+
licenses:
|
32
|
+
- Zlib
|
33
|
+
metadata: {}
|
34
|
+
post_install_message:
|
35
|
+
rdoc_options: []
|
36
|
+
require_paths:
|
37
|
+
- lib
|
38
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 2.6.0
|
43
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
requirements: []
|
49
|
+
rubygems_version: 3.3.3
|
50
|
+
signing_key:
|
51
|
+
specification_version: 4
|
52
|
+
summary: Bindings for NanoVG
|
53
|
+
test_files: []
|