Compare commits

...

19 Commits

Author SHA1 Message Date
Fierelier
8172655e88 This is how you do it 2022-05-19 03:23:33 +02:00
Fierelier
4282020b02 Change LuaJIT 2.1+ (master) tree to LuaJIT 2.0 2022-05-19 03:15:34 +02:00
Fierelier
75205209df Add notice 2022-05-19 03:14:23 +02:00
TSnake41
e7b59f1537 Update binding and LuaJIT 2022-04-12 23:39:43 +02:00
TSnake41
29052e1e85 Merge branch 'saphire-raylua_r' 2022-03-20 12:55:36 +01:00
TSnake41
dba1274bc3 Add saphire build system support for raylua_r (#3) 2022-03-20 12:53:25 +01:00
Astie Teddy
1306640357
Merge pull request #3 from sneusse/no-console
Add a new executable that doesn't show the console (windows)
2022-03-20 12:44:45 +01:00
Sebastian Neusser
2b37b77a71 only use -mwindows on windows 2022-03-18 13:03:06 +01:00
Sebastian Neusser
6a8065fcdb built new executable using the windows subsystem
- use the raylua_r to build executables without the console window
2022-03-18 12:54:42 +01:00
TSnake41
6f4cc3bba7 Update binding 2022-03-12 14:06:03 +01:00
TSnake41
c008f46e82 Update binding 2022-02-15 12:45:32 +01:00
Astie Teddy
b5247f7b61 Update binding 2022-01-18 11:11:58 +01:00
TSnake41
035703b769 Fix wrong submodule for LuaJIT 2021-12-31 12:16:04 +01:00
TSnake41
2eee7452d2 Update binding 2021-12-29 13:21:32 +01:00
TSnake41
e426d561d3 Use rewritten shaders_compute_shader based on gol raylib example. 2021-11-04 21:43:06 +01:00
TSnake41
e846857ced Added EncodeDataBase64/DecodeDataBase64 that were missing. 2021-11-04 21:17:26 +01:00
TSnake41
262a663355 raylua v4.0a 2021-11-04 20:48:32 +01:00
TSnake41
95d558cb98 Fix dll issues on Windows 2021-11-04 20:43:28 +01:00
TSnake41
0eca951b26 Update embedded ressources notice.
raylib-lua was able to load file from payload since 3c68c3cfb9
2021-10-24 13:25:58 +02:00
22 changed files with 611 additions and 459 deletions

1
.gitignore vendored
View File

@ -2,6 +2,7 @@
*.res *.res
*.a *.a
raylua_e.exe raylua_e.exe
raylua_r.exe
raylua_s.exe raylua_s.exe
raylua_s raylua_s
raylua_e raylua_e

5
.gitmodules vendored
View File

@ -1,10 +1,11 @@
[submodule "LuaJIT"] [submodule "LuaJIT"]
path = luajit path = luajit
url = https://github.com/moonjit/moonjit url = https://github.com/LuaJIT/LuaJIT
branch = v2.0
[submodule "raylib"] [submodule "raylib"]
path = raylib path = raylib
url = https://github.com/TSnake41/raylib url = https://github.com/raysan5/raylib
[submodule "raygui"] [submodule "raygui"]
path = raygui path = raygui

View File

@ -1,3 +1,5 @@
**NOTE:** This is a clone of [raylib-lua from TSnake41](https://github.com/TSnake41/raylib-lua), but using LuaJIT 2.0 instead of 2.1+, to support CPUs without SSE2.
![raylib-lua logo](assets/logo.png) ![raylib-lua logo](assets/logo.png)
[![release](https://img.shields.io/github/v/release/TSnake41/raylib-lua?style=flat-square)](https://github.com/TSnake41/raylib-lua/releases/latest) [![release](https://img.shields.io/github/v/release/TSnake41/raylib-lua?style=flat-square)](https://github.com/TSnake41/raylib-lua/releases/latest)
@ -63,8 +65,8 @@ If you need to update raylib binding, there are few tasks to do :
### Loading embedded ressources ### Loading embedded ressources
Currently, raylib-lua doesn't support loading ressources from payload using Currently, raylib-lua support loading ressources from payload using
raylib API. However, you can still arbitrarily load files from payload using raylib API. You can also arbitrarily load files from payload using
`raylua.loadfile` which returns a boolean indicating success and file content. `raylua.loadfile` which returns a boolean indicating success and file content.
### Making structs ### Making structs

View File

@ -25,26 +25,32 @@ local ar = os.getenv "AR" or "ar"
local windres = os.getenv "WINDRES" or "windres" local windres = os.getenv "WINDRES" or "windres"
-- TODO: Use current lua interpreter -- TODO: Use current lua interpreter
local lua = os.getenv "LUA" or "luajit\\src\\luajit" local lua = os.getenv "LUA"
local needs_luajit_built = not (os.getenv "LUA") local needs_luajit_built = not (os.getenv "LUA")
local cflags = os.getenv "CFLAGS" or "-O2 -s" local cflags = os.getenv "CFLAGS" or "-O2 -s"
local ldflags = os.getenv "LDFLAGS" or "-O2 -s -lm" local ldflags = os.getenv "LDFLAGS" or "-O2 -s -lm"
local ldflags_r = os.getenv "LDFLAGS_R" or ""
local modules = "raymath rlgl easings gestures physac raygui" local modules = "raymath rlgl easings gestures physac raygui"
local graphics = os.getenv "GRAPHICS" or "GRAPHICS_API_OPENGL_33" local graphics = os.getenv "GRAPHICS" or "GRAPHICS_API_OPENGL_43"
cflags = cflags .. " -Iluajit/src -Iraygui/src -Iraylib/src" cflags = cflags .. " -Iluajit/src -Iraygui/src -Iraylib/src".. " -D" .. graphics
ldflags = ldflags .. " luajit/src/libluajit.a raylib/src/libraylib.a luajit/src/libluajit.a"
cflags = cflags .. " -D" .. graphics local raylua_so_path = "raylua.so" -- assume unix-like by default
local so_ldflags = ldflags
local exe_ldflags = ""
if los.type() == "linux" then if los.type() == "linux" then
ldflags = ldflags .. " -ldl -pthread" ldflags = ldflags .. " -ldl -pthread"
cflags = cflags .. " -fPIC"
so_ldflags = ldflags .. " -llua5.1"
lua = lua or "luajit/src/luajit"
elseif los.type() == "win32" then elseif los.type() == "win32" then
ldflags = ldflags .. " -lopengl32 -lgdi32 -lwinmm -static " ldflags = ldflags .. " -lopengl32 -lgdi32 -lwinmm -static "
so_ldflags = ldflags .. " -llua5.1.dll"
raylua_so_path = "raylua.dll"
ldflags_r = ldflags_r .. "-mwindows"
lua = lua or "luajit\\src\\luajit"
end end
local libluajit local libluajit
@ -144,3 +150,19 @@ local raylua_e = c.link("raylua_e",
"raylua_e", "raylua_e",
cc cc
) )
local raylua_r = c.link("raylua_r",
saphire.merge(raylua_e_objs, { libraylua, libraylib, libluajit, icon }),
ldflags .. " " .. ldflags_r,
false,
"raylua_r",
cc
)
local raylua_so = c.link(raylua_so_path,
saphire.merge(raylua_obj, { libraylib }),
so_ldflags,
true,
raylua_so_path,
cc
)

View File

@ -12,6 +12,10 @@ local include_paths = "-I. -Iexternal/glfw/include -Iexternal/glfw/deps/mingw"
local los = require "los" local los = require "los"
if los.type() == "linux" then
cflags = cflags .. " -fPIC"
end
local consts = { local consts = {
RAYLIB_VERSION = "4.0.0", RAYLIB_VERSION = "4.0.0",
RAYLIB_API_VERSION = "400", RAYLIB_API_VERSION = "400",
@ -23,7 +27,7 @@ local vars = saphire.map({
{ "RAYLIB_LIB_NAME", "raylib" }, { "RAYLIB_LIB_NAME", "raylib" },
{ "RAYLIB_RES_FILE", "./raylib.dll.rc.data" }, { "RAYLIB_RES_FILE", "./raylib.dll.rc.data" },
{ "PLATFORM", "PLATFORM_DESKTOP" }, { "PLATFORM", "PLATFORM_DESKTOP" },
{ "GRAPHICS", "GRAPHICS_API_OPENGL_33" }, { "GRAPHICS", "GRAPHICS_API_OPENGL_43" },
{ "USE_EXTERNAL_GLFW", "FALSE" }, { "USE_EXTERNAL_GLFW", "FALSE" },
{ "USE_WAYLAND_DISPLAY", "FALSE" } { "USE_WAYLAND_DISPLAY", "FALSE" }
}, function (v) }, function (v)

View File

@ -0,0 +1,41 @@
#version 430
// Game of Life logic shader
#define GOL_WIDTH 768
layout (local_size_x = 16, local_size_y = 16, local_size_z = 1) in;
layout(std430, binding = 1) readonly restrict buffer golLayout {
uint golBuffer[]; // golBuffer[x, y] = golBuffer[x + gl_NumWorkGroups.x * y]
};
layout(std430, binding = 2) writeonly restrict buffer golLayout2 {
uint golBufferDest[]; // golBufferDest[x, y] = golBufferDest[x + gl_NumWorkGroups.x * y]
};
#define fetchGol(x, y) ((((x) < 0) || ((y) < 0) || ((x) > GOL_WIDTH) || ((y) > GOL_WIDTH)) \
? (0) \
: golBuffer[(x) + GOL_WIDTH * (y)])
#define setGol(x, y, value) golBufferDest[(x) + GOL_WIDTH*(y)] = value
void main()
{
uint neighbourCount = 0;
uint x = gl_GlobalInvocationID.x;
uint y = gl_GlobalInvocationID.y;
neighbourCount += fetchGol(x - 1, y - 1); // Top left
neighbourCount += fetchGol(x, y - 1); // Top middle
neighbourCount += fetchGol(x + 1, y - 1); // Top right
neighbourCount += fetchGol(x - 1, y); // Left
neighbourCount += fetchGol(x + 1, y); // Right
neighbourCount += fetchGol(x - 1, y + 1); // Bottom left
neighbourCount += fetchGol(x, y + 1); // Bottom middle
neighbourCount += fetchGol(x + 1, y + 1); // Bottom right
if (neighbourCount == 3) setGol(x, y, 1);
else if (neighbourCount == 2) setGol(x, y, fetchGol(x, y));
else setGol(x, y, 0);
}

View File

@ -0,0 +1,29 @@
#version 430
// Game of Life rendering shader
// Just renders the content of the ssbo at binding 1 to screen
#define GOL_WIDTH 768
// Input vertex attributes (from vertex shader)
in vec2 fragTexCoord;
// Output fragment color
out vec4 finalColor;
// Input game of life grid.
layout(std430, binding = 1) readonly buffer golLayout
{
uint golBuffer[];
};
// Output resolution
uniform vec2 resolution;
void main()
{
ivec2 coords = ivec2(fragTexCoord*resolution);
if ((golBuffer[coords.x + coords.y*uvec2(resolution).x]) == 1) finalColor = vec4(1.0);
else finalColor = vec4(0.0, 0.0, 0.0, 1.0);
}

View File

@ -0,0 +1,51 @@
#version 430
// Game of life transfert shader
#define GOL_WIDTH 768
// Game Of Life Update Command
// NOTE: matches the structure defined on main program
struct GolUpdateCmd {
uint x; // x coordinate of the gol command
uint y; // y coordinate of the gol command
uint w; // width of the filled zone
uint enabled; // whether to enable or disable zone
};
// Local compute unit size
layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
// Output game of life grid buffer
layout(std430, binding = 1) buffer golBufferLayout
{
uint golBuffer[]; // golBuffer[x, y] = golBuffer[x + GOL_WIDTH * y]
};
// Command buffer
layout(std430, binding = 3) readonly restrict buffer golUpdateLayout
{
uint count;
GolUpdateCmd commands[];
};
#define isInside(x, y) (((x) >= 0) && ((y) >= 0) && ((x) < GOL_WIDTH) && ((y) < GOL_WIDTH))
#define getBufferIndex(x, y) ((x) + GOL_WIDTH * (y))
void main()
{
uint cmdIndex = gl_GlobalInvocationID.x;
GolUpdateCmd cmd = commands[cmdIndex];
for (uint x = cmd.x; x < (cmd.x + cmd.w); x++)
{
for (uint y = cmd.y; y < (cmd.y + cmd.w); y++)
{
if (isInside(x, y))
{
if (cmd.enabled != 0) atomicOr(golBuffer[getBufferIndex(x, y)], 1);
else atomicAnd(golBuffer[getBufferIndex(x, y)], 0);
}
}
}
}

View File

@ -1,57 +0,0 @@
#version 430
#define GOL_WIDTH 1024
layout (local_size_x = 16, local_size_y = 16, local_size_x = 1) in;
layout(std430, binding = 1) readonly restrict buffer golLayout {
int golBuffer[]; // golBuffer[x, y] = golBuffer[x + gl_NumWorkGroups.x * y]
};
layout(std430, set = 1, binding = 2) writeonly restrict buffer golLayout2 {
int golBufferDest[]; // golBufferDest[x, y] = golBufferDest[x + gl_NumWorkGroups.x * y]
};
#define fetchGol(x, y) ((((x) < 0) || ((y) < 0) || ((x) > GOL_WIDTH) || ((y) > GOL_WIDTH)) \
? (0) \
: golBuffer[(x) + GOL_WIDTH * (y)])
#define setGol(x, y, value) golBufferDest[(x) + GOL_WIDTH * (y)] = value
void main()
{
uint neighbour_count = 0;
uint x = gl_GlobalInvocationID.x;
uint y = gl_GlobalInvocationID.y;
// Top left
neighbour_count += fetchGol(x - 1, y - 1);
// Top middle
neighbour_count += fetchGol(x, y - 1);
// Top right
neighbour_count += fetchGol(x + 1, y - 1);
// Left
neighbour_count += fetchGol(x - 1, y);
// Right
neighbour_count += fetchGol(x + 1, y);
// Bottom left
neighbour_count += fetchGol(x - 1, y + 1);
// Bottom middle
neighbour_count += fetchGol(x, y + 1);
// Bottom right
neighbour_count += fetchGol(x + 1, y + 1);
if (neighbour_count == 3)
setGol(x, y, 1);
else if (neighbour_count == 2)
setGol(x, y, fetchGol(x, y));
else
setGol(x, y, 0);
}

View File

@ -1,105 +1,134 @@
local ffi = require "ffi" local ffi = require "ffi"
local width, height = 1024, 1024
rl.InitWindow(width, height, "raylib-lua [core] example - compute shader")
local computeShaderCode
do
local f = io.open("resources/gol.glsl", "rb")
assert(f, "Can't read resources/gol.glsl file")
computeShaderCode = f:read "*a"
f:close()
end
local computeShader = rl.rlCompileShader(computeShaderCode, rl.RL_COMPUTE_SHADER) -- IMPORTANT: This must match gol*.glsl GOL_WIDTH constant.
local csProgram = rl.rlLoadComputeShaderProgram(computeShader) -- This must be a multiple of 16 (check golLogic compute dispatch).
print(csProgram) local GOL_WIDTH = 768
local ssbo_size = ffi.sizeof("int32_t[?]", width * height) -- Maximum amount of queued draw commands (squares draw from mouse down events).
local ssbo_baseBuffer = ffi.new("int32_t[?]", width * height) local MAX_BUFFERED_TRANSFERTS = 48
for i=0,width * height - 1 do
ssbo_baseBuffer[i] = 0
end
local shader_framebuffer = rl.new("Color[?]", width * height) ffi.cdef [[
local ssbo_image = rl.new "Image" ---@type Image typedef struct GolUpdateCmd {
unsigned int x;
unsigned int y;
unsigned int w;
unsigned int enabled;
} GolUpdateCmd;
]]
ssbo_image.data = shader_framebuffer ffi.cdef(string.format([[
ssbo_image.width = width typedef struct GolUpdateSSBO {
ssbo_image.height = height unsigned int count;
ssbo_image.format = rl.PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 GolUpdateCmd commands[%d];
ssbo_image.mipmaps = 1 } GolUpdateSSBO;
]], MAX_BUFFERED_TRANSFERTS))
local ssboA = rl.rlLoadShaderBuffer(ssbo_size, ssbo_baseBuffer, rl.RL_STREAM_COPY) rl.InitWindow(GOL_WIDTH, GOL_WIDTH, "raylib [rlgl] example - compute shader - game of life")
local ssboB = rl.rlLoadShaderBuffer(ssbo_size, ssbo_baseBuffer, rl.RL_STREAM_COPY)
-- Create a texture to apply shader local resolution = rl.new("Vector2", GOL_WIDTH, GOL_WIDTH)
local renderTexture = rl.LoadRenderTexture(width, height) local brushSize = 8
local renderShader = rl.LoadShaderFromMemory(nil, [[ -- Game of Life logic compute shader
#version 430 local golLogicCode = rl.LoadFileText("resources/glsl430/gol.glsl")
out vec4 finalColor; local golLogicShader = rl.rlCompileShader(golLogicCode, rl.RL_COMPUTE_SHADER);
in vec2 fragTexCoord; local golLogicProgram = rl.rlLoadComputeShaderProgram(golLogicShader);
rl.UnloadFileText(golLogicCode);
layout(std430, binding = 1) readonly buffer golLayout { -- Game of Life rendering compute shader
int golBuffer[]; local golRenderShader = rl.LoadShader(nil, "resources/glsl430/gol_render.glsl")
}; local resUniformLoc = rl.GetShaderLocation(golRenderShader, "resolution")
uniform vec2 res; local golTransfertCode = rl.LoadFileText("resources/glsl430/gol_transfert.glsl");
local golTransfertShader = rl.rlCompileShader(golTransfertCode, rl.RL_COMPUTE_SHADER);
local golTransfertProgram = rl.rlLoadComputeShaderProgram(golTransfertShader);
rl.UnloadFileText(golTransfertCode);
void main() local ssboSize = ffi.sizeof("int[?]", GOL_WIDTH * GOL_WIDTH)
{ local ssboA = rl.rlLoadShaderBuffer(ssboSize, nil, rl.RL_DYNAMIC_COPY);
ivec2 coords = ivec2(fragTexCoord * res); local ssboB = rl.rlLoadShaderBuffer(ssboSize, nil, rl.RL_DYNAMIC_COPY);
if (golBuffer[coords.x + coords.y * uint(res.x)] == 1) local transfertBuffer = ffi.new("struct GolUpdateSSBO")
finalColor = vec4(1.0); transfertBuffer.count = 0
else
finalColor = vec4(0.0, 0.0, 0.0, 1.0);
}
]])
local resolution = ffi.new("float[2]", width, height) local transfertBufferSize = ffi.sizeof "struct GolUpdateSSBO"
local res_uniform = rl.GetShaderLocation(renderShader, "res")
local transfertSSBO = rl.rlLoadShaderBuffer(transfertBufferSize, nil, rl.RL_DYNAMIC_COPY);
-- Create a white texture of the size of the window to update
-- each pixel of the window using the fragment shader
local whiteImage = rl.GenImageColor(GOL_WIDTH, GOL_WIDTH, rl.WHITE);
local whiteTex = rl.LoadTextureFromImage(whiteImage);
rl.UnloadImage(whiteImage)
while not rl.WindowShouldClose() do while not rl.WindowShouldClose() do
rl.BeginDrawing()
if rl.IsMouseButtonDown(rl.MOUSE_BUTTON_LEFT) then brushSize = math.floor(brushSize + rl.GetMouseWheelMove())
rl.rlReadShaderBufferElements(ssboB, ssbo_baseBuffer, ssbo_size, 0)
-- Correct colors if ((rl.IsMouseButtonDown(rl.MOUSE_BUTTON_LEFT) or rl.IsMouseButtonDown(rl.MOUSE_BUTTON_RIGHT))
for i=0,(width * height)-1 do and (transfertBuffer.count < MAX_BUFFERED_TRANSFERTS)) then
local toggled = ssbo_baseBuffer[i] -- Buffer a new command
transfertBuffer.commands[transfertBuffer.count].x = rl.GetMouseX() - brushSize/2
transfertBuffer.commands[transfertBuffer.count].y = rl.GetMouseY() - brushSize/2
transfertBuffer.commands[transfertBuffer.count].w = brushSize
transfertBuffer.commands[transfertBuffer.count].enabled = rl.IsMouseButtonDown(rl.MOUSE_BUTTON_LEFT)
transfertBuffer.count = transfertBuffer.count + 1
elseif transfertBuffer.count > 0 then
-- Process transfert buffer
shader_framebuffer[i].r = toggled * 255 -- Send SSBO buffer to GPU
shader_framebuffer[i].g = toggled * 255 rl.rlUpdateShaderBufferElements(transfertSSBO, transfertBuffer, transfertBufferSize, 0);
shader_framebuffer[i].b = toggled * 255
shader_framebuffer[i].a = toggled * 255
end
rl.ImageDrawRectangleV(ssbo_image, rl.GetMousePosition(), rl.new("Vector2", 25, 25), rl.WHITE) -- Process ssbo command
rl.rlEnableShader(golTransfertProgram);
rl.rlBindShaderBuffer(ssboA, 1);
rl.rlBindShaderBuffer(transfertSSBO, 3);
rl.rlComputeShaderDispatch(transfertBuffer.count, 1, 1) -- each GPU unit will process a command
rl.rlDisableShader();
for x=0,ssbo_image.width-1 do transfertBuffer.count = 0;
for y=0,ssbo_image.height-1 do
ssbo_baseBuffer[x + y * width] = (shader_framebuffer[x + y * width].r > 0)
end
end
rl.rlUpdateShaderBufferElements(ssboB, ssbo_baseBuffer, ssbo_size, 0)
else else
rl.rlEnableShader(csProgram) -- Process game of life logic
rl.rlEnableShader(golLogicProgram)
rl.rlBindShaderBuffer(ssboA, 1) rl.rlBindShaderBuffer(ssboA, 1)
rl.rlBindShaderBuffer(ssboB, 2) rl.rlBindShaderBuffer(ssboB, 2)
rl.rlComputeShaderDispatch(width / 16, height / 16, 1) rl.rlComputeShaderDispatch(GOL_WIDTH / 16, GOL_WIDTH / 16, 1)
rl.rlDisableShader() rl.rlDisableShader()
end
rl.ClearBackground(rl.BLANK)
rl.SetShaderValue(renderShader, res_uniform, resolution, rl.SHADER_UNIFORM_VEC2)
rl.BeginShaderMode(renderShader)
rl.DrawTexture(renderTexture.texture, 0, 0, rl.WHITE)
rl.EndShaderMode()
rl.DrawFPS(0, 0)
rl.EndDrawing()
ssboA, ssboB = ssboB, ssboA ssboA, ssboB = ssboB, ssboA
end
rl.rlBindShaderBuffer(ssboA, 1)
rl.SetShaderValue(golRenderShader, resUniformLoc, resolution, rl.SHADER_UNIFORM_VEC2);
rl.BeginDrawing()
rl.ClearBackground(rl.BLANK)
rl.BeginShaderMode(golRenderShader)
rl.DrawTexture(whiteTex, 0, 0, rl.WHITE)
rl.EndShaderMode()
rl.DrawRectangleLines(
rl.GetMouseX() - brushSize/2,
rl.GetMouseY() - brushSize/2,
brushSize, brushSize,
rl.RED)
rl.DrawText("Use Mouse wheel to increase/decrease brush size", 10, 10, 20, rl.WHITE);
rl.DrawFPS(rl.GetScreenWidth() - 100, 10);
rl.EndDrawing()
end end
rl.CloseWindow() rl.rlUnloadShaderBuffer(ssboA);
rl.rlUnloadShaderBuffer(ssboB);
rl.rlUnloadShaderBuffer(transfertSSBO);
-- Unload compute shader programs
rl.rlUnloadShaderProgram(golTransfertProgram)
rl.rlUnloadShaderProgram(golLogicProgram)
rl.UnloadTexture(whiteTex) -- Unload white texture
rl.UnloadShader(golRenderShader) -- Unload rendering fragment shader
rl.CloseWindow() -- Close window and OpenGL context

2
luajit

@ -1 +1 @@
Subproject commit e4b4d9451402be704d5b47a359f640a29db4977f Subproject commit 5e3c45c43bb0e0f1f2917d432e9d2dba12c42a6e

View File

@ -15,13 +15,14 @@ MODULES := raymath rlgl easings gestures physac raygui
PLATFORM ?= PLATFORM_DESKTOP PLATFORM ?= PLATFORM_DESKTOP
GRAPHICS ?= GRAPHICS_API_OPENGL_33 GRAPHICS ?= GRAPHICS_API_OPENGL_33
CFLAGS += -D$(GRAPHICS) CFLAGS += -D$(GRAPHICS) -D$(PLATFORM)
USE_WAYLAND_DISPLAY ?= FALSE USE_WAYLAND_DISPLAY ?= FALSE
USE_EXTERNAL_GLFW ?= FALSE USE_EXTERNAL_GLFW ?= FALSE
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
LDFLAGS += -lopengl32 -lgdi32 -lwinmm -static LDFLAGS += -lopengl32 -lgdi32 -lwinmm -static
LDFLAGS_R += -mwindows
EXTERNAL_FILES := src/res/icon.res EXTERNAL_FILES := src/res/icon.res
else ifeq ($(shell uname),Darwin) else ifeq ($(shell uname),Darwin)
LDFLAGS += -framework CoreVideo -framework IOKit -framework Cocoa \ LDFLAGS += -framework CoreVideo -framework IOKit -framework Cocoa \
@ -38,7 +39,7 @@ else
EXTERNAL_FILES := EXTERNAL_FILES :=
endif endif
all: raylua_s raylua_e luajit raylib all: raylua_s raylua_e raylua_r luajit raylib
%.o: %.c %.o: %.c
$(CC) -c -o $@ $< $(CFLAGS) $(CC) -c -o $@ $< $(CFLAGS)
@ -63,6 +64,10 @@ raylua_e: src/raylua_e.o src/raylua_self.o src/raylua_builder.o src/lib/miniz.o
$(EXTERNAL_FILES) libraylua.a $(EXTERNAL_FILES) libraylua.a
$(CC) -o $@ $^ $(LDFLAGS) luajit/src/libluajit.a $(CC) -o $@ $^ $(LDFLAGS) luajit/src/libluajit.a
raylua_r: src/raylua_e.o src/raylua_self.o src/raylua_builder.o src/lib/miniz.o \
$(EXTERNAL_FILES) libraylua.a
$(CC) -o $@ $^ $(LDFLAGS) $(LDFLAGS_R) luajit/src/libluajit.a
src/res/icon.res: src/res/icon.rc src/res/icon.res: src/res/icon.rc
$(WINDRES) $^ -O coff $@ $(WINDRES) $^ -O coff $@

2
raygui

@ -1 +1 @@
Subproject commit e81fd89b6dcc97bf1cee7878e8c6cfcbca2583a7 Subproject commit 865bb293764073c01e74314ef647464f1f10fd96

2
raylib

@ -1 +1 @@
Subproject commit 99f6707e2c80be2ac4c169fd6986ff2fd8d181a7 Subproject commit 559ffc633164c30824065a63324ba08efa651ee6

View File

@ -231,8 +231,11 @@ ffi.cdef [[
} Wave; } Wave;
typedef struct rAudioBuffer rAudioBuffer; typedef struct rAudioBuffer rAudioBuffer;
typedef struct rAudioProcessor rAudioProcessor;
typedef struct AudioStream { typedef struct AudioStream {
rAudioBuffer *buffer; rAudioBuffer *buffer;
rAudioProcessor *processor;
unsigned int sampleRate; unsigned int sampleRate;
unsigned int sampleSize; unsigned int sampleSize;
@ -597,6 +600,7 @@ ffi.cdef [[
BLEND_MULTIPLIED, BLEND_MULTIPLIED,
BLEND_ADD_COLORS, BLEND_ADD_COLORS,
BLEND_SUBTRACT_COLORS, BLEND_SUBTRACT_COLORS,
BLEND_ALPHA_PREMUL,
BLEND_CUSTOM BLEND_CUSTOM
} BlendMode; } BlendMode;
@ -634,6 +638,7 @@ ffi.cdef [[
} NPatchLayout; } NPatchLayout;
typedef void (*TraceLogCallback)(int logLevel, const char *text, va_list args); typedef void (*TraceLogCallback)(int logLevel, const char *text, va_list args);
typedef void (*AudioCallback)(void *bufferData, unsigned int frames);
]] ]]
-- raymath cdef -- raymath cdef
@ -702,6 +707,7 @@ ffi.cdef [[
RL_BLEND_MULTIPLIED, RL_BLEND_MULTIPLIED,
RL_BLEND_ADD_COLORS, RL_BLEND_ADD_COLORS,
RL_BLEND_SUBTRACT_COLORS, RL_BLEND_SUBTRACT_COLORS,
RL_BLEND_ALPHA_PREMUL,
RL_BLEND_CUSTOM RL_BLEND_CUSTOM
} rlBlendMode; } rlBlendMode;
@ -1012,6 +1018,15 @@ ffi.cdef [[
PROGRESS_PADDING = 16, PROGRESS_PADDING = 16,
} GuiProgressBarProperty; } GuiProgressBarProperty;
typedef enum {
ARROWS_SIZE = 16,
ARROWS_VISIBLE,
SCROLL_SLIDER_PADDING,
SCROLL_SLIDER_SIZE,
SCROLL_PADDING,
SCROLL_SPEED,
} GuiScrollBarProperty;
typedef enum { typedef enum {
CHECK_PADDING = 16 CHECK_PADDING = 16
} GuiCheckBoxProperty; } GuiCheckBoxProperty;
@ -1023,30 +1038,19 @@ ffi.cdef [[
typedef enum { typedef enum {
ARROW_PADDING = 16, ARROW_PADDING = 16,
DROPDOWN_ITEMS_PADDING DROPDOWN_ITEMS_SPACING
} GuiDropdownBoxProperty; } GuiDropdownBoxProperty;
typedef enum { typedef enum {
TEXT_INNER_PADDING = 16, TEXT_INNER_PADDING = 16,
TEXT_LINES_PADDING, TEXT_LINES_SPACING
COLOR_SELECTED_FG,
COLOR_SELECTED_BG
} GuiTextBoxProperty; } GuiTextBoxProperty;
typedef enum { typedef enum {
SPIN_BUTTON_WIDTH = 16, SPIN_BUTTON_WIDTH = 16,
SPIN_BUTTON_PADDING, SPIN_BUTTON_SPACING,
} GuiSpinnerProperty; } GuiSpinnerProperty;
typedef enum {
ARROWS_SIZE = 16,
ARROWS_VISIBLE,
SCROLL_SLIDER_PADDING,
SCROLL_SLIDER_SIZE,
SCROLL_PADDING,
SCROLL_SPEED,
} GuiScrollBarProperty;
typedef enum { typedef enum {
SCROLLBAR_LEFT_SIDE = 0, SCROLLBAR_LEFT_SIDE = 0,
SCROLLBAR_RIGHT_SIDE SCROLLBAR_RIGHT_SIDE
@ -1054,7 +1058,7 @@ ffi.cdef [[
typedef enum { typedef enum {
LIST_ITEMS_HEIGHT = 16, LIST_ITEMS_HEIGHT = 16,
LIST_ITEMS_PADDING, LIST_ITEMS_SPACING,
SCROLLBAR_WIDTH, SCROLLBAR_WIDTH,
SCROLLBAR_SIDE, SCROLLBAR_SIDE,
} GuiListViewProperty; } GuiListViewProperty;
@ -1075,262 +1079,262 @@ ffi.cdef [[
} GuiTextBoxState; } GuiTextBoxState;
typedef enum { typedef enum {
RICON_NONE = 0, RAYGUI_ICON_NONE = 0,
RICON_FOLDER_FILE_OPEN = 1, RAYGUI_ICON_FOLDER_FILE_OPEN = 1,
RICON_FILE_SAVE_CLASSIC = 2, RAYGUI_ICON_FILE_SAVE_CLASSIC = 2,
RICON_FOLDER_OPEN = 3, RAYGUI_ICON_FOLDER_OPEN = 3,
RICON_FOLDER_SAVE = 4, RAYGUI_ICON_FOLDER_SAVE = 4,
RICON_FILE_OPEN = 5, RAYGUI_ICON_FILE_OPEN = 5,
RICON_FILE_SAVE = 6, RAYGUI_ICON_FILE_SAVE = 6,
RICON_FILE_EXPORT = 7, RAYGUI_ICON_FILE_EXPORT = 7,
RICON_FILE_NEW = 8, RAYGUI_ICON_FILE_ADD = 8,
RICON_FILE_DELETE = 9, RAYGUI_ICON_FILE_DELETE = 9,
RICON_FILETYPE_TEXT = 10, RAYGUI_ICON_FILETYPE_TEXT = 10,
RICON_FILETYPE_AUDIO = 11, RAYGUI_ICON_FILETYPE_AUDIO = 11,
RICON_FILETYPE_IMAGE = 12, RAYGUI_ICON_FILETYPE_IMAGE = 12,
RICON_FILETYPE_PLAY = 13, RAYGUI_ICON_FILETYPE_PLAY = 13,
RICON_FILETYPE_VIDEO = 14, RAYGUI_ICON_FILETYPE_VIDEO = 14,
RICON_FILETYPE_INFO = 15, RAYGUI_ICON_FILETYPE_INFO = 15,
RICON_FILE_COPY = 16, RAYGUI_ICON_FILE_COPY = 16,
RICON_FILE_CUT = 17, RAYGUI_ICON_FILE_CUT = 17,
RICON_FILE_PASTE = 18, RAYGUI_ICON_FILE_PASTE = 18,
RICON_CURSOR_HAND = 19, RAYGUI_ICON_CURSOR_HAND = 19,
RICON_CURSOR_POINTER = 20, RAYGUI_ICON_CURSOR_POINTER = 20,
RICON_CURSOR_CLASSIC = 21, RAYGUI_ICON_CURSOR_CLASSIC = 21,
RICON_PENCIL = 22, RAYGUI_ICON_PENCIL = 22,
RICON_PENCIL_BIG = 23, RAYGUI_ICON_PENCIL_BIG = 23,
RICON_BRUSH_CLASSIC = 24, RAYGUI_ICON_BRUSH_CLASSIC = 24,
RICON_BRUSH_PAINTER = 25, RAYGUI_ICON_BRUSH_PAINTER = 25,
RICON_WATER_DROP = 26, RAYGUI_ICON_WATER_DROP = 26,
RICON_COLOR_PICKER = 27, RAYGUI_ICON_COLOR_PICKER = 27,
RICON_RUBBER = 28, RAYGUI_ICON_RUBBER = 28,
RICON_COLOR_BUCKET = 29, RAYGUI_ICON_COLOR_BUCKET = 29,
RICON_TEXT_T = 30, RAYGUI_ICON_TEXT_T = 30,
RICON_TEXT_A = 31, RAYGUI_ICON_TEXT_A = 31,
RICON_SCALE = 32, RAYGUI_ICON_SCALE = 32,
RICON_RESIZE = 33, RAYGUI_ICON_RESIZE = 33,
RICON_FILTER_POINT = 34, RAYGUI_ICON_FILTER_POINT = 34,
RICON_FILTER_BILINEAR = 35, RAYGUI_ICON_FILTER_BILINEAR = 35,
RICON_CROP = 36, RAYGUI_ICON_CROP = 36,
RICON_CROP_ALPHA = 37, RAYGUI_ICON_CROP_ALPHA = 37,
RICON_SQUARE_TOGGLE = 38, RAYGUI_ICON_SQUARE_TOGGLE = 38,
RICON_SYMMETRY = 39, RAYGUI_ICON_SYMMETRY = 39,
RICON_SYMMETRY_HORIZONTAL = 40, RAYGUI_ICON_SYMMETRY_HORIZONTAL = 40,
RICON_SYMMETRY_VERTICAL = 41, RAYGUI_ICON_SYMMETRY_VERTICAL = 41,
RICON_LENS = 42, RAYGUI_ICON_LENS = 42,
RICON_LENS_BIG = 43, RAYGUI_ICON_LENS_BIG = 43,
RICON_EYE_ON = 44, RAYGUI_ICON_EYE_ON = 44,
RICON_EYE_OFF = 45, RAYGUI_ICON_EYE_OFF = 45,
RICON_FILTER_TOP = 46, RAYGUI_ICON_FILTER_TOP = 46,
RICON_FILTER = 47, RAYGUI_ICON_FILTER = 47,
RICON_TARGET_POINT = 48, RAYGUI_ICON_TARGET_POINT = 48,
RICON_TARGET_SMALL = 49, RAYGUI_ICON_TARGET_SMALL = 49,
RICON_TARGET_BIG = 50, RAYGUI_ICON_TARGET_BIG = 50,
RICON_TARGET_MOVE = 51, RAYGUI_ICON_TARGET_MOVE = 51,
RICON_CURSOR_MOVE = 52, RAYGUI_ICON_CURSOR_MOVE = 52,
RICON_CURSOR_SCALE = 53, RAYGUI_ICON_CURSOR_SCALE = 53,
RICON_CURSOR_SCALE_RIGHT = 54, RAYGUI_ICON_CURSOR_SCALE_RIGHT = 54,
RICON_CURSOR_SCALE_LEFT = 55, RAYGUI_ICON_CURSOR_SCALE_LEFT = 55,
RICON_UNDO = 56, RAYGUI_ICON_UNDO = 56,
RICON_REDO = 57, RAYGUI_ICON_REDO = 57,
RICON_REREDO = 58, RAYGUI_ICON_REREDO = 58,
RICON_MUTATE = 59, RAYGUI_ICON_MUTATE = 59,
RICON_ROTATE = 60, RAYGUI_ICON_ROTATE = 60,
RICON_REPEAT = 61, RAYGUI_ICON_REPEAT = 61,
RICON_SHUFFLE = 62, RAYGUI_ICON_SHUFFLE = 62,
RICON_EMPTYBOX = 63, RAYGUI_ICON_EMPTYBOX = 63,
RICON_TARGET = 64, RAYGUI_ICON_TARGET = 64,
RICON_TARGET_SMALL_FILL = 65, RAYGUI_ICON_TARGET_SMALL_FILL = 65,
RICON_TARGET_BIG_FILL = 66, RAYGUI_ICON_TARGET_BIG_FILL = 66,
RICON_TARGET_MOVE_FILL = 67, RAYGUI_ICON_TARGET_MOVE_FILL = 67,
RICON_CURSOR_MOVE_FILL = 68, RAYGUI_ICON_CURSOR_MOVE_FILL = 68,
RICON_CURSOR_SCALE_FILL = 69, RAYGUI_ICON_CURSOR_SCALE_FILL = 69,
RICON_CURSOR_SCALE_RIGHT_FILL = 70, RAYGUI_ICON_CURSOR_SCALE_RIGHT_FILL = 70,
RICON_CURSOR_SCALE_LEFT_FILL = 71, RAYGUI_ICON_CURSOR_SCALE_LEFT_FILL = 71,
RICON_UNDO_FILL = 72, RAYGUI_ICON_UNDO_FILL = 72,
RICON_REDO_FILL = 73, RAYGUI_ICON_REDO_FILL = 73,
RICON_REREDO_FILL = 74, RAYGUI_ICON_REREDO_FILL = 74,
RICON_MUTATE_FILL = 75, RAYGUI_ICON_MUTATE_FILL = 75,
RICON_ROTATE_FILL = 76, RAYGUI_ICON_ROTATE_FILL = 76,
RICON_REPEAT_FILL = 77, RAYGUI_ICON_REPEAT_FILL = 77,
RICON_SHUFFLE_FILL = 78, RAYGUI_ICON_SHUFFLE_FILL = 78,
RICON_EMPTYBOX_SMALL = 79, RAYGUI_ICON_EMPTYBOX_SMALL = 79,
RICON_BOX = 80, RAYGUI_ICON_BOX = 80,
RICON_BOX_TOP = 81, RAYGUI_ICON_BOX_TOP = 81,
RICON_BOX_TOP_RIGHT = 82, RAYGUI_ICON_BOX_TOP_RIGHT = 82,
RICON_BOX_RIGHT = 83, RAYGUI_ICON_BOX_RIGHT = 83,
RICON_BOX_BOTTOM_RIGHT = 84, RAYGUI_ICON_BOX_BOTTOM_RIGHT = 84,
RICON_BOX_BOTTOM = 85, RAYGUI_ICON_BOX_BOTTOM = 85,
RICON_BOX_BOTTOM_LEFT = 86, RAYGUI_ICON_BOX_BOTTOM_LEFT = 86,
RICON_BOX_LEFT = 87, RAYGUI_ICON_BOX_LEFT = 87,
RICON_BOX_TOP_LEFT = 88, RAYGUI_ICON_BOX_TOP_LEFT = 88,
RICON_BOX_CENTER = 89, RAYGUI_ICON_BOX_CENTER = 89,
RICON_BOX_CIRCLE_MASK = 90, RAYGUI_ICON_BOX_CIRCLE_MASK = 90,
RICON_POT = 91, RAYGUI_ICON_POT = 91,
RICON_ALPHA_MULTIPLY = 92, RAYGUI_ICON_ALPHA_MULTIPLY = 92,
RICON_ALPHA_CLEAR = 93, RAYGUI_ICON_ALPHA_CLEAR = 93,
RICON_DITHERING = 94, RAYGUI_ICON_DITHERING = 94,
RICON_MIPMAPS = 95, RAYGUI_ICON_MIPMAPS = 95,
RICON_BOX_GRID = 96, RAYGUI_ICON_BOX_GRID = 96,
RICON_GRID = 97, RAYGUI_ICON_GRID = 97,
RICON_BOX_CORNERS_SMALL = 98, RAYGUI_ICON_BOX_CORNERS_SMALL = 98,
RICON_BOX_CORNERS_BIG = 99, RAYGUI_ICON_BOX_CORNERS_BIG = 99,
RICON_FOUR_BOXES = 100, RAYGUI_ICON_FOUR_BOXES = 100,
RICON_GRID_FILL = 101, RAYGUI_ICON_GRID_FILL = 101,
RICON_BOX_MULTISIZE = 102, RAYGUI_ICON_BOX_MULTISIZE = 102,
RICON_ZOOM_SMALL = 103, RAYGUI_ICON_ZOOM_SMALL = 103,
RICON_ZOOM_MEDIUM = 104, RAYGUI_ICON_ZOOM_MEDIUM = 104,
RICON_ZOOM_BIG = 105, RAYGUI_ICON_ZOOM_BIG = 105,
RICON_ZOOM_ALL = 106, RAYGUI_ICON_ZOOM_ALL = 106,
RICON_ZOOM_CENTER = 107, RAYGUI_ICON_ZOOM_CENTER = 107,
RICON_BOX_DOTS_SMALL = 108, RAYGUI_ICON_BOX_DOTS_SMALL = 108,
RICON_BOX_DOTS_BIG = 109, RAYGUI_ICON_BOX_DOTS_BIG = 109,
RICON_BOX_CONCENTRIC = 110, RAYGUI_ICON_BOX_CONCENTRIC = 110,
RICON_BOX_GRID_BIG = 111, RAYGUI_ICON_BOX_GRID_BIG = 111,
RICON_OK_TICK = 112, RAYGUI_ICON_OK_TICK = 112,
RICON_CROSS = 113, RAYGUI_ICON_CROSS = 113,
RICON_ARROW_LEFT = 114, RAYGUI_ICON_ARROW_LEFT = 114,
RICON_ARROW_RIGHT = 115, RAYGUI_ICON_ARROW_RIGHT = 115,
RICON_ARROW_BOTTOM = 116, RAYGUI_ICON_ARROW_DOWN = 116,
RICON_ARROW_TOP = 117, RAYGUI_ICON_ARROW_UP = 117,
RICON_ARROW_LEFT_FILL = 118, RAYGUI_ICON_ARROW_LEFT_FILL = 118,
RICON_ARROW_RIGHT_FILL = 119, RAYGUI_ICON_ARROW_RIGHT_FILL = 119,
RICON_ARROW_BOTTOM_FILL = 120, RAYGUI_ICON_ARROW_DOWN_FILL = 120,
RICON_ARROW_TOP_FILL = 121, RAYGUI_ICON_ARROW_UP_FILL = 121,
RICON_AUDIO = 122, RAYGUI_ICON_AUDIO = 122,
RICON_FX = 123, RAYGUI_ICON_FX = 123,
RICON_WAVE = 124, RAYGUI_ICON_WAVE = 124,
RICON_WAVE_SINUS = 125, RAYGUI_ICON_WAVE_SINUS = 125,
RICON_WAVE_SQUARE = 126, RAYGUI_ICON_WAVE_SQUARE = 126,
RICON_WAVE_TRIANGULAR = 127, RAYGUI_ICON_WAVE_TRIANGULAR = 127,
RICON_CROSS_SMALL = 128, RAYGUI_ICON_CROSS_SMALL = 128,
RICON_PLAYER_PREVIOUS = 129, RAYGUI_ICON_PLAYER_PREVIOUS = 129,
RICON_PLAYER_PLAY_BACK = 130, RAYGUI_ICON_PLAYER_PLAY_BACK = 130,
RICON_PLAYER_PLAY = 131, RAYGUI_ICON_PLAYER_PLAY = 131,
RICON_PLAYER_PAUSE = 132, RAYGUI_ICON_PLAYER_PAUSE = 132,
RICON_PLAYER_STOP = 133, RAYGUI_ICON_PLAYER_STOP = 133,
RICON_PLAYER_NEXT = 134, RAYGUI_ICON_PLAYER_NEXT = 134,
RICON_PLAYER_RECORD = 135, RAYGUI_ICON_PLAYER_RECORD = 135,
RICON_MAGNET = 136, RAYGUI_ICON_MAGNET = 136,
RICON_LOCK_CLOSE = 137, RAYGUI_ICON_LOCK_CLOSE = 137,
RICON_LOCK_OPEN = 138, RAYGUI_ICON_LOCK_OPEN = 138,
RICON_CLOCK = 139, RAYGUI_ICON_CLOCK = 139,
RICON_TOOLS = 140, RAYGUI_ICON_TOOLS = 140,
RICON_GEAR = 141, RAYGUI_ICON_GEAR = 141,
RICON_GEAR_BIG = 142, RAYGUI_ICON_GEAR_BIG = 142,
RICON_BIN = 143, RAYGUI_ICON_BIN = 143,
RICON_HAND_POINTER = 144, RAYGUI_ICON_HAND_POINTER = 144,
RICON_LASER = 145, RAYGUI_ICON_LASER = 145,
RICON_COIN = 146, RAYGUI_ICON_COIN = 146,
RICON_EXPLOSION = 147, RAYGUI_ICON_EXPLOSION = 147,
RICON_1UP = 148, RAYGUI_ICON_1UP = 148,
RICON_PLAYER = 149, RAYGUI_ICON_PLAYER = 149,
RICON_PLAYER_JUMP = 150, RAYGUI_ICON_PLAYER_JUMP = 150,
RICON_KEY = 151, RAYGUI_ICON_KEY = 151,
RICON_DEMON = 152, RAYGUI_ICON_DEMON = 152,
RICON_TEXT_POPUP = 153, RAYGUI_ICON_TEXT_POPUP = 153,
RICON_GEAR_EX = 154, RAYGUI_ICON_GEAR_EX = 154,
RICON_CRACK = 155, RAYGUI_ICON_CRACK = 155,
RICON_CRACK_POINTS = 156, RAYGUI_ICON_CRACK_POINTS = 156,
RICON_STAR = 157, RAYGUI_ICON_STAR = 157,
RICON_DOOR = 158, RAYGUI_ICON_DOOR = 158,
RICON_EXIT = 159, RAYGUI_ICON_EXIT = 159,
RICON_MODE_2D = 160, RAYGUI_ICON_MODE_2D = 160,
RICON_MODE_3D = 161, RAYGUI_ICON_MODE_3D = 161,
RICON_CUBE = 162, RAYGUI_ICON_CUBE = 162,
RICON_CUBE_FACE_TOP = 163, RAYGUI_ICON_CUBE_FACE_TOP = 163,
RICON_CUBE_FACE_LEFT = 164, RAYGUI_ICON_CUBE_FACE_LEFT = 164,
RICON_CUBE_FACE_FRONT = 165, RAYGUI_ICON_CUBE_FACE_FRONT = 165,
RICON_CUBE_FACE_BOTTOM = 166, RAYGUI_ICON_CUBE_FACE_BOTTOM = 166,
RICON_CUBE_FACE_RIGHT = 167, RAYGUI_ICON_CUBE_FACE_RIGHT = 167,
RICON_CUBE_FACE_BACK = 168, RAYGUI_ICON_CUBE_FACE_BACK = 168,
RICON_CAMERA = 169, RAYGUI_ICON_CAMERA = 169,
RICON_SPECIAL = 170, RAYGUI_ICON_SPECIAL = 170,
RICON_LINK_NET = 171, RAYGUI_ICON_LINK_NET = 171,
RICON_LINK_BOXES = 172, RAYGUI_ICON_LINK_BOXES = 172,
RICON_LINK_MULTI = 173, RAYGUI_ICON_LINK_MULTI = 173,
RICON_LINK = 174, RAYGUI_ICON_LINK = 174,
RICON_LINK_BROKE = 175, RAYGUI_ICON_LINK_BROKE = 175,
RICON_TEXT_NOTES = 176, RAYGUI_ICON_TEXT_NOTES = 176,
RICON_NOTEBOOK = 177, RAYGUI_ICON_NOTEBOOK = 177,
RICON_SUITCASE = 178, RAYGUI_ICON_SUITCASE = 178,
RICON_SUITCASE_ZIP = 179, RAYGUI_ICON_SUITCASE_ZIP = 179,
RICON_MAILBOX = 180, RAYGUI_ICON_MAILBOX = 180,
RICON_MONITOR = 181, RAYGUI_ICON_MONITOR = 181,
RICON_PRINTER = 182, RAYGUI_ICON_PRINTER = 182,
RICON_PHOTO_CAMERA = 183, RAYGUI_ICON_PHOTO_CAMERA = 183,
RICON_PHOTO_CAMERA_FLASH = 184, RAYGUI_ICON_PHOTO_CAMERA_FLASH = 184,
RICON_HOUSE = 185, RAYGUI_ICON_HOUSE = 185,
RICON_HEART = 186, RAYGUI_ICON_HEART = 186,
RICON_CORNER = 187, RAYGUI_ICON_CORNER = 187,
RICON_VERTICAL_BARS = 188, RAYGUI_ICON_VERTICAL_BARS = 188,
RICON_VERTICAL_BARS_FILL = 189, RAYGUI_ICON_VERTICAL_BARS_FILL = 189,
RICON_LIFE_BARS = 190, RAYGUI_ICON_LIFE_BARS = 190,
RICON_INFO = 191, RAYGUI_ICON_INFO = 191,
RICON_CROSSLINE = 192, RAYGUI_ICON_CROSSLINE = 192,
RICON_HELP = 193, RAYGUI_ICON_HELP = 193,
RICON_FILETYPE_ALPHA = 194, RAYGUI_ICON_FILETYPE_ALPHA = 194,
RICON_FILETYPE_HOME = 195, RAYGUI_ICON_FILETYPE_HOME = 195,
RICON_LAYERS_VISIBLE = 196, RAYGUI_ICON_LAYERS_VISIBLE = 196,
RICON_LAYERS = 197, RAYGUI_ICON_LAYERS = 197,
RICON_WINDOW = 198, RAYGUI_ICON_WINDOW = 198,
RICON_HIDPI = 199, RAYGUI_ICON_HIDPI = 199,
RICON_200 = 200, RAYGUI_ICON_FILETYPE_BINARY = 200,
RICON_201 = 201, RAYGUI_ICON_HEX = 201,
RICON_202 = 202, RAYGUI_ICON_SHIELD = 202,
RICON_203 = 203, RAYGUI_ICON_FILE_NEW = 203,
RICON_204 = 204, RAYGUI_ICON_FOLDER_ADD = 204,
RICON_205 = 205, RAYGUI_ICON_205 = 205,
RICON_206 = 206, RAYGUI_ICON_206 = 206,
RICON_207 = 207, RAYGUI_ICON_207 = 207,
RICON_208 = 208, RAYGUI_ICON_208 = 208,
RICON_209 = 209, RAYGUI_ICON_209 = 209,
RICON_210 = 210, RAYGUI_ICON_210 = 210,
RICON_211 = 211, RAYGUI_ICON_211 = 211,
RICON_212 = 212, RAYGUI_ICON_212 = 212,
RICON_213 = 213, RAYGUI_ICON_213 = 213,
RICON_214 = 214, RAYGUI_ICON_214 = 214,
RICON_215 = 215, RAYGUI_ICON_215 = 215,
RICON_216 = 216, RAYGUI_ICON_216 = 216,
RICON_217 = 217, RAYGUI_ICON_217 = 217,
RICON_218 = 218, RAYGUI_ICON_218 = 218,
RICON_219 = 219, RAYGUI_ICON_219 = 219,
RICON_220 = 220, RAYGUI_ICON_220 = 220,
RICON_221 = 221, RAYGUI_ICON_221 = 221,
RICON_222 = 222, RAYGUI_ICON_222 = 222,
RICON_223 = 223, RAYGUI_ICON_223 = 223,
RICON_224 = 224, RAYGUI_ICON_224 = 224,
RICON_225 = 225, RAYGUI_ICON_225 = 225,
RICON_226 = 226, RAYGUI_ICON_226 = 226,
RICON_227 = 227, RAYGUI_ICON_227 = 227,
RICON_228 = 228, RAYGUI_ICON_228 = 228,
RICON_229 = 229, RAYGUI_ICON_229 = 229,
RICON_230 = 230, RAYGUI_ICON_230 = 230,
RICON_231 = 231, RAYGUI_ICON_231 = 231,
RICON_232 = 232, RAYGUI_ICON_232 = 232,
RICON_233 = 233, RAYGUI_ICON_233 = 233,
RICON_234 = 234, RAYGUI_ICON_234 = 234,
RICON_235 = 235, RAYGUI_ICON_235 = 235,
RICON_236 = 236, RAYGUI_ICON_236 = 236,
RICON_237 = 237, RAYGUI_ICON_237 = 237,
RICON_238 = 238, RAYGUI_ICON_238 = 238,
RICON_239 = 239, RAYGUI_ICON_239 = 239,
RICON_240 = 240, RAYGUI_ICON_240 = 240,
RICON_241 = 241, RAYGUI_ICON_241 = 241,
RICON_242 = 242, RAYGUI_ICON_242 = 242,
RICON_243 = 243, RAYGUI_ICON_243 = 243,
RICON_244 = 244, RAYGUI_ICON_244 = 244,
RICON_245 = 245, RAYGUI_ICON_245 = 245,
RICON_246 = 246, RAYGUI_ICON_246 = 246,
RICON_247 = 247, RAYGUI_ICON_247 = 247,
RICON_248 = 248, RAYGUI_ICON_248 = 248,
RICON_249 = 249, RAYGUI_ICON_249 = 249,
RICON_250 = 250, RAYGUI_ICON_250 = 250,
RICON_251 = 251, RAYGUI_ICON_251 = 251,
RICON_252 = 252, RAYGUI_ICON_252 = 252,
RICON_253 = 253, RAYGUI_ICON_253 = 253,
RICON_254 = 254, RAYGUI_ICON_254 = 254,
RICON_255 = 255, RAYGUI_ICON_255 = 255,
} guiIconName; } guiIconName;
]] ]]

View File

@ -27,7 +27,6 @@
#include <extras/easings.h> #include <extras/easings.h>
#include <rgestures.h> #include <rgestures.h>
#define RAYGUI_SUPPORT_RICONS
#define RAYGUI_IMPLEMENTATION #define RAYGUI_IMPLEMENTATION
#define RAYGUI_STATIC #define RAYGUI_STATIC
#include <raygui.h> #include <raygui.h>
@ -40,6 +39,9 @@
extern const char *raylua_boot_str; extern const char *raylua_boot_str;
#ifdef WIN32
__declspec(dllexport)
#endif
void raylua_boot(lua_State *L, lua_CFunction loadfile, lua_CFunction listfiles, void raylua_boot(lua_State *L, lua_CFunction loadfile, lua_CFunction listfiles,
bool repl) bool repl)
{ {
@ -77,6 +79,9 @@ void raylua_boot(lua_State *L, lua_CFunction loadfile, lua_CFunction listfiles,
} }
} }
#ifdef WIN32
__declspec(dllexport)
#endif
int luaopen_raylua(lua_State *L) int luaopen_raylua(lua_State *L)
{ {
raylua_boot(L, NULL, NULL, false); raylua_boot(L, NULL, NULL, false);

View File

@ -16,7 +16,7 @@
local load = loadstring local load = loadstring
raylua.version = "v4.0-dev" raylua.version = "v4.0b"
function raylua.repl() function raylua.repl()
print("> raylua " .. raylua.version .. " <") print("> raylua " .. raylua.version .. " <")

View File

@ -21,9 +21,12 @@ void SetWindowPosition(int x, int y)
void SetWindowMonitor(int monitor) void SetWindowMonitor(int monitor)
void SetWindowMinSize(int width, int height) void SetWindowMinSize(int width, int height)
void SetWindowSize(int width, int height) void SetWindowSize(int width, int height)
void SetWindowOpacity(float opacity)
void *GetWindowHandle(void) void *GetWindowHandle(void)
int GetScreenWidth(void) int GetScreenWidth(void)
int GetScreenHeight(void) int GetScreenHeight(void)
int GetRenderWidth(void)
int GetRenderHeight(void)
int GetMonitorCount(void) int GetMonitorCount(void)
int GetCurrentMonitor(void) int GetCurrentMonitor(void)
Vector2 GetMonitorPosition(int monitor) Vector2 GetMonitorPosition(int monitor)
@ -104,12 +107,14 @@ bool SaveFileText(const char *fileName, char *text)
bool FileExists(const char *fileName) bool FileExists(const char *fileName)
bool DirectoryExists(const char *dirPath) bool DirectoryExists(const char *dirPath)
bool IsFileExtension(const char *fileName, const char *ext) bool IsFileExtension(const char *fileName, const char *ext)
int GetFileLength(const char *fileName)
const char *GetFileExtension(const char *fileName) const char *GetFileExtension(const char *fileName)
const char *GetFileName(const char *filePath) const char *GetFileName(const char *filePath)
const char *GetFileNameWithoutExt(const char *filePath) const char *GetFileNameWithoutExt(const char *filePath)
const char *GetDirectoryPath(const char *filePath) const char *GetDirectoryPath(const char *filePath)
const char *GetPrevDirectoryPath(const char *dirPath) const char *GetPrevDirectoryPath(const char *dirPath)
const char *GetWorkingDirectory(void) const char *GetWorkingDirectory(void)
const char *GetApplicationDirectory(void)
char **GetDirectoryFiles(const char *dirPath, int *count) char **GetDirectoryFiles(const char *dirPath, int *count)
void ClearDirectoryFiles(void) void ClearDirectoryFiles(void)
bool ChangeDirectory(const char *dir) bool ChangeDirectory(const char *dir)
@ -117,8 +122,10 @@ bool IsFileDropped(void)
char **GetDroppedFiles(int *count) char **GetDroppedFiles(int *count)
void ClearDroppedFiles(void) void ClearDroppedFiles(void)
long GetFileModTime(const char *fileName) long GetFileModTime(const char *fileName)
unsigned char *CompressData(unsigned char *data, int dataLength, int *compDataLength) unsigned char *CompressData(const unsigned char *data, int dataSize, int *compDataSize)
unsigned char *DecompressData(unsigned char *compData, int compDataLength, int *dataLength) unsigned char *DecompressData(const unsigned char *compData, int compDataSize, int *dataSize)
char *EncodeDataBase64(const unsigned char *data, int dataSize, int *outputSize)
unsigned char *DecodeDataBase64(const unsigned char *data, int *outputSize)
bool SaveStorageValue(unsigned int position, int value) bool SaveStorageValue(unsigned int position, int value)
int LoadStorageValue(unsigned int position) int LoadStorageValue(unsigned int position)
void OpenURL(const char *url) void OpenURL(const char *url)
@ -130,7 +137,6 @@ void SetExitKey(int key)
int GetKeyPressed(void) int GetKeyPressed(void)
int GetCharPressed(void) int GetCharPressed(void)
bool IsGamepadAvailable(int gamepad) bool IsGamepadAvailable(int gamepad)
bool IsGamepadName(int gamepad, const char *name)
const char *GetGamepadName(int gamepad) const char *GetGamepadName(int gamepad)
bool IsGamepadButtonPressed(int gamepad, int button) bool IsGamepadButtonPressed(int gamepad, int button)
bool IsGamepadButtonDown(int gamepad, int button) bool IsGamepadButtonDown(int gamepad, int button)
@ -322,11 +328,13 @@ GlyphInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSiz
Image GenImageFontAtlas(const GlyphInfo *chars, Rectangle **recs, int glyphCount, int fontSize, int padding, int packMethod) Image GenImageFontAtlas(const GlyphInfo *chars, Rectangle **recs, int glyphCount, int fontSize, int padding, int packMethod)
void UnloadFontData(GlyphInfo *chars, int glyphCount) void UnloadFontData(GlyphInfo *chars, int glyphCount)
void UnloadFont(Font font) void UnloadFont(Font font)
bool ExportFontAsCode(Font font, const char *fileName)
void DrawFPS(int posX, int posY) void DrawFPS(int posX, int posY)
void DrawText(const char *text, int posX, int posY, int fontSize, Color color) void DrawText(const char *text, int posX, int posY, int fontSize, Color color)
void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint) void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint)
void DrawTextPro(Font font, const char *text, Vector2 position, Vector2 origin, float rotation, float fontSize, float spacing, Color tint) void DrawTextPro(Font font, const char *text, Vector2 position, Vector2 origin, float rotation, float fontSize, float spacing, Color tint)
void DrawTextCodepoint(Font font, int codepoint, Vector2 position, float fontSize, Color tint) void DrawTextCodepoint(Font font, int codepoint, Vector2 position, float fontSize, Color tint)
void DrawTextCodepoints(Font font, const int *codepoints, int count, Vector2 position, float fontSize, float spacing, Color tint)
int MeasureText(const char *text, int fontSize) int MeasureText(const char *text, int fontSize)
Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing) Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing)
int GetGlyphIndex(Font font, int codepoint) int GetGlyphIndex(Font font, int codepoint)
@ -337,7 +345,7 @@ void UnloadCodepoints(int *codepoints)
int GetCodepointCount(const char *text) int GetCodepointCount(const char *text)
int GetCodepoint(const char *text, int *bytesProcessed) int GetCodepoint(const char *text, int *bytesProcessed)
const char *CodepointToUTF8(int codepoint, int *byteSize) const char *CodepointToUTF8(int codepoint, int *byteSize)
char *TextCodepointsToUTF8(int *codepoints, int length) char *TextCodepointsToUTF8(const int *codepoints, int length)
int TextCopy(char *dst, const char *src) int TextCopy(char *dst, const char *src)
bool TextIsEqual(const char *text1, const char *text2) bool TextIsEqual(const char *text1, const char *text2)
unsigned int TextLength(const char *text) unsigned int TextLength(const char *text)
@ -388,10 +396,10 @@ void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float siz
void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Color tint) void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Color tint)
void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint) void DrawBillboardPro(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint)
void UploadMesh(Mesh *mesh, bool dynamic) void UploadMesh(Mesh *mesh, bool dynamic)
void UpdateMeshBuffer(Mesh mesh, int index, void *data, int dataSize, int offset) void UpdateMeshBuffer(Mesh mesh, int index, const void *data, int dataSize, int offset)
void UnloadMesh(Mesh mesh) void UnloadMesh(Mesh mesh)
void DrawMesh(Mesh mesh, Material material, Matrix transform) void DrawMesh(Mesh mesh, Material material, Matrix transform)
void DrawMeshInstanced(Mesh mesh, Material material, Matrix *transforms, int instances) void DrawMeshInstanced(Mesh mesh, Material material, const Matrix *transforms, int instances)
bool ExportMesh(Mesh mesh, const char *fileName) bool ExportMesh(Mesh mesh, const char *fileName)
BoundingBox GetMeshBoundingBox(Mesh mesh) BoundingBox GetMeshBoundingBox(Mesh mesh)
void GenMeshTangents(Mesh *mesh) void GenMeshTangents(Mesh *mesh)
@ -422,7 +430,6 @@ bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2)
bool CheckCollisionBoxSphere(BoundingBox box, Vector3 center, float radius) bool CheckCollisionBoxSphere(BoundingBox box, Vector3 center, float radius)
RayCollision GetRayCollisionSphere(Ray ray, Vector3 center, float radius) RayCollision GetRayCollisionSphere(Ray ray, Vector3 center, float radius)
RayCollision GetRayCollisionBox(Ray ray, BoundingBox box) RayCollision GetRayCollisionBox(Ray ray, BoundingBox box)
RayCollision GetRayCollisionModel(Ray ray, Model model)
RayCollision GetRayCollisionMesh(Ray ray, Mesh mesh, Matrix transform) RayCollision GetRayCollisionMesh(Ray ray, Mesh mesh, Matrix transform)
RayCollision GetRayCollisionTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3) RayCollision GetRayCollisionTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3)
RayCollision GetRayCollisionQuad(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4) RayCollision GetRayCollisionQuad(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4)
@ -449,13 +456,14 @@ int GetSoundsPlaying(void)
bool IsSoundPlaying(Sound sound) bool IsSoundPlaying(Sound sound)
void SetSoundVolume(Sound sound, float volume) void SetSoundVolume(Sound sound, float volume)
void SetSoundPitch(Sound sound, float pitch) void SetSoundPitch(Sound sound, float pitch)
void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels) void SetSoundPan(Sound sound, float pan)
Wave WaveCopy(Wave wave) Wave WaveCopy(Wave wave)
void WaveCrop(Wave *wave, int initSample, int finalSample) void WaveCrop(Wave *wave, int initSample, int finalSample)
void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels)
float *LoadWaveSamples(Wave wave) float *LoadWaveSamples(Wave wave)
void UnloadWaveSamples(float *samples) void UnloadWaveSamples(float *samples)
Music LoadMusicStream(const char *fileName) Music LoadMusicStream(const char *fileName)
Music LoadMusicStreamFromMemory(const char *fileType, unsigned char* data, int dataSize) Music LoadMusicStreamFromMemory(const char *fileType, const unsigned char* data, int dataSize)
void UnloadMusicStream(Music music) void UnloadMusicStream(Music music)
void PlayMusicStream(Music music) void PlayMusicStream(Music music)
bool IsMusicStreamPlaying(Music music) bool IsMusicStreamPlaying(Music music)
@ -465,6 +473,7 @@ void PauseMusicStream(Music music)
void ResumeMusicStream(Music music) void ResumeMusicStream(Music music)
void SeekMusicStream(Music music, float position) void SeekMusicStream(Music music, float position)
void SetMusicVolume(Music music, float volume) void SetMusicVolume(Music music, float volume)
void SetMusicPan(Music music, float pan)
void SetMusicPitch(Music music, float pitch) void SetMusicPitch(Music music, float pitch)
float GetMusicTimeLength(Music music) float GetMusicTimeLength(Music music)
float GetMusicTimePlayed(Music music) float GetMusicTimePlayed(Music music)
@ -479,4 +488,8 @@ bool IsAudioStreamPlaying(AudioStream stream)
void StopAudioStream(AudioStream stream) void StopAudioStream(AudioStream stream)
void SetAudioStreamVolume(AudioStream stream, float volume) void SetAudioStreamVolume(AudioStream stream, float volume)
void SetAudioStreamPitch(AudioStream stream, float pitch) void SetAudioStreamPitch(AudioStream stream, float pitch)
void SetAudioStreamPan(AudioStream stream, float pan)
void SetAudioStreamBufferSizeDefault(int size) void SetAudioStreamBufferSizeDefault(int size)
void SetAudioStreamCallback(AudioStream stream, AudioCallback callback)
void AttachAudioStreamProcessor(AudioStream stream, AudioCallback processor)
void DetachAudioStreamProcessor(AudioStream stream, AudioCallback processor)

View File

@ -16,7 +16,8 @@ local structs = {
"TextureCubemap", "TraceLogCallback", "PhysicsBody", "TextureCubemap", "TraceLogCallback", "PhysicsBody",
"GestureEvent", "GuiStyle", "GuiTextBoxState", "GestureEvent", "GuiStyle", "GuiTextBoxState",
"TraceLogCallback", "VertexBuffer", "DrawCall", "RenderBatch", "TraceLogCallback", "VertexBuffer", "DrawCall", "RenderBatch",
"ShaderAttributeDataType", "MaterialMapIndex", "VrStereoConfig" "ShaderAttributeDataType", "MaterialMapIndex", "VrStereoConfig",
"AudioCallback"
} }
local rl_structs = { local rl_structs = {

View File

@ -13,13 +13,11 @@ int GuiGetStyle(int control, int property)
bool GuiWindowBox(Rectangle bounds, const char *title) bool GuiWindowBox(Rectangle bounds, const char *title)
void GuiGroupBox(Rectangle bounds, const char *text) void GuiGroupBox(Rectangle bounds, const char *text)
void GuiLine(Rectangle bounds, const char *text) void GuiLine(Rectangle bounds, const char *text)
void GuiPanel(Rectangle bounds) void GuiPanel(Rectangle bounds, const char *text)
Rectangle GuiScrollPanel(Rectangle bounds, Rectangle content, Vector2 *scroll) Rectangle GuiScrollPanel(Rectangle bounds, const char *text, Rectangle content, Vector2 *scroll)
void GuiLabel(Rectangle bounds, const char *text) void GuiLabel(Rectangle bounds, const char *text)
bool GuiButton(Rectangle bounds, const char *text) bool GuiButton(Rectangle bounds, const char *text)
bool GuiLabelButton(Rectangle bounds, const char *text) bool GuiLabelButton(Rectangle bounds, const char *text)
bool GuiImageButton(Rectangle bounds, const char *text, Texture2D texture)
bool GuiImageButtonEx(Rectangle bounds, const char *text, Texture2D texture, Rectangle texSource)
bool GuiToggle(Rectangle bounds, const char *text, bool active) bool GuiToggle(Rectangle bounds, const char *text, bool active)
int GuiToggleGroup(Rectangle bounds, const char *text, int active) int GuiToggleGroup(Rectangle bounds, const char *text, int active)
bool GuiCheckBox(Rectangle bounds, const char *text, bool checked) bool GuiCheckBox(Rectangle bounds, const char *text, bool checked)
@ -34,23 +32,23 @@ float GuiSliderBar(Rectangle bounds, const char *textLeft, const char *textRight
float GuiProgressBar(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue) float GuiProgressBar(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue)
void GuiStatusBar(Rectangle bounds, const char *text) void GuiStatusBar(Rectangle bounds, const char *text)
void GuiDummyRec(Rectangle bounds, const char *text) void GuiDummyRec(Rectangle bounds, const char *text)
int GuiScrollBar(Rectangle bounds, int value, int minValue, int maxValue) Vector2 GuiGrid(Rectangle bounds, const char *text, float spacing, int subdivs)
Vector2 GuiGrid(Rectangle bounds, float spacing, int subdivs)
int GuiListView(Rectangle bounds, const char *text, int *scrollIndex, int active) int GuiListView(Rectangle bounds, const char *text, int *scrollIndex, int active)
int GuiListViewEx(Rectangle bounds, const char **text, int count, int *focus, int *scrollIndex, int active) int GuiListViewEx(Rectangle bounds, const char **text, int count, int *focus, int *scrollIndex, int active)
int GuiMessageBox(Rectangle bounds, const char *title, const char *message, const char *buttons) int GuiMessageBox(Rectangle bounds, const char *title, const char *message, const char *buttons)
int GuiTextInputBox(Rectangle bounds, const char *title, const char *message, const char *buttons, char *text) int GuiTextInputBox(Rectangle bounds, const char *title, const char *message, const char *buttons, char *text, int textMaxSize, int *secretViewActive)
Color GuiColorPicker(Rectangle bounds, Color color) Color GuiColorPicker(Rectangle bounds, const char *text, Color color)
Color GuiColorPanel(Rectangle bounds, Color color) Color GuiColorPanel(Rectangle bounds, const char *text, Color color)
float GuiColorBarAlpha(Rectangle bounds, float alpha) float GuiColorBarAlpha(Rectangle bounds, const char *text, float alpha)
float GuiColorBarHue(Rectangle bounds, float value) float GuiColorBarHue(Rectangle bounds, const char *text, float value)
void GuiLoadStyle(const char *fileName) void GuiLoadStyle(const char *fileName)
void GuiLoadStyleDefault(void) void GuiLoadStyleDefault(void)
const char *GuiIconText(int iconId, const char *text) const char *GuiIconText(int iconId, const char *text)
void GuiDrawIcon(int iconId, Vector2 position, int pixelSize, Color color) void GuiDrawIcon(int iconId, int posX, int posY, int pixelSize, Color color)
unsigned int *GuiGetIcons(void) unsigned int *GuiGetIcons(void)
unsigned int *GuiGetIconData(int iconId) unsigned int *GuiGetIconData(int iconId)
void GuiSetIconData(int iconId, unsigned int *data) void GuiSetIconData(int iconId, unsigned int *data)
void GuiSetIconScale(unsigned int scale)
void GuiSetIconPixel(int iconId, int x, int y) void GuiSetIconPixel(int iconId, int x, int y)
void GuiClearIconPixel(int iconId, int x, int y) void GuiClearIconPixel(int iconId, int x, int y)
bool GuiCheckIconPixel(int iconId, int x, int y) bool GuiCheckIconPixel(int iconId, int x, int y)

View File

@ -12,12 +12,14 @@ float Vector2Length(Vector2 v)
float Vector2LengthSqr(Vector2 v) float Vector2LengthSqr(Vector2 v)
float Vector2DotProduct(Vector2 v1, Vector2 v2) float Vector2DotProduct(Vector2 v1, Vector2 v2)
float Vector2Distance(Vector2 v1, Vector2 v2) float Vector2Distance(Vector2 v1, Vector2 v2)
float Vector2DistanceSqr(Vector2 v1, Vector2 v2)
float Vector2Angle(Vector2 v1, Vector2 v2) float Vector2Angle(Vector2 v1, Vector2 v2)
Vector2 Vector2Scale(Vector2 v, float scale) Vector2 Vector2Scale(Vector2 v, float scale)
Vector2 Vector2Multiply(Vector2 v1, Vector2 v2) Vector2 Vector2Multiply(Vector2 v1, Vector2 v2)
Vector2 Vector2Negate(Vector2 v) Vector2 Vector2Negate(Vector2 v)
Vector2 Vector2Divide(Vector2 v1, Vector2 v2) Vector2 Vector2Divide(Vector2 v1, Vector2 v2)
Vector2 Vector2Normalize(Vector2 v) Vector2 Vector2Normalize(Vector2 v)
Vector2 Vector2Transform(Vector2 v, Matrix mat)
Vector2 Vector2Lerp(Vector2 v1, Vector2 v2, float amount) Vector2 Vector2Lerp(Vector2 v1, Vector2 v2, float amount)
Vector2 Vector2Reflect(Vector2 v, Vector2 normal) Vector2 Vector2Reflect(Vector2 v, Vector2 normal)
Vector2 Vector2Rotate(Vector2 v, float degs) Vector2 Vector2Rotate(Vector2 v, float degs)
@ -36,6 +38,7 @@ float Vector3Length(const Vector3 v)
float Vector3LengthSqr(const Vector3 v) float Vector3LengthSqr(const Vector3 v)
float Vector3DotProduct(Vector3 v1, Vector3 v2) float Vector3DotProduct(Vector3 v1, Vector3 v2)
float Vector3Distance(Vector3 v1, Vector3 v2) float Vector3Distance(Vector3 v1, Vector3 v2)
float Vector3DistanceSqr(Vector3 v1, Vector3 v2)
Vector2 Vector3Angle(Vector3 v1, Vector3 v2) Vector2 Vector3Angle(Vector3 v1, Vector3 v2)
Vector3 Vector3Negate(Vector3 v) Vector3 Vector3Negate(Vector3 v)
Vector3 Vector3Divide(Vector3 v1, Vector3 v2) Vector3 Vector3Divide(Vector3 v1, Vector3 v2)
@ -53,7 +56,6 @@ float MatrixDeterminant(Matrix mat)
float MatrixTrace(Matrix mat) float MatrixTrace(Matrix mat)
Matrix MatrixTranspose(Matrix mat) Matrix MatrixTranspose(Matrix mat)
Matrix MatrixInvert(Matrix mat) Matrix MatrixInvert(Matrix mat)
Matrix MatrixNormalize(Matrix mat)
Matrix MatrixIdentity(void) Matrix MatrixIdentity(void)
Matrix MatrixAdd(Matrix left, Matrix right) Matrix MatrixAdd(Matrix left, Matrix right)
Matrix MatrixSubtract(Matrix left, Matrix right) Matrix MatrixSubtract(Matrix left, Matrix right)

View File

@ -84,21 +84,22 @@ void rlDrawRenderBatchActive(void)
bool rlCheckRenderBatchLimit(int vCount) bool rlCheckRenderBatchLimit(int vCount)
void rlSetTexture(unsigned int id) void rlSetTexture(unsigned int id)
unsigned int rlLoadVertexArray(void) unsigned int rlLoadVertexArray(void)
unsigned int rlLoadVertexBuffer(void *buffer, int size, bool dynamic) unsigned int rlLoadVertexBuffer(const void *buffer, int size, bool dynamic)
unsigned int rlLoadVertexBufferElement(void *buffer, int size, bool dynamic) unsigned int rlLoadVertexBufferElement(const void *buffer, int size, bool dynamic)
void rlUpdateVertexBuffer(unsigned int bufferId, void *data, int dataSize, int offset) void rlUpdateVertexBuffer(unsigned int bufferId, const void *data, int dataSize, int offset)
void rlUpdateVertexBufferElements(unsigned int id, const void *data, int dataSize, int offset)
void rlUnloadVertexArray(unsigned int vaoId) void rlUnloadVertexArray(unsigned int vaoId)
void rlUnloadVertexBuffer(unsigned int vboId) void rlUnloadVertexBuffer(unsigned int vboId)
void rlSetVertexAttribute(unsigned int index, int compSize, int type, bool normalized, int stride, void *pointer) void rlSetVertexAttribute(unsigned int index, int compSize, int type, bool normalized, int stride, const void *pointer)
void rlSetVertexAttributeDivisor(unsigned int index, int divisor) void rlSetVertexAttributeDivisor(unsigned int index, int divisor)
void rlSetVertexAttributeDefault(int locIndex, const void *value, int attribType, int count) void rlSetVertexAttributeDefault(int locIndex, const void *value, int attribType, int count)
void rlDrawVertexArray(int offset, int count) void rlDrawVertexArray(int offset, int count)
void rlDrawVertexArrayElements(int offset, int count, void *buffer) void rlDrawVertexArrayElements(int offset, int count, const void *buffer)
void rlDrawVertexArrayInstanced(int offset, int count, int instances) void rlDrawVertexArrayInstanced(int offset, int count, int instances)
void rlDrawVertexArrayElementsInstanced(int offset, int count, void *buffer, int instances) void rlDrawVertexArrayElementsInstanced(int offset, int count, const void *buffer, int instances)
unsigned int rlLoadTexture(void *data, int width, int height, int format, int mipmapCount) unsigned int rlLoadTexture(const void *data, int width, int height, int format, int mipmapCount)
unsigned int rlLoadTextureDepth(int width, int height, bool useRenderBuffer) unsigned int rlLoadTextureDepth(int width, int height, bool useRenderBuffer)
unsigned int rlLoadTextureCubemap(void *data, int size, int format) unsigned int rlLoadTextureCubemap(const void *data, int size, int format)
void rlUpdateTexture(unsigned int id, int offsetX, int offsetY, int width, int height, int format, const void *data) void rlUpdateTexture(unsigned int id, int offsetX, int offsetY, int width, int height, int format, const void *data)
void rlGetGlTextureFormats(int format, int *glInternalFormat, int *glFormat, int *glType) void rlGetGlTextureFormats(int format, int *glInternalFormat, int *glFormat, int *glType)
const char *rlGetPixelFormatName(unsigned int format) const char *rlGetPixelFormatName(unsigned int format)