raylib-bindings 0.1.4 → 0.2.0
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/ChangeLog +10 -0
- data/LICENSE.txt +1 -1
- data/README.md +16 -5
- data/examples/template.rb +24 -22
- data/lib/config.rb +98 -0
- data/lib/physac.rb +6 -8
- data/lib/raygui.rb +56 -9
- data/lib/raylib.rb +27 -146
- data/lib/raylib_helper.rb +419 -0
- data/lib/raylib_main.rb +68 -21
- data/lib/raymath.rb +115 -119
- data/lib/rlgl.rb +47 -25
- metadata +5 -3
data/lib/rlgl.rb
CHANGED
@@ -13,13 +13,6 @@ module Raylib
|
|
13
13
|
|
14
14
|
RLGL_VERSION = "4.0"
|
15
15
|
RL_DEFAULT_BATCH_BUFFER_ELEMENTS = 8192
|
16
|
-
RL_DEFAULT_BATCH_BUFFERS = 1 # Default number of batch buffers (multi-buffering)
|
17
|
-
RL_DEFAULT_BATCH_DRAWCALLS = 256 # Default number of batch draw calls (by state changes: mode, texture)
|
18
|
-
RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS = 4 # Maximum number of textures units that can be activated on batch drawing (SetShaderValueTexture())
|
19
|
-
RL_MAX_MATRIX_STACK_SIZE = 32 # Maximum size of Matrix stack
|
20
|
-
RL_MAX_SHADER_LOCATIONS = 32 # Maximum number of shader locations supported
|
21
|
-
RL_CULL_DISTANCE_NEAR = 0.01 # Default near cull distance
|
22
|
-
RL_CULL_DISTANCE_FAR = 1000.0 # Default far cull distance
|
23
16
|
RL_TEXTURE_WRAP_S = 0x2802 # GL_TEXTURE_WRAP_S
|
24
17
|
RL_TEXTURE_WRAP_T = 0x2803 # GL_TEXTURE_WRAP_T
|
25
18
|
RL_TEXTURE_MAG_FILTER = 0x2800 # GL_TEXTURE_MAG_FILTER
|
@@ -85,11 +78,16 @@ module Raylib
|
|
85
78
|
|
86
79
|
# Enum
|
87
80
|
|
81
|
+
# enum rlGlVersion
|
82
|
+
# OpenGL version
|
88
83
|
RL_OPENGL_11 = 1 # OpenGL 1.1
|
89
84
|
RL_OPENGL_21 = 2 # OpenGL 2.1 (GLSL 120)
|
90
85
|
RL_OPENGL_33 = 3 # OpenGL 3.3 (GLSL 330)
|
91
86
|
RL_OPENGL_43 = 4 # OpenGL 4.3 (using GLSL 330)
|
92
87
|
RL_OPENGL_ES_20 = 5 # OpenGL ES 2.0 (GLSL 100)
|
88
|
+
|
89
|
+
# enum rlTraceLogLevel
|
90
|
+
# Trace log level
|
93
91
|
RL_LOG_ALL = 0 # Display all logs
|
94
92
|
RL_LOG_TRACE = 1 # Trace logging, intended for internal use only
|
95
93
|
RL_LOG_DEBUG = 2 # Debug logging, used for internal debugging, it should be disabled on release builds
|
@@ -98,6 +96,9 @@ module Raylib
|
|
98
96
|
RL_LOG_ERROR = 5 # Error logging, used on unrecoverable failures
|
99
97
|
RL_LOG_FATAL = 6 # Fatal logging, used to abort program: exit(EXIT_FAILURE)
|
100
98
|
RL_LOG_NONE = 7 # Disable logging
|
99
|
+
|
100
|
+
# enum rlPixelFormat
|
101
|
+
# Texture pixel formats
|
101
102
|
RL_PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1 # 8 bit per pixel (no alpha)
|
102
103
|
RL_PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA = 2 # 8*2 bpp (2 channels)
|
103
104
|
RL_PIXELFORMAT_UNCOMPRESSED_R5G6B5 = 3 # 16 bpp
|
@@ -119,12 +120,18 @@ module Raylib
|
|
119
120
|
RL_PIXELFORMAT_COMPRESSED_PVRT_RGBA = 19 # 4 bpp
|
120
121
|
RL_PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA = 20 # 8 bpp
|
121
122
|
RL_PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA = 21 # 2 bpp
|
123
|
+
|
124
|
+
# enum rlTextureFilter
|
125
|
+
# Texture parameters: filter mode
|
122
126
|
RL_TEXTURE_FILTER_POINT = 0 # No filter, just pixel approximation
|
123
127
|
RL_TEXTURE_FILTER_BILINEAR = 1 # Linear filtering
|
124
128
|
RL_TEXTURE_FILTER_TRILINEAR = 2 # Trilinear filtering (linear with mipmaps)
|
125
129
|
RL_TEXTURE_FILTER_ANISOTROPIC_4X = 3 # Anisotropic filtering 4x
|
126
130
|
RL_TEXTURE_FILTER_ANISOTROPIC_8X = 4 # Anisotropic filtering 8x
|
127
131
|
RL_TEXTURE_FILTER_ANISOTROPIC_16X = 5 # Anisotropic filtering 16x
|
132
|
+
|
133
|
+
# enum rlBlendMode
|
134
|
+
# Color blending modes (pre-defined)
|
128
135
|
RL_BLEND_ALPHA = 0 # Blend textures considering alpha (default)
|
129
136
|
RL_BLEND_ADDITIVE = 1 # Blend textures adding colors
|
130
137
|
RL_BLEND_MULTIPLIED = 2 # Blend textures multiplying colors
|
@@ -133,6 +140,9 @@ module Raylib
|
|
133
140
|
RL_BLEND_ALPHA_PREMULTIPLY = 5 # Blend premultiplied textures considering alpha
|
134
141
|
RL_BLEND_CUSTOM = 6 # Blend textures using custom src/dst factors (use rlSetBlendFactors())
|
135
142
|
RL_BLEND_CUSTOM_SEPARATE = 7 # Blend textures using custom src/dst factors (use rlSetBlendFactorsSeparate())
|
143
|
+
|
144
|
+
# enum rlShaderLocationIndex
|
145
|
+
# Shader location point type
|
136
146
|
RL_SHADER_LOC_VERTEX_POSITION = 0 # Shader location: vertex attribute: position
|
137
147
|
RL_SHADER_LOC_VERTEX_TEXCOORD01 = 1 # Shader location: vertex attribute: texcoord01
|
138
148
|
RL_SHADER_LOC_VERTEX_TEXCOORD02 = 2 # Shader location: vertex attribute: texcoord02
|
@@ -159,6 +169,9 @@ module Raylib
|
|
159
169
|
RL_SHADER_LOC_MAP_IRRADIANCE = 23 # Shader location: samplerCube texture: irradiance
|
160
170
|
RL_SHADER_LOC_MAP_PREFILTER = 24 # Shader location: samplerCube texture: prefilter
|
161
171
|
RL_SHADER_LOC_MAP_BRDF = 25 # Shader location: sampler2d texture: brdf
|
172
|
+
|
173
|
+
# enum rlShaderUniformDataType
|
174
|
+
# Shader uniform data type
|
162
175
|
RL_SHADER_UNIFORM_FLOAT = 0 # Shader uniform type: float
|
163
176
|
RL_SHADER_UNIFORM_VEC2 = 1 # Shader uniform type: vec2 (2 float)
|
164
177
|
RL_SHADER_UNIFORM_VEC3 = 2 # Shader uniform type: vec3 (3 float)
|
@@ -168,10 +181,16 @@ module Raylib
|
|
168
181
|
RL_SHADER_UNIFORM_IVEC3 = 6 # Shader uniform type: ivec3 (3 int)
|
169
182
|
RL_SHADER_UNIFORM_IVEC4 = 7 # Shader uniform type: ivec4 (4 int)
|
170
183
|
RL_SHADER_UNIFORM_SAMPLER2D = 8 # Shader uniform type: sampler2d
|
184
|
+
|
185
|
+
# enum rlShaderAttributeDataType
|
186
|
+
# Shader attribute data types
|
171
187
|
RL_SHADER_ATTRIB_FLOAT = 0 # Shader attribute type: float
|
172
188
|
RL_SHADER_ATTRIB_VEC2 = 1 # Shader attribute type: vec2 (2 float)
|
173
189
|
RL_SHADER_ATTRIB_VEC3 = 2 # Shader attribute type: vec3 (3 float)
|
174
190
|
RL_SHADER_ATTRIB_VEC4 = 3 # Shader attribute type: vec4 (4 float)
|
191
|
+
|
192
|
+
# enum rlFramebufferAttachType
|
193
|
+
# Framebuffer attachment type
|
175
194
|
RL_ATTACHMENT_COLOR_CHANNEL0 = 0 # Framebuffer attachmment type: color 0
|
176
195
|
RL_ATTACHMENT_COLOR_CHANNEL1 = 1 # Framebuffer attachmment type: color 1
|
177
196
|
RL_ATTACHMENT_COLOR_CHANNEL2 = 2 # Framebuffer attachmment type: color 2
|
@@ -182,6 +201,9 @@ module Raylib
|
|
182
201
|
RL_ATTACHMENT_COLOR_CHANNEL7 = 7 # Framebuffer attachmment type: color 7
|
183
202
|
RL_ATTACHMENT_DEPTH = 100 # Framebuffer attachmment type: depth
|
184
203
|
RL_ATTACHMENT_STENCIL = 200 # Framebuffer attachmment type: stencil
|
204
|
+
|
205
|
+
# enum rlFramebufferAttachTextureType
|
206
|
+
# Framebuffer texture attachment type
|
185
207
|
RL_ATTACHMENT_CUBEMAP_POSITIVE_X = 0 # Framebuffer texture attachment type: cubemap, +X side
|
186
208
|
RL_ATTACHMENT_CUBEMAP_NEGATIVE_X = 1 # Framebuffer texture attachment type: cubemap, -X side
|
187
209
|
RL_ATTACHMENT_CUBEMAP_POSITIVE_Y = 2 # Framebuffer texture attachment type: cubemap, +Y side
|
@@ -190,9 +212,13 @@ module Raylib
|
|
190
212
|
RL_ATTACHMENT_CUBEMAP_NEGATIVE_Z = 5 # Framebuffer texture attachment type: cubemap, -Z side
|
191
213
|
RL_ATTACHMENT_TEXTURE2D = 100 # Framebuffer texture attachment type: texture2d
|
192
214
|
RL_ATTACHMENT_RENDERBUFFER = 200 # Framebuffer texture attachment type: renderbuffer
|
215
|
+
|
216
|
+
# enum rlCullMode
|
217
|
+
# Face culling mode
|
193
218
|
RL_CULL_FACE_FRONT = 0
|
194
219
|
RL_CULL_FACE_BACK = 1
|
195
220
|
|
221
|
+
|
196
222
|
# Typedef
|
197
223
|
|
198
224
|
typedef :int, :rlGlVersion
|
@@ -247,7 +273,7 @@ module Raylib
|
|
247
273
|
|
248
274
|
# Function
|
249
275
|
|
250
|
-
def self.setup_rlgl_symbols
|
276
|
+
def self.setup_rlgl_symbols
|
251
277
|
entries = [
|
252
278
|
|
253
279
|
# rlMatrixMode : Choose the current matrix to be transformed
|
@@ -294,7 +320,7 @@ module Raylib
|
|
294
320
|
# @return [void]
|
295
321
|
[:rlMultMatrixf, :rlMultMatrixf, [:pointer], :void],
|
296
322
|
|
297
|
-
# rlFrustum
|
323
|
+
# rlFrustum
|
298
324
|
# @param left [double]
|
299
325
|
# @param right [double]
|
300
326
|
# @param bottom [double]
|
@@ -304,7 +330,7 @@ module Raylib
|
|
304
330
|
# @return [void]
|
305
331
|
[:rlFrustum, :rlFrustum, [:double, :double, :double, :double, :double, :double], :void],
|
306
332
|
|
307
|
-
# rlOrtho
|
333
|
+
# rlOrtho
|
308
334
|
# @param left [double]
|
309
335
|
# @param right [double]
|
310
336
|
# @param bottom [double]
|
@@ -722,17 +748,17 @@ module Raylib
|
|
722
748
|
# @return [void]
|
723
749
|
[:rlUpdateVertexBufferElements, :rlUpdateVertexBufferElements, [:uint, :pointer, :int, :int], :void],
|
724
750
|
|
725
|
-
# rlUnloadVertexArray
|
751
|
+
# rlUnloadVertexArray
|
726
752
|
# @param vaoId [unsigned int]
|
727
753
|
# @return [void]
|
728
754
|
[:rlUnloadVertexArray, :rlUnloadVertexArray, [:uint], :void],
|
729
755
|
|
730
|
-
# rlUnloadVertexBuffer
|
756
|
+
# rlUnloadVertexBuffer
|
731
757
|
# @param vboId [unsigned int]
|
732
758
|
# @return [void]
|
733
759
|
[:rlUnloadVertexBuffer, :rlUnloadVertexBuffer, [:uint], :void],
|
734
760
|
|
735
|
-
# rlSetVertexAttribute
|
761
|
+
# rlSetVertexAttribute
|
736
762
|
# @param index [unsigned int]
|
737
763
|
# @param compSize [int]
|
738
764
|
# @param type [int]
|
@@ -742,7 +768,7 @@ module Raylib
|
|
742
768
|
# @return [void]
|
743
769
|
[:rlSetVertexAttribute, :rlSetVertexAttribute, [:uint, :int, :int, :bool, :int, :pointer], :void],
|
744
770
|
|
745
|
-
# rlSetVertexAttributeDivisor
|
771
|
+
# rlSetVertexAttributeDivisor
|
746
772
|
# @param index [unsigned int]
|
747
773
|
# @param divisor [int]
|
748
774
|
# @return [void]
|
@@ -756,27 +782,27 @@ module Raylib
|
|
756
782
|
# @return [void]
|
757
783
|
[:rlSetVertexAttributeDefault, :rlSetVertexAttributeDefault, [:int, :pointer, :int, :int], :void],
|
758
784
|
|
759
|
-
# rlDrawVertexArray
|
785
|
+
# rlDrawVertexArray
|
760
786
|
# @param offset [int]
|
761
787
|
# @param count [int]
|
762
788
|
# @return [void]
|
763
789
|
[:rlDrawVertexArray, :rlDrawVertexArray, [:int, :int], :void],
|
764
790
|
|
765
|
-
# rlDrawVertexArrayElements
|
791
|
+
# rlDrawVertexArrayElements
|
766
792
|
# @param offset [int]
|
767
793
|
# @param count [int]
|
768
794
|
# @param buffer [const void *]
|
769
795
|
# @return [void]
|
770
796
|
[:rlDrawVertexArrayElements, :rlDrawVertexArrayElements, [:int, :int, :pointer], :void],
|
771
797
|
|
772
|
-
# rlDrawVertexArrayInstanced
|
798
|
+
# rlDrawVertexArrayInstanced
|
773
799
|
# @param offset [int]
|
774
800
|
# @param count [int]
|
775
801
|
# @param instances [int]
|
776
802
|
# @return [void]
|
777
803
|
[:rlDrawVertexArrayInstanced, :rlDrawVertexArrayInstanced, [:int, :int, :int], :void],
|
778
804
|
|
779
|
-
# rlDrawVertexArrayElementsInstanced
|
805
|
+
# rlDrawVertexArrayElementsInstanced
|
780
806
|
# @param offset [int]
|
781
807
|
# @param count [int]
|
782
808
|
# @param buffer [const void *]
|
@@ -1066,13 +1092,9 @@ module Raylib
|
|
1066
1092
|
[:rlLoadDrawQuad, :rlLoadDrawQuad, [], :void],
|
1067
1093
|
]
|
1068
1094
|
entries.each do |entry|
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
$stderr.puts("[Warning] Failed to import #{entry[0]} (#{error}).") if output_error
|
1073
|
-
end
|
1095
|
+
attach_function entry[0], entry[1], entry[2], entry[3]
|
1096
|
+
rescue FFI::NotFoundError => e
|
1097
|
+
warn "[Warning] Failed to import #{entry[0]} (#{e})."
|
1074
1098
|
end
|
1075
1099
|
end
|
1076
|
-
|
1077
1100
|
end
|
1078
|
-
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: raylib-bindings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vaiorabbit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-12-
|
11
|
+
date: 2022-12-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|
@@ -51,6 +51,7 @@ files:
|
|
51
51
|
- LICENSE.txt
|
52
52
|
- README.md
|
53
53
|
- examples/template.rb
|
54
|
+
- lib/config.rb
|
54
55
|
- lib/libraylib.dll
|
55
56
|
- lib/libraylib.dylib
|
56
57
|
- lib/physac.dll
|
@@ -60,6 +61,7 @@ files:
|
|
60
61
|
- lib/raygui.dylib
|
61
62
|
- lib/raygui.rb
|
62
63
|
- lib/raylib.rb
|
64
|
+
- lib/raylib_helper.rb
|
63
65
|
- lib/raylib_main.rb
|
64
66
|
- lib/raymath.rb
|
65
67
|
- lib/rlgl.rb
|
@@ -82,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
82
84
|
- !ruby/object:Gem::Version
|
83
85
|
version: '0'
|
84
86
|
requirements: []
|
85
|
-
rubygems_version: 3.
|
87
|
+
rubygems_version: 3.4.1
|
86
88
|
signing_key:
|
87
89
|
specification_version: 4
|
88
90
|
summary: Provides latest raylib API for Ruby
|