raylib-bindings 0.3.0 → 0.5.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.
data/lib/raymath.rb CHANGED
@@ -23,12 +23,16 @@ module Raylib
23
23
  layout(
24
24
  :v, [:float, 3],
25
25
  )
26
+ def v = self[:v]
27
+ def v=(v) self[:v] = v end
26
28
  end
27
29
 
28
30
  class Float16 < FFI::Struct
29
31
  layout(
30
32
  :v, [:float, 16],
31
33
  )
34
+ def v = self[:v]
35
+ def v=(v) self[:v] = v end
32
36
  end
33
37
 
34
38
 
@@ -146,6 +150,12 @@ module Raylib
146
150
  # @return [float]
147
151
  [:Vector2Angle, :Vector2Angle, [Vector2.by_value, Vector2.by_value], :float],
148
152
 
153
+ # Vector2LineAngle
154
+ # @param start [Vector2]
155
+ # @param end [Vector2]
156
+ # @return [float]
157
+ [:Vector2LineAngle, :Vector2LineAngle, [Vector2.by_value, Vector2.by_value], :float],
158
+
149
159
  # Vector2Scale
150
160
  # @param v [Vector2]
151
161
  # @param scale [float]
data/lib/rcamera.rb ADDED
@@ -0,0 +1,79 @@
1
+ # Yet another raylib wrapper for Ruby
2
+ #
3
+ # * https://github.com/vaiorabbit/raylib-bindings
4
+ #
5
+ # [NOTICE] Autogenerated. Do not edit.
6
+
7
+ require 'ffi'
8
+
9
+ module Raylib
10
+ extend FFI::Library
11
+
12
+ # Define/Macro
13
+
14
+
15
+ # Typedef
16
+
17
+ typedef :int, :CameraMode
18
+ typedef :int, :CameraProjection
19
+
20
+ # Function
21
+
22
+ def self.setup_rcamera_symbols
23
+ entries = [
24
+
25
+ # GetCameraForward
26
+ # @return []
27
+ [:GetCameraForward, :GetCameraForward, [:pointer], Vector3.by_value],
28
+
29
+ # GetCameraUp
30
+ # @return []
31
+ [:GetCameraUp, :GetCameraUp, [:pointer], Vector3.by_value],
32
+
33
+ # GetCameraRight
34
+ # @return []
35
+ [:GetCameraRight, :GetCameraRight, [:pointer], Vector3.by_value],
36
+
37
+ # CameraMoveForward
38
+ # @return []
39
+ [:CameraMoveForward, :CameraMoveForward, [:pointer, :float, :bool], :void],
40
+
41
+ # CameraMoveUp
42
+ # @return []
43
+ [:CameraMoveUp, :CameraMoveUp, [:pointer, :float], :void],
44
+
45
+ # CameraMoveRight
46
+ # @return []
47
+ [:CameraMoveRight, :CameraMoveRight, [:pointer, :float, :bool], :void],
48
+
49
+ # CameraMoveToTarget
50
+ # @return []
51
+ [:CameraMoveToTarget, :CameraMoveToTarget, [:pointer, :float], :void],
52
+
53
+ # CameraYaw
54
+ # @return []
55
+ [:CameraYaw, :CameraYaw, [:pointer, :float, :bool], :void],
56
+
57
+ # CameraPitch
58
+ # @return []
59
+ [:CameraPitch, :CameraPitch, [:pointer, :float, :bool, :bool, :bool], :void],
60
+
61
+ # CameraRoll
62
+ # @return []
63
+ [:CameraRoll, :CameraRoll, [:pointer, :float], :void],
64
+
65
+ # GetCameraViewMatrix
66
+ # @return []
67
+ [:GetCameraViewMatrix, :GetCameraViewMatrix, [:pointer], :int],
68
+
69
+ # GetCameraProjectionMatrix
70
+ # @return []
71
+ [:GetCameraProjectionMatrix, :GetCameraProjectionMatrix, [:pointer, :float], :int],
72
+ ]
73
+ entries.each do |entry|
74
+ attach_function entry[0], entry[1], entry[2], entry[3]
75
+ rescue FFI::NotFoundError => e
76
+ warn "[Warning] Failed to import #{entry[0]} (#{e})."
77
+ end
78
+ end
79
+ end
data/lib/rlgl.rb CHANGED
@@ -13,181 +13,183 @@ module Raylib
13
13
 
14
14
  RLGL_VERSION = "4.2"
15
15
  RL_DEFAULT_BATCH_BUFFER_ELEMENTS = 8192
16
- RL_TEXTURE_WRAP_S = 0x2802 # GL_TEXTURE_WRAP_S
17
- RL_TEXTURE_WRAP_T = 0x2803 # GL_TEXTURE_WRAP_T
18
- RL_TEXTURE_MAG_FILTER = 0x2800 # GL_TEXTURE_MAG_FILTER
19
- RL_TEXTURE_MIN_FILTER = 0x2801 # GL_TEXTURE_MIN_FILTER
20
- RL_TEXTURE_FILTER_NEAREST = 0x2600 # GL_NEAREST
21
- RL_TEXTURE_FILTER_LINEAR = 0x2601 # GL_LINEAR
22
- RL_TEXTURE_FILTER_MIP_NEAREST = 0x2700 # GL_NEAREST_MIPMAP_NEAREST
16
+ RL_TEXTURE_WRAP_S = 0x2802 # GL_TEXTURE_WRAP_S
17
+ RL_TEXTURE_WRAP_T = 0x2803 # GL_TEXTURE_WRAP_T
18
+ RL_TEXTURE_MAG_FILTER = 0x2800 # GL_TEXTURE_MAG_FILTER
19
+ RL_TEXTURE_MIN_FILTER = 0x2801 # GL_TEXTURE_MIN_FILTER
20
+ RL_TEXTURE_FILTER_NEAREST = 0x2600 # GL_NEAREST
21
+ RL_TEXTURE_FILTER_LINEAR = 0x2601 # GL_LINEAR
22
+ RL_TEXTURE_FILTER_MIP_NEAREST = 0x2700 # GL_NEAREST_MIPMAP_NEAREST
23
23
  RL_TEXTURE_FILTER_NEAREST_MIP_LINEAR = 0x2702 # GL_NEAREST_MIPMAP_LINEAR
24
24
  RL_TEXTURE_FILTER_LINEAR_MIP_NEAREST = 0x2701 # GL_LINEAR_MIPMAP_NEAREST
25
- RL_TEXTURE_FILTER_MIP_LINEAR = 0x2703 # GL_LINEAR_MIPMAP_LINEAR
26
- RL_TEXTURE_FILTER_ANISOTROPIC = 0x3000 # Anisotropic filter (custom identifier)
27
- RL_TEXTURE_MIPMAP_BIAS_RATIO = 0x4000 # Texture mipmap bias, percentage ratio (custom identifier)
28
- RL_TEXTURE_WRAP_REPEAT = 0x2901 # GL_REPEAT
29
- RL_TEXTURE_WRAP_CLAMP = 0x812F # GL_CLAMP_TO_EDGE
30
- RL_TEXTURE_WRAP_MIRROR_REPEAT = 0x8370 # GL_MIRRORED_REPEAT
31
- RL_TEXTURE_WRAP_MIRROR_CLAMP = 0x8742 # GL_MIRROR_CLAMP_EXT
32
- RL_MODELVIEW = 0x1700 # GL_MODELVIEW
33
- RL_PROJECTION = 0x1701 # GL_PROJECTION
34
- RL_TEXTURE = 0x1702 # GL_TEXTURE
35
- RL_LINES = 0x0001 # GL_LINES
36
- RL_TRIANGLES = 0x0004 # GL_TRIANGLES
37
- RL_QUADS = 0x0007 # GL_QUADS
38
- RL_UNSIGNED_BYTE = 0x1401 # GL_UNSIGNED_BYTE
39
- RL_FLOAT = 0x1406 # GL_FLOAT
40
- RL_STREAM_DRAW = 0x88E0 # GL_STREAM_DRAW
41
- RL_STREAM_READ = 0x88E1 # GL_STREAM_READ
42
- RL_STREAM_COPY = 0x88E2 # GL_STREAM_COPY
43
- RL_STATIC_DRAW = 0x88E4 # GL_STATIC_DRAW
44
- RL_STATIC_READ = 0x88E5 # GL_STATIC_READ
45
- RL_STATIC_COPY = 0x88E6 # GL_STATIC_COPY
46
- RL_DYNAMIC_DRAW = 0x88E8 # GL_DYNAMIC_DRAW
47
- RL_DYNAMIC_READ = 0x88E9 # GL_DYNAMIC_READ
48
- RL_DYNAMIC_COPY = 0x88EA # GL_DYNAMIC_COPY
49
- RL_FRAGMENT_SHADER = 0x8B30 # GL_FRAGMENT_SHADER
50
- RL_VERTEX_SHADER = 0x8B31 # GL_VERTEX_SHADER
51
- RL_COMPUTE_SHADER = 0x91B9 # GL_COMPUTE_SHADER
52
- RL_ZERO = 0 # GL_ZERO
53
- RL_ONE = 1 # GL_ONE
54
- RL_SRC_COLOR = 0x0300 # GL_SRC_COLOR
55
- RL_ONE_MINUS_SRC_COLOR = 0x0301 # GL_ONE_MINUS_SRC_COLOR
56
- RL_SRC_ALPHA = 0x0302 # GL_SRC_ALPHA
57
- RL_ONE_MINUS_SRC_ALPHA = 0x0303 # GL_ONE_MINUS_SRC_ALPHA
58
- RL_DST_ALPHA = 0x0304 # GL_DST_ALPHA
59
- RL_ONE_MINUS_DST_ALPHA = 0x0305 # GL_ONE_MINUS_DST_ALPHA
60
- RL_DST_COLOR = 0x0306 # GL_DST_COLOR
61
- RL_ONE_MINUS_DST_COLOR = 0x0307 # GL_ONE_MINUS_DST_COLOR
62
- RL_SRC_ALPHA_SATURATE = 0x0308 # GL_SRC_ALPHA_SATURATE
63
- RL_CONSTANT_COLOR = 0x8001 # GL_CONSTANT_COLOR
64
- RL_ONE_MINUS_CONSTANT_COLOR = 0x8002 # GL_ONE_MINUS_CONSTANT_COLOR
65
- RL_CONSTANT_ALPHA = 0x8003 # GL_CONSTANT_ALPHA
66
- RL_ONE_MINUS_CONSTANT_ALPHA = 0x8004 # GL_ONE_MINUS_CONSTANT_ALPHA
67
- RL_FUNC_ADD = 0x8006 # GL_FUNC_ADD
68
- RL_FUNC_SUBTRACT = 0x800A # GL_FUNC_SUBTRACT
69
- RL_FUNC_REVERSE_SUBTRACT = 0x800B # GL_FUNC_REVERSE_SUBTRACT
70
- RL_BLEND_EQUATION = 0x8009 # GL_BLEND_EQUATION
71
- RL_BLEND_EQUATION_RGB = 0x8009 # GL_BLEND_EQUATION_RGB // (Same as BLEND_EQUATION)
72
- RL_BLEND_EQUATION_ALPHA = 0x883D # GL_BLEND_EQUATION_ALPHA
73
- RL_BLEND_DST_RGB = 0x80C8 # GL_BLEND_DST_RGB
74
- RL_BLEND_SRC_RGB = 0x80C9 # GL_BLEND_SRC_RGB
75
- RL_BLEND_DST_ALPHA = 0x80CA # GL_BLEND_DST_ALPHA
76
- RL_BLEND_SRC_ALPHA = 0x80CB # GL_BLEND_SRC_ALPHA
77
- RL_BLEND_COLOR = 0x8005 # GL_BLEND_COLOR
25
+ RL_TEXTURE_FILTER_MIP_LINEAR = 0x2703 # GL_LINEAR_MIPMAP_LINEAR
26
+ RL_TEXTURE_FILTER_ANISOTROPIC = 0x3000 # Anisotropic filter (custom identifier)
27
+ RL_TEXTURE_MIPMAP_BIAS_RATIO = 0x4000 # Texture mipmap bias, percentage ratio (custom identifier)
28
+ RL_TEXTURE_WRAP_REPEAT = 0x2901 # GL_REPEAT
29
+ RL_TEXTURE_WRAP_CLAMP = 0x812F # GL_CLAMP_TO_EDGE
30
+ RL_TEXTURE_WRAP_MIRROR_REPEAT = 0x8370 # GL_MIRRORED_REPEAT
31
+ RL_TEXTURE_WRAP_MIRROR_CLAMP = 0x8742 # GL_MIRROR_CLAMP_EXT
32
+ RL_MODELVIEW = 0x1700 # GL_MODELVIEW
33
+ RL_PROJECTION = 0x1701 # GL_PROJECTION
34
+ RL_TEXTURE = 0x1702 # GL_TEXTURE
35
+ RL_LINES = 0x0001 # GL_LINES
36
+ RL_TRIANGLES = 0x0004 # GL_TRIANGLES
37
+ RL_QUADS = 0x0007 # GL_QUADS
38
+ RL_UNSIGNED_BYTE = 0x1401 # GL_UNSIGNED_BYTE
39
+ RL_FLOAT = 0x1406 # GL_FLOAT
40
+ RL_STREAM_DRAW = 0x88E0 # GL_STREAM_DRAW
41
+ RL_STREAM_READ = 0x88E1 # GL_STREAM_READ
42
+ RL_STREAM_COPY = 0x88E2 # GL_STREAM_COPY
43
+ RL_STATIC_DRAW = 0x88E4 # GL_STATIC_DRAW
44
+ RL_STATIC_READ = 0x88E5 # GL_STATIC_READ
45
+ RL_STATIC_COPY = 0x88E6 # GL_STATIC_COPY
46
+ RL_DYNAMIC_DRAW = 0x88E8 # GL_DYNAMIC_DRAW
47
+ RL_DYNAMIC_READ = 0x88E9 # GL_DYNAMIC_READ
48
+ RL_DYNAMIC_COPY = 0x88EA # GL_DYNAMIC_COPY
49
+ RL_FRAGMENT_SHADER = 0x8B30 # GL_FRAGMENT_SHADER
50
+ RL_VERTEX_SHADER = 0x8B31 # GL_VERTEX_SHADER
51
+ RL_COMPUTE_SHADER = 0x91B9 # GL_COMPUTE_SHADER
52
+ RL_ZERO = 0 # GL_ZERO
53
+ RL_ONE = 1 # GL_ONE
54
+ RL_SRC_COLOR = 0x0300 # GL_SRC_COLOR
55
+ RL_ONE_MINUS_SRC_COLOR = 0x0301 # GL_ONE_MINUS_SRC_COLOR
56
+ RL_SRC_ALPHA = 0x0302 # GL_SRC_ALPHA
57
+ RL_ONE_MINUS_SRC_ALPHA = 0x0303 # GL_ONE_MINUS_SRC_ALPHA
58
+ RL_DST_ALPHA = 0x0304 # GL_DST_ALPHA
59
+ RL_ONE_MINUS_DST_ALPHA = 0x0305 # GL_ONE_MINUS_DST_ALPHA
60
+ RL_DST_COLOR = 0x0306 # GL_DST_COLOR
61
+ RL_ONE_MINUS_DST_COLOR = 0x0307 # GL_ONE_MINUS_DST_COLOR
62
+ RL_SRC_ALPHA_SATURATE = 0x0308 # GL_SRC_ALPHA_SATURATE
63
+ RL_CONSTANT_COLOR = 0x8001 # GL_CONSTANT_COLOR
64
+ RL_ONE_MINUS_CONSTANT_COLOR = 0x8002 # GL_ONE_MINUS_CONSTANT_COLOR
65
+ RL_CONSTANT_ALPHA = 0x8003 # GL_CONSTANT_ALPHA
66
+ RL_ONE_MINUS_CONSTANT_ALPHA = 0x8004 # GL_ONE_MINUS_CONSTANT_ALPHA
67
+ RL_FUNC_ADD = 0x8006 # GL_FUNC_ADD
68
+ RL_MIN = 0x8007 # GL_MIN
69
+ RL_MAX = 0x8008 # GL_MAX
70
+ RL_FUNC_SUBTRACT = 0x800A # GL_FUNC_SUBTRACT
71
+ RL_FUNC_REVERSE_SUBTRACT = 0x800B # GL_FUNC_REVERSE_SUBTRACT
72
+ RL_BLEND_EQUATION = 0x8009 # GL_BLEND_EQUATION
73
+ RL_BLEND_EQUATION_RGB = 0x8009 # GL_BLEND_EQUATION_RGB // (Same as BLEND_EQUATION)
74
+ RL_BLEND_EQUATION_ALPHA = 0x883D # GL_BLEND_EQUATION_ALPHA
75
+ RL_BLEND_DST_RGB = 0x80C8 # GL_BLEND_DST_RGB
76
+ RL_BLEND_SRC_RGB = 0x80C9 # GL_BLEND_SRC_RGB
77
+ RL_BLEND_DST_ALPHA = 0x80CA # GL_BLEND_DST_ALPHA
78
+ RL_BLEND_SRC_ALPHA = 0x80CB # GL_BLEND_SRC_ALPHA
79
+ RL_BLEND_COLOR = 0x8005 # GL_BLEND_COLOR
78
80
 
79
81
  # Enum
80
82
 
81
83
  # enum rlGlVersion
82
84
  # OpenGL version
83
- RL_OPENGL_11 = 1 # OpenGL 1.1
84
- RL_OPENGL_21 = 2 # OpenGL 2.1 (GLSL 120)
85
- RL_OPENGL_33 = 3 # OpenGL 3.3 (GLSL 330)
86
- RL_OPENGL_43 = 4 # OpenGL 4.3 (using GLSL 330)
85
+ RL_OPENGL_11 = 1 # OpenGL 1.1
86
+ RL_OPENGL_21 = 2 # OpenGL 2.1 (GLSL 120)
87
+ RL_OPENGL_33 = 3 # OpenGL 3.3 (GLSL 330)
88
+ RL_OPENGL_43 = 4 # OpenGL 4.3 (using GLSL 330)
87
89
  RL_OPENGL_ES_20 = 5 # OpenGL ES 2.0 (GLSL 100)
88
90
 
89
91
  # enum rlTraceLogLevel
90
92
  # Trace log level
91
- RL_LOG_ALL = 0 # Display all logs
92
- RL_LOG_TRACE = 1 # Trace logging, intended for internal use only
93
- RL_LOG_DEBUG = 2 # Debug logging, used for internal debugging, it should be disabled on release builds
94
- RL_LOG_INFO = 3 # Info logging, used for program execution info
93
+ RL_LOG_ALL = 0 # Display all logs
94
+ RL_LOG_TRACE = 1 # Trace logging, intended for internal use only
95
+ RL_LOG_DEBUG = 2 # Debug logging, used for internal debugging, it should be disabled on release builds
96
+ RL_LOG_INFO = 3 # Info logging, used for program execution info
95
97
  RL_LOG_WARNING = 4 # Warning logging, used on recoverable failures
96
- RL_LOG_ERROR = 5 # Error logging, used on unrecoverable failures
97
- RL_LOG_FATAL = 6 # Fatal logging, used to abort program: exit(EXIT_FAILURE)
98
- RL_LOG_NONE = 7 # Disable logging
98
+ RL_LOG_ERROR = 5 # Error logging, used on unrecoverable failures
99
+ RL_LOG_FATAL = 6 # Fatal logging, used to abort program: exit(EXIT_FAILURE)
100
+ RL_LOG_NONE = 7 # Disable logging
99
101
 
100
102
  # enum rlPixelFormat
101
103
  # Texture pixel formats
102
- RL_PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1 # 8 bit per pixel (no alpha)
103
- RL_PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA = 2 # 8*2 bpp (2 channels)
104
- RL_PIXELFORMAT_UNCOMPRESSED_R5G6B5 = 3 # 16 bpp
105
- RL_PIXELFORMAT_UNCOMPRESSED_R8G8B8 = 4 # 24 bpp
106
- RL_PIXELFORMAT_UNCOMPRESSED_R5G5B5A1 = 5 # 16 bpp (1 bit alpha)
107
- RL_PIXELFORMAT_UNCOMPRESSED_R4G4B4A4 = 6 # 16 bpp (4 bit alpha)
108
- RL_PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 = 7 # 32 bpp
109
- RL_PIXELFORMAT_UNCOMPRESSED_R32 = 8 # 32 bpp (1 channel - float)
110
- RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32 = 9 # 32*3 bpp (3 channels - float)
104
+ RL_PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1 # 8 bit per pixel (no alpha)
105
+ RL_PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA = 2 # 8*2 bpp (2 channels)
106
+ RL_PIXELFORMAT_UNCOMPRESSED_R5G6B5 = 3 # 16 bpp
107
+ RL_PIXELFORMAT_UNCOMPRESSED_R8G8B8 = 4 # 24 bpp
108
+ RL_PIXELFORMAT_UNCOMPRESSED_R5G5B5A1 = 5 # 16 bpp (1 bit alpha)
109
+ RL_PIXELFORMAT_UNCOMPRESSED_R4G4B4A4 = 6 # 16 bpp (4 bit alpha)
110
+ RL_PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 = 7 # 32 bpp
111
+ RL_PIXELFORMAT_UNCOMPRESSED_R32 = 8 # 32 bpp (1 channel - float)
112
+ RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32 = 9 # 32*3 bpp (3 channels - float)
111
113
  RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32A32 = 10 # 32*4 bpp (4 channels - float)
112
- RL_PIXELFORMAT_COMPRESSED_DXT1_RGB = 11 # 4 bpp (no alpha)
113
- RL_PIXELFORMAT_COMPRESSED_DXT1_RGBA = 12 # 4 bpp (1 bit alpha)
114
- RL_PIXELFORMAT_COMPRESSED_DXT3_RGBA = 13 # 8 bpp
115
- RL_PIXELFORMAT_COMPRESSED_DXT5_RGBA = 14 # 8 bpp
116
- RL_PIXELFORMAT_COMPRESSED_ETC1_RGB = 15 # 4 bpp
117
- RL_PIXELFORMAT_COMPRESSED_ETC2_RGB = 16 # 4 bpp
118
- RL_PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA = 17 # 8 bpp
119
- RL_PIXELFORMAT_COMPRESSED_PVRT_RGB = 18 # 4 bpp
120
- RL_PIXELFORMAT_COMPRESSED_PVRT_RGBA = 19 # 4 bpp
121
- RL_PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA = 20 # 8 bpp
122
- RL_PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA = 21 # 2 bpp
114
+ RL_PIXELFORMAT_COMPRESSED_DXT1_RGB = 11 # 4 bpp (no alpha)
115
+ RL_PIXELFORMAT_COMPRESSED_DXT1_RGBA = 12 # 4 bpp (1 bit alpha)
116
+ RL_PIXELFORMAT_COMPRESSED_DXT3_RGBA = 13 # 8 bpp
117
+ RL_PIXELFORMAT_COMPRESSED_DXT5_RGBA = 14 # 8 bpp
118
+ RL_PIXELFORMAT_COMPRESSED_ETC1_RGB = 15 # 4 bpp
119
+ RL_PIXELFORMAT_COMPRESSED_ETC2_RGB = 16 # 4 bpp
120
+ RL_PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA = 17 # 8 bpp
121
+ RL_PIXELFORMAT_COMPRESSED_PVRT_RGB = 18 # 4 bpp
122
+ RL_PIXELFORMAT_COMPRESSED_PVRT_RGBA = 19 # 4 bpp
123
+ RL_PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA = 20 # 8 bpp
124
+ RL_PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA = 21 # 2 bpp
123
125
 
124
126
  # enum rlTextureFilter
125
127
  # Texture parameters: filter mode
126
- RL_TEXTURE_FILTER_POINT = 0 # No filter, just pixel approximation
127
- RL_TEXTURE_FILTER_BILINEAR = 1 # Linear filtering
128
- RL_TEXTURE_FILTER_TRILINEAR = 2 # Trilinear filtering (linear with mipmaps)
129
- RL_TEXTURE_FILTER_ANISOTROPIC_4X = 3 # Anisotropic filtering 4x
130
- RL_TEXTURE_FILTER_ANISOTROPIC_8X = 4 # Anisotropic filtering 8x
128
+ RL_TEXTURE_FILTER_POINT = 0 # No filter, just pixel approximation
129
+ RL_TEXTURE_FILTER_BILINEAR = 1 # Linear filtering
130
+ RL_TEXTURE_FILTER_TRILINEAR = 2 # Trilinear filtering (linear with mipmaps)
131
+ RL_TEXTURE_FILTER_ANISOTROPIC_4X = 3 # Anisotropic filtering 4x
132
+ RL_TEXTURE_FILTER_ANISOTROPIC_8X = 4 # Anisotropic filtering 8x
131
133
  RL_TEXTURE_FILTER_ANISOTROPIC_16X = 5 # Anisotropic filtering 16x
132
134
 
133
135
  # enum rlBlendMode
134
136
  # Color blending modes (pre-defined)
135
- RL_BLEND_ALPHA = 0 # Blend textures considering alpha (default)
136
- RL_BLEND_ADDITIVE = 1 # Blend textures adding colors
137
- RL_BLEND_MULTIPLIED = 2 # Blend textures multiplying colors
138
- RL_BLEND_ADD_COLORS = 3 # Blend textures adding colors (alternative)
139
- RL_BLEND_SUBTRACT_COLORS = 4 # Blend textures subtracting colors (alternative)
137
+ RL_BLEND_ALPHA = 0 # Blend textures considering alpha (default)
138
+ RL_BLEND_ADDITIVE = 1 # Blend textures adding colors
139
+ RL_BLEND_MULTIPLIED = 2 # Blend textures multiplying colors
140
+ RL_BLEND_ADD_COLORS = 3 # Blend textures adding colors (alternative)
141
+ RL_BLEND_SUBTRACT_COLORS = 4 # Blend textures subtracting colors (alternative)
140
142
  RL_BLEND_ALPHA_PREMULTIPLY = 5 # Blend premultiplied textures considering alpha
141
- RL_BLEND_CUSTOM = 6 # Blend textures using custom src/dst factors (use rlSetBlendFactors())
142
- RL_BLEND_CUSTOM_SEPARATE = 7 # Blend textures using custom src/dst factors (use rlSetBlendFactorsSeparate())
143
+ RL_BLEND_CUSTOM = 6 # Blend textures using custom src/dst factors (use rlSetBlendFactors())
144
+ RL_BLEND_CUSTOM_SEPARATE = 7 # Blend textures using custom src/dst factors (use rlSetBlendFactorsSeparate())
143
145
 
144
146
  # enum rlShaderLocationIndex
145
147
  # Shader location point type
146
- RL_SHADER_LOC_VERTEX_POSITION = 0 # Shader location: vertex attribute: position
148
+ RL_SHADER_LOC_VERTEX_POSITION = 0 # Shader location: vertex attribute: position
147
149
  RL_SHADER_LOC_VERTEX_TEXCOORD01 = 1 # Shader location: vertex attribute: texcoord01
148
150
  RL_SHADER_LOC_VERTEX_TEXCOORD02 = 2 # Shader location: vertex attribute: texcoord02
149
- RL_SHADER_LOC_VERTEX_NORMAL = 3 # Shader location: vertex attribute: normal
150
- RL_SHADER_LOC_VERTEX_TANGENT = 4 # Shader location: vertex attribute: tangent
151
- RL_SHADER_LOC_VERTEX_COLOR = 5 # Shader location: vertex attribute: color
152
- RL_SHADER_LOC_MATRIX_MVP = 6 # Shader location: matrix uniform: model-view-projection
153
- RL_SHADER_LOC_MATRIX_VIEW = 7 # Shader location: matrix uniform: view (camera transform)
151
+ RL_SHADER_LOC_VERTEX_NORMAL = 3 # Shader location: vertex attribute: normal
152
+ RL_SHADER_LOC_VERTEX_TANGENT = 4 # Shader location: vertex attribute: tangent
153
+ RL_SHADER_LOC_VERTEX_COLOR = 5 # Shader location: vertex attribute: color
154
+ RL_SHADER_LOC_MATRIX_MVP = 6 # Shader location: matrix uniform: model-view-projection
155
+ RL_SHADER_LOC_MATRIX_VIEW = 7 # Shader location: matrix uniform: view (camera transform)
154
156
  RL_SHADER_LOC_MATRIX_PROJECTION = 8 # Shader location: matrix uniform: projection
155
- RL_SHADER_LOC_MATRIX_MODEL = 9 # Shader location: matrix uniform: model (transform)
156
- RL_SHADER_LOC_MATRIX_NORMAL = 10 # Shader location: matrix uniform: normal
157
- RL_SHADER_LOC_VECTOR_VIEW = 11 # Shader location: vector uniform: view
158
- RL_SHADER_LOC_COLOR_DIFFUSE = 12 # Shader location: vector uniform: diffuse color
159
- RL_SHADER_LOC_COLOR_SPECULAR = 13 # Shader location: vector uniform: specular color
160
- RL_SHADER_LOC_COLOR_AMBIENT = 14 # Shader location: vector uniform: ambient color
161
- RL_SHADER_LOC_MAP_ALBEDO = 15 # Shader location: sampler2d texture: albedo (same as: RL_SHADER_LOC_MAP_DIFFUSE)
162
- RL_SHADER_LOC_MAP_METALNESS = 16 # Shader location: sampler2d texture: metalness (same as: RL_SHADER_LOC_MAP_SPECULAR)
163
- RL_SHADER_LOC_MAP_NORMAL = 17 # Shader location: sampler2d texture: normal
164
- RL_SHADER_LOC_MAP_ROUGHNESS = 18 # Shader location: sampler2d texture: roughness
165
- RL_SHADER_LOC_MAP_OCCLUSION = 19 # Shader location: sampler2d texture: occlusion
166
- RL_SHADER_LOC_MAP_EMISSION = 20 # Shader location: sampler2d texture: emission
167
- RL_SHADER_LOC_MAP_HEIGHT = 21 # Shader location: sampler2d texture: height
168
- RL_SHADER_LOC_MAP_CUBEMAP = 22 # Shader location: samplerCube texture: cubemap
169
- RL_SHADER_LOC_MAP_IRRADIANCE = 23 # Shader location: samplerCube texture: irradiance
170
- RL_SHADER_LOC_MAP_PREFILTER = 24 # Shader location: samplerCube texture: prefilter
171
- RL_SHADER_LOC_MAP_BRDF = 25 # Shader location: sampler2d texture: brdf
157
+ RL_SHADER_LOC_MATRIX_MODEL = 9 # Shader location: matrix uniform: model (transform)
158
+ RL_SHADER_LOC_MATRIX_NORMAL = 10 # Shader location: matrix uniform: normal
159
+ RL_SHADER_LOC_VECTOR_VIEW = 11 # Shader location: vector uniform: view
160
+ RL_SHADER_LOC_COLOR_DIFFUSE = 12 # Shader location: vector uniform: diffuse color
161
+ RL_SHADER_LOC_COLOR_SPECULAR = 13 # Shader location: vector uniform: specular color
162
+ RL_SHADER_LOC_COLOR_AMBIENT = 14 # Shader location: vector uniform: ambient color
163
+ RL_SHADER_LOC_MAP_ALBEDO = 15 # Shader location: sampler2d texture: albedo (same as: RL_SHADER_LOC_MAP_DIFFUSE)
164
+ RL_SHADER_LOC_MAP_METALNESS = 16 # Shader location: sampler2d texture: metalness (same as: RL_SHADER_LOC_MAP_SPECULAR)
165
+ RL_SHADER_LOC_MAP_NORMAL = 17 # Shader location: sampler2d texture: normal
166
+ RL_SHADER_LOC_MAP_ROUGHNESS = 18 # Shader location: sampler2d texture: roughness
167
+ RL_SHADER_LOC_MAP_OCCLUSION = 19 # Shader location: sampler2d texture: occlusion
168
+ RL_SHADER_LOC_MAP_EMISSION = 20 # Shader location: sampler2d texture: emission
169
+ RL_SHADER_LOC_MAP_HEIGHT = 21 # Shader location: sampler2d texture: height
170
+ RL_SHADER_LOC_MAP_CUBEMAP = 22 # Shader location: samplerCube texture: cubemap
171
+ RL_SHADER_LOC_MAP_IRRADIANCE = 23 # Shader location: samplerCube texture: irradiance
172
+ RL_SHADER_LOC_MAP_PREFILTER = 24 # Shader location: samplerCube texture: prefilter
173
+ RL_SHADER_LOC_MAP_BRDF = 25 # Shader location: sampler2d texture: brdf
172
174
 
173
175
  # enum rlShaderUniformDataType
174
176
  # Shader uniform data type
175
- RL_SHADER_UNIFORM_FLOAT = 0 # Shader uniform type: float
176
- RL_SHADER_UNIFORM_VEC2 = 1 # Shader uniform type: vec2 (2 float)
177
- RL_SHADER_UNIFORM_VEC3 = 2 # Shader uniform type: vec3 (3 float)
178
- RL_SHADER_UNIFORM_VEC4 = 3 # Shader uniform type: vec4 (4 float)
179
- RL_SHADER_UNIFORM_INT = 4 # Shader uniform type: int
180
- RL_SHADER_UNIFORM_IVEC2 = 5 # Shader uniform type: ivec2 (2 int)
181
- RL_SHADER_UNIFORM_IVEC3 = 6 # Shader uniform type: ivec3 (3 int)
182
- RL_SHADER_UNIFORM_IVEC4 = 7 # Shader uniform type: ivec4 (4 int)
177
+ RL_SHADER_UNIFORM_FLOAT = 0 # Shader uniform type: float
178
+ RL_SHADER_UNIFORM_VEC2 = 1 # Shader uniform type: vec2 (2 float)
179
+ RL_SHADER_UNIFORM_VEC3 = 2 # Shader uniform type: vec3 (3 float)
180
+ RL_SHADER_UNIFORM_VEC4 = 3 # Shader uniform type: vec4 (4 float)
181
+ RL_SHADER_UNIFORM_INT = 4 # Shader uniform type: int
182
+ RL_SHADER_UNIFORM_IVEC2 = 5 # Shader uniform type: ivec2 (2 int)
183
+ RL_SHADER_UNIFORM_IVEC3 = 6 # Shader uniform type: ivec3 (3 int)
184
+ RL_SHADER_UNIFORM_IVEC4 = 7 # Shader uniform type: ivec4 (4 int)
183
185
  RL_SHADER_UNIFORM_SAMPLER2D = 8 # Shader uniform type: sampler2d
184
186
 
185
187
  # enum rlShaderAttributeDataType
186
188
  # Shader attribute data types
187
189
  RL_SHADER_ATTRIB_FLOAT = 0 # Shader attribute type: float
188
- RL_SHADER_ATTRIB_VEC2 = 1 # Shader attribute type: vec2 (2 float)
189
- RL_SHADER_ATTRIB_VEC3 = 2 # Shader attribute type: vec3 (3 float)
190
- RL_SHADER_ATTRIB_VEC4 = 3 # Shader attribute type: vec4 (4 float)
190
+ RL_SHADER_ATTRIB_VEC2 = 1 # Shader attribute type: vec2 (2 float)
191
+ RL_SHADER_ATTRIB_VEC3 = 2 # Shader attribute type: vec3 (3 float)
192
+ RL_SHADER_ATTRIB_VEC4 = 3 # Shader attribute type: vec4 (4 float)
191
193
 
192
194
  # enum rlFramebufferAttachType
193
195
  # Framebuffer attachment type
@@ -199,8 +201,8 @@ module Raylib
199
201
  RL_ATTACHMENT_COLOR_CHANNEL5 = 5 # Framebuffer attachment type: color 5
200
202
  RL_ATTACHMENT_COLOR_CHANNEL6 = 6 # Framebuffer attachment type: color 6
201
203
  RL_ATTACHMENT_COLOR_CHANNEL7 = 7 # Framebuffer attachment type: color 7
202
- RL_ATTACHMENT_DEPTH = 100 # Framebuffer attachment type: depth
203
- RL_ATTACHMENT_STENCIL = 200 # Framebuffer attachment type: stencil
204
+ RL_ATTACHMENT_DEPTH = 100 # Framebuffer attachment type: depth
205
+ RL_ATTACHMENT_STENCIL = 200 # Framebuffer attachment type: stencil
204
206
 
205
207
  # enum rlFramebufferAttachTextureType
206
208
  # Framebuffer texture attachment type
@@ -210,8 +212,8 @@ module Raylib
210
212
  RL_ATTACHMENT_CUBEMAP_NEGATIVE_Y = 3 # Framebuffer texture attachment type: cubemap, -Y side
211
213
  RL_ATTACHMENT_CUBEMAP_POSITIVE_Z = 4 # Framebuffer texture attachment type: cubemap, +Z side
212
214
  RL_ATTACHMENT_CUBEMAP_NEGATIVE_Z = 5 # Framebuffer texture attachment type: cubemap, -Z side
213
- RL_ATTACHMENT_TEXTURE2D = 100 # Framebuffer texture attachment type: texture2d
214
- RL_ATTACHMENT_RENDERBUFFER = 200 # Framebuffer texture attachment type: renderbuffer
215
+ RL_ATTACHMENT_TEXTURE2D = 100 # Framebuffer texture attachment type: texture2d
216
+ RL_ATTACHMENT_RENDERBUFFER = 200 # Framebuffer texture attachment type: renderbuffer
215
217
 
216
218
  # enum rlCullMode
217
219
  # Face culling mode
@@ -238,36 +240,70 @@ module Raylib
238
240
  # Dynamic vertex buffers (position + texcoords + colors + indices arrays)
239
241
  class RlVertexBuffer < FFI::Struct
240
242
  layout(
241
- :elementCount, :int, # Number of elements in the buffer (QUADS)
242
- :vertices, :pointer, # Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
243
+ :elementCount, :int, # Number of elements in the buffer (QUADS)
244
+ :vertices, :pointer, # Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
243
245
  :texcoords, :pointer, # Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
244
- :colors, :pointer, # Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
245
- :indices, :pointer, # Vertex indices (in case vertex data comes indexed) (6 indices per quad)
246
- :vaoId, :uint, # OpenGL Vertex Array Object id
247
- :vboId, [:uint, 4], # OpenGL Vertex Buffer Objects id (4 types of vertex data)
246
+ :colors, :pointer, # Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
247
+ :indices, :pointer, # Vertex indices (in case vertex data comes indexed) (6 indices per quad)
248
+ :vaoId, :uint, # OpenGL Vertex Array Object id
249
+ :vboId, [:uint, 4], # OpenGL Vertex Buffer Objects id (4 types of vertex data)
248
250
  )
251
+ def elementCount = self[:elementCount]
252
+ def elementCount=(v) self[:elementCount] = v end
253
+ def vertices = self[:vertices]
254
+ def vertices=(v) self[:vertices] = v end
255
+ def texcoords = self[:texcoords]
256
+ def texcoords=(v) self[:texcoords] = v end
257
+ def colors = self[:colors]
258
+ def colors=(v) self[:colors] = v end
259
+ def indices = self[:indices]
260
+ def indices=(v) self[:indices] = v end
261
+ def vaoId = self[:vaoId]
262
+ def vaoId=(v) self[:vaoId] = v end
263
+ def vboId = self[:vboId]
264
+ def vboId=(v) self[:vboId] = v end
249
265
  end
250
266
 
251
267
  # of those state-change happens (this is done in core module)
252
268
  class RlDrawCall < FFI::Struct
253
269
  layout(
254
- :mode, :int, # Drawing mode: LINES, TRIANGLES, QUADS
255
- :vertexCount, :int, # Number of vertex of the draw
270
+ :mode, :int, # Drawing mode: LINES, TRIANGLES, QUADS
271
+ :vertexCount, :int, # Number of vertex of the draw
256
272
  :vertexAlignment, :int, # Number of vertex required for index alignment (LINES, TRIANGLES)
257
- :textureId, :uint, # Texture id to be used on the draw -> Use to create new draw call if changes
273
+ :textureId, :uint, # Texture id to be used on the draw -> Use to create new draw call if changes
258
274
  )
275
+ def mode = self[:mode]
276
+ def mode=(v) self[:mode] = v end
277
+ def vertexCount = self[:vertexCount]
278
+ def vertexCount=(v) self[:vertexCount] = v end
279
+ def vertexAlignment = self[:vertexAlignment]
280
+ def vertexAlignment=(v) self[:vertexAlignment] = v end
281
+ def textureId = self[:textureId]
282
+ def textureId=(v) self[:textureId] = v end
259
283
  end
260
284
 
261
285
  # rlRenderBatch type
262
286
  class RlRenderBatch < FFI::Struct
263
287
  layout(
264
- :bufferCount, :int, # Number of vertex buffers (multi-buffering support)
265
- :currentBuffer, :int, # Current buffer tracking in case of multi-buffering
288
+ :bufferCount, :int, # Number of vertex buffers (multi-buffering support)
289
+ :currentBuffer, :int, # Current buffer tracking in case of multi-buffering
266
290
  :vertexBuffer, :pointer, # Dynamic buffer(s) for vertex data
267
- :draws, :pointer, # Draw calls array, depends on textureId
268
- :drawCounter, :int, # Draw calls counter
269
- :currentDepth, :float, # Current depth value for next draw
291
+ :draws, :pointer, # Draw calls array, depends on textureId
292
+ :drawCounter, :int, # Draw calls counter
293
+ :currentDepth, :float, # Current depth value for next draw
270
294
  )
295
+ def bufferCount = self[:bufferCount]
296
+ def bufferCount=(v) self[:bufferCount] = v end
297
+ def currentBuffer = self[:currentBuffer]
298
+ def currentBuffer=(v) self[:currentBuffer] = v end
299
+ def vertexBuffer = self[:vertexBuffer]
300
+ def vertexBuffer=(v) self[:vertexBuffer] = v end
301
+ def draws = self[:draws]
302
+ def draws=(v) self[:draws] = v end
303
+ def drawCounter = self[:drawCounter]
304
+ def drawCounter=(v) self[:drawCounter] = v end
305
+ def currentDepth = self[:currentDepth]
306
+ def currentDepth=(v) self[:currentDepth] = v end
271
307
  end
272
308
 
273
309
 
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.3.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - vaiorabbit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-28 00:00:00.000000000 Z
11
+ date: 2023-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -70,6 +70,7 @@ files:
70
70
  - lib/raylib_helper.rb
71
71
  - lib/raylib_main.rb
72
72
  - lib/raymath.rb
73
+ - lib/rcamera.rb
73
74
  - lib/rlgl.rb
74
75
  homepage: https://github.com/vaiorabbit/raylib-bindings
75
76
  licenses:
@@ -90,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
91
  - !ruby/object:Gem::Version
91
92
  version: '0'
92
93
  requirements: []
93
- rubygems_version: 3.4.1
94
+ rubygems_version: 3.4.6
94
95
  signing_key:
95
96
  specification_version: 4
96
97
  summary: Provides latest raylib API for Ruby