Compare commits
No commits in common. "master" and "v4.0-dev" have entirely different histories.
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,7 +2,6 @@
|
||||
*.res
|
||||
*.a
|
||||
raylua_e.exe
|
||||
raylua_r.exe
|
||||
raylua_s.exe
|
||||
raylua_s
|
||||
raylua_e
|
||||
|
5
.gitmodules
vendored
5
.gitmodules
vendored
@ -1,11 +1,10 @@
|
||||
[submodule "LuaJIT"]
|
||||
path = luajit
|
||||
url = https://github.com/LuaJIT/LuaJIT
|
||||
branch = v2.0
|
||||
url = https://github.com/moonjit/moonjit
|
||||
|
||||
[submodule "raylib"]
|
||||
path = raylib
|
||||
url = https://github.com/raysan5/raylib
|
||||
url = https://github.com/TSnake41/raylib
|
||||
|
||||
[submodule "raygui"]
|
||||
path = raygui
|
||||
|
@ -1,5 +1,3 @@
|
||||
**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)
|
||||
|
||||
[![release](https://img.shields.io/github/v/release/TSnake41/raylib-lua?style=flat-square)](https://github.com/TSnake41/raylib-lua/releases/latest)
|
||||
@ -65,8 +63,8 @@ If you need to update raylib binding, there are few tasks to do :
|
||||
|
||||
### Loading embedded ressources
|
||||
|
||||
Currently, raylib-lua support loading ressources from payload using
|
||||
raylib API. You can also arbitrarily load files from payload using
|
||||
Currently, raylib-lua doesn't support loading ressources from payload using
|
||||
raylib API. However, you can still arbitrarily load files from payload using
|
||||
`raylua.loadfile` which returns a boolean indicating success and file content.
|
||||
|
||||
### Making structs
|
||||
|
@ -25,32 +25,26 @@ local ar = os.getenv "AR" or "ar"
|
||||
local windres = os.getenv "WINDRES" or "windres"
|
||||
|
||||
-- TODO: Use current lua interpreter
|
||||
local lua = os.getenv "LUA"
|
||||
local lua = os.getenv "LUA" or "luajit\\src\\luajit"
|
||||
local needs_luajit_built = not (os.getenv "LUA")
|
||||
|
||||
local cflags = os.getenv "CFLAGS" or "-O2 -s"
|
||||
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 graphics = os.getenv "GRAPHICS" or "GRAPHICS_API_OPENGL_43"
|
||||
local graphics = os.getenv "GRAPHICS" or "GRAPHICS_API_OPENGL_33"
|
||||
|
||||
cflags = cflags .. " -Iluajit/src -Iraygui/src -Iraylib/src".. " -D" .. graphics
|
||||
cflags = cflags .. " -Iluajit/src -Iraygui/src -Iraylib/src"
|
||||
ldflags = ldflags .. " luajit/src/libluajit.a raylib/src/libraylib.a luajit/src/libluajit.a"
|
||||
|
||||
local raylua_so_path = "raylua.so" -- assume unix-like by default
|
||||
local so_ldflags = ldflags
|
||||
cflags = cflags .. " -D" .. graphics
|
||||
|
||||
local exe_ldflags = ""
|
||||
|
||||
if los.type() == "linux" then
|
||||
ldflags = ldflags .. " -ldl -pthread"
|
||||
cflags = cflags .. " -fPIC"
|
||||
so_ldflags = ldflags .. " -llua5.1"
|
||||
lua = lua or "luajit/src/luajit"
|
||||
elseif los.type() == "win32" then
|
||||
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
|
||||
|
||||
local libluajit
|
||||
@ -150,19 +144,3 @@ local raylua_e = c.link("raylua_e",
|
||||
"raylua_e",
|
||||
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
|
||||
)
|
||||
|
@ -12,10 +12,6 @@ local include_paths = "-I. -Iexternal/glfw/include -Iexternal/glfw/deps/mingw"
|
||||
|
||||
local los = require "los"
|
||||
|
||||
if los.type() == "linux" then
|
||||
cflags = cflags .. " -fPIC"
|
||||
end
|
||||
|
||||
local consts = {
|
||||
RAYLIB_VERSION = "4.0.0",
|
||||
RAYLIB_API_VERSION = "400",
|
||||
@ -27,7 +23,7 @@ local vars = saphire.map({
|
||||
{ "RAYLIB_LIB_NAME", "raylib" },
|
||||
{ "RAYLIB_RES_FILE", "./raylib.dll.rc.data" },
|
||||
{ "PLATFORM", "PLATFORM_DESKTOP" },
|
||||
{ "GRAPHICS", "GRAPHICS_API_OPENGL_43" },
|
||||
{ "GRAPHICS", "GRAPHICS_API_OPENGL_33" },
|
||||
{ "USE_EXTERNAL_GLFW", "FALSE" },
|
||||
{ "USE_WAYLAND_DISPLAY", "FALSE" }
|
||||
}, function (v)
|
||||
|
@ -1,41 +0,0 @@
|
||||
#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);
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
#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);
|
||||
}
|
@ -1,51 +0,0 @@
|
||||
#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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
57
examples/resources/gol.glsl
Normal file
57
examples/resources/gol.glsl
Normal file
@ -0,0 +1,57 @@
|
||||
#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);
|
||||
}
|
@ -1,134 +1,105 @@
|
||||
local ffi = require "ffi"
|
||||
|
||||
-- IMPORTANT: This must match gol*.glsl GOL_WIDTH constant.
|
||||
-- This must be a multiple of 16 (check golLogic compute dispatch).
|
||||
local GOL_WIDTH = 768
|
||||
|
||||
-- Maximum amount of queued draw commands (squares draw from mouse down events).
|
||||
local MAX_BUFFERED_TRANSFERTS = 48
|
||||
|
||||
ffi.cdef [[
|
||||
typedef struct GolUpdateCmd {
|
||||
unsigned int x;
|
||||
unsigned int y;
|
||||
unsigned int w;
|
||||
unsigned int enabled;
|
||||
} GolUpdateCmd;
|
||||
]]
|
||||
|
||||
ffi.cdef(string.format([[
|
||||
typedef struct GolUpdateSSBO {
|
||||
unsigned int count;
|
||||
GolUpdateCmd commands[%d];
|
||||
} GolUpdateSSBO;
|
||||
]], MAX_BUFFERED_TRANSFERTS))
|
||||
|
||||
rl.InitWindow(GOL_WIDTH, GOL_WIDTH, "raylib [rlgl] example - compute shader - game of life")
|
||||
|
||||
local resolution = rl.new("Vector2", GOL_WIDTH, GOL_WIDTH)
|
||||
local brushSize = 8
|
||||
|
||||
-- Game of Life logic compute shader
|
||||
local golLogicCode = rl.LoadFileText("resources/glsl430/gol.glsl")
|
||||
local golLogicShader = rl.rlCompileShader(golLogicCode, rl.RL_COMPUTE_SHADER);
|
||||
local golLogicProgram = rl.rlLoadComputeShaderProgram(golLogicShader);
|
||||
rl.UnloadFileText(golLogicCode);
|
||||
|
||||
-- Game of Life rendering compute shader
|
||||
local golRenderShader = rl.LoadShader(nil, "resources/glsl430/gol_render.glsl")
|
||||
local resUniformLoc = rl.GetShaderLocation(golRenderShader, "resolution")
|
||||
|
||||
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);
|
||||
|
||||
local ssboSize = ffi.sizeof("int[?]", GOL_WIDTH * GOL_WIDTH)
|
||||
local ssboA = rl.rlLoadShaderBuffer(ssboSize, nil, rl.RL_DYNAMIC_COPY);
|
||||
local ssboB = rl.rlLoadShaderBuffer(ssboSize, nil, rl.RL_DYNAMIC_COPY);
|
||||
|
||||
local transfertBuffer = ffi.new("struct GolUpdateSSBO")
|
||||
transfertBuffer.count = 0
|
||||
|
||||
local transfertBufferSize = ffi.sizeof "struct GolUpdateSSBO"
|
||||
|
||||
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
|
||||
|
||||
brushSize = math.floor(brushSize + rl.GetMouseWheelMove())
|
||||
|
||||
if ((rl.IsMouseButtonDown(rl.MOUSE_BUTTON_LEFT) or rl.IsMouseButtonDown(rl.MOUSE_BUTTON_RIGHT))
|
||||
and (transfertBuffer.count < MAX_BUFFERED_TRANSFERTS)) then
|
||||
-- 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
|
||||
|
||||
-- Send SSBO buffer to GPU
|
||||
rl.rlUpdateShaderBufferElements(transfertSSBO, transfertBuffer, transfertBufferSize, 0);
|
||||
|
||||
-- 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();
|
||||
|
||||
transfertBuffer.count = 0;
|
||||
else
|
||||
-- Process game of life logic
|
||||
rl.rlEnableShader(golLogicProgram)
|
||||
rl.rlBindShaderBuffer(ssboA, 1)
|
||||
rl.rlBindShaderBuffer(ssboB, 2)
|
||||
rl.rlComputeShaderDispatch(GOL_WIDTH / 16, GOL_WIDTH / 16, 1)
|
||||
rl.rlDisableShader()
|
||||
|
||||
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()
|
||||
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
|
||||
|
||||
rl.rlUnloadShaderBuffer(ssboA);
|
||||
rl.rlUnloadShaderBuffer(ssboB);
|
||||
rl.rlUnloadShaderBuffer(transfertSSBO);
|
||||
local computeShader = rl.rlCompileShader(computeShaderCode, rl.RL_COMPUTE_SHADER)
|
||||
local csProgram = rl.rlLoadComputeShaderProgram(computeShader)
|
||||
print(csProgram)
|
||||
|
||||
-- Unload compute shader programs
|
||||
rl.rlUnloadShaderProgram(golTransfertProgram)
|
||||
rl.rlUnloadShaderProgram(golLogicProgram)
|
||||
local ssbo_size = ffi.sizeof("int32_t[?]", width * height)
|
||||
local ssbo_baseBuffer = ffi.new("int32_t[?]", width * height)
|
||||
for i=0,width * height - 1 do
|
||||
ssbo_baseBuffer[i] = 0
|
||||
end
|
||||
|
||||
rl.UnloadTexture(whiteTex) -- Unload white texture
|
||||
rl.UnloadShader(golRenderShader) -- Unload rendering fragment shader
|
||||
local shader_framebuffer = rl.new("Color[?]", width * height)
|
||||
local ssbo_image = rl.new "Image" ---@type Image
|
||||
|
||||
rl.CloseWindow() -- Close window and OpenGL context
|
||||
ssbo_image.data = shader_framebuffer
|
||||
ssbo_image.width = width
|
||||
ssbo_image.height = height
|
||||
ssbo_image.format = rl.PIXELFORMAT_UNCOMPRESSED_R8G8B8A8
|
||||
ssbo_image.mipmaps = 1
|
||||
|
||||
local ssboA = rl.rlLoadShaderBuffer(ssbo_size, ssbo_baseBuffer, rl.RL_STREAM_COPY)
|
||||
local ssboB = rl.rlLoadShaderBuffer(ssbo_size, ssbo_baseBuffer, rl.RL_STREAM_COPY)
|
||||
|
||||
-- Create a texture to apply shader
|
||||
local renderTexture = rl.LoadRenderTexture(width, height)
|
||||
|
||||
local renderShader = rl.LoadShaderFromMemory(nil, [[
|
||||
#version 430
|
||||
out vec4 finalColor;
|
||||
in vec2 fragTexCoord;
|
||||
|
||||
layout(std430, binding = 1) readonly buffer golLayout {
|
||||
int golBuffer[];
|
||||
};
|
||||
|
||||
uniform vec2 res;
|
||||
|
||||
void main()
|
||||
{
|
||||
ivec2 coords = ivec2(fragTexCoord * res);
|
||||
|
||||
if (golBuffer[coords.x + coords.y * uint(res.x)] == 1)
|
||||
finalColor = vec4(1.0);
|
||||
else
|
||||
finalColor = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
}
|
||||
]])
|
||||
|
||||
local resolution = ffi.new("float[2]", width, height)
|
||||
local res_uniform = rl.GetShaderLocation(renderShader, "res")
|
||||
|
||||
while not rl.WindowShouldClose() do
|
||||
rl.BeginDrawing()
|
||||
|
||||
if rl.IsMouseButtonDown(rl.MOUSE_BUTTON_LEFT) then
|
||||
rl.rlReadShaderBufferElements(ssboB, ssbo_baseBuffer, ssbo_size, 0)
|
||||
|
||||
-- Correct colors
|
||||
for i=0,(width * height)-1 do
|
||||
local toggled = ssbo_baseBuffer[i]
|
||||
|
||||
shader_framebuffer[i].r = toggled * 255
|
||||
shader_framebuffer[i].g = toggled * 255
|
||||
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)
|
||||
|
||||
for x=0,ssbo_image.width-1 do
|
||||
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
|
||||
rl.rlEnableShader(csProgram)
|
||||
rl.rlBindShaderBuffer(ssboA, 1)
|
||||
rl.rlBindShaderBuffer(ssboB, 2)
|
||||
rl.rlComputeShaderDispatch(width / 16, height / 16, 1)
|
||||
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
|
||||
end
|
||||
|
||||
rl.CloseWindow()
|
||||
|
2
luajit
2
luajit
@ -1 +1 @@
|
||||
Subproject commit 5e3c45c43bb0e0f1f2917d432e9d2dba12c42a6e
|
||||
Subproject commit e4b4d9451402be704d5b47a359f640a29db4977f
|
9
makefile
9
makefile
@ -15,14 +15,13 @@ MODULES := raymath rlgl easings gestures physac raygui
|
||||
PLATFORM ?= PLATFORM_DESKTOP
|
||||
GRAPHICS ?= GRAPHICS_API_OPENGL_33
|
||||
|
||||
CFLAGS += -D$(GRAPHICS) -D$(PLATFORM)
|
||||
CFLAGS += -D$(GRAPHICS)
|
||||
|
||||
USE_WAYLAND_DISPLAY ?= FALSE
|
||||
USE_EXTERNAL_GLFW ?= FALSE
|
||||
|
||||
ifeq ($(OS),Windows_NT)
|
||||
LDFLAGS += -lopengl32 -lgdi32 -lwinmm -static
|
||||
LDFLAGS_R += -mwindows
|
||||
EXTERNAL_FILES := src/res/icon.res
|
||||
else ifeq ($(shell uname),Darwin)
|
||||
LDFLAGS += -framework CoreVideo -framework IOKit -framework Cocoa \
|
||||
@ -39,7 +38,7 @@ else
|
||||
EXTERNAL_FILES :=
|
||||
endif
|
||||
|
||||
all: raylua_s raylua_e raylua_r luajit raylib
|
||||
all: raylua_s raylua_e luajit raylib
|
||||
|
||||
%.o: %.c
|
||||
$(CC) -c -o $@ $< $(CFLAGS)
|
||||
@ -64,10 +63,6 @@ raylua_e: src/raylua_e.o src/raylua_self.o src/raylua_builder.o src/lib/miniz.o
|
||||
$(EXTERNAL_FILES) libraylua.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
|
||||
$(WINDRES) $^ -O coff $@
|
||||
|
||||
|
2
raygui
2
raygui
@ -1 +1 @@
|
||||
Subproject commit 865bb293764073c01e74314ef647464f1f10fd96
|
||||
Subproject commit e81fd89b6dcc97bf1cee7878e8c6cfcbca2583a7
|
2
raylib
2
raylib
@ -1 +1 @@
|
||||
Subproject commit 559ffc633164c30824065a63324ba08efa651ee6
|
||||
Subproject commit 99f6707e2c80be2ac4c169fd6986ff2fd8d181a7
|
546
src/raylib.lua
546
src/raylib.lua
@ -231,11 +231,8 @@ ffi.cdef [[
|
||||
} Wave;
|
||||
|
||||
typedef struct rAudioBuffer rAudioBuffer;
|
||||
typedef struct rAudioProcessor rAudioProcessor;
|
||||
|
||||
typedef struct AudioStream {
|
||||
rAudioBuffer *buffer;
|
||||
rAudioProcessor *processor;
|
||||
|
||||
unsigned int sampleRate;
|
||||
unsigned int sampleSize;
|
||||
@ -600,7 +597,6 @@ ffi.cdef [[
|
||||
BLEND_MULTIPLIED,
|
||||
BLEND_ADD_COLORS,
|
||||
BLEND_SUBTRACT_COLORS,
|
||||
BLEND_ALPHA_PREMUL,
|
||||
BLEND_CUSTOM
|
||||
} BlendMode;
|
||||
|
||||
@ -638,7 +634,6 @@ ffi.cdef [[
|
||||
} NPatchLayout;
|
||||
|
||||
typedef void (*TraceLogCallback)(int logLevel, const char *text, va_list args);
|
||||
typedef void (*AudioCallback)(void *bufferData, unsigned int frames);
|
||||
]]
|
||||
|
||||
-- raymath cdef
|
||||
@ -707,7 +702,6 @@ ffi.cdef [[
|
||||
RL_BLEND_MULTIPLIED,
|
||||
RL_BLEND_ADD_COLORS,
|
||||
RL_BLEND_SUBTRACT_COLORS,
|
||||
RL_BLEND_ALPHA_PREMUL,
|
||||
RL_BLEND_CUSTOM
|
||||
} rlBlendMode;
|
||||
|
||||
@ -1018,15 +1012,6 @@ ffi.cdef [[
|
||||
PROGRESS_PADDING = 16,
|
||||
} GuiProgressBarProperty;
|
||||
|
||||
typedef enum {
|
||||
ARROWS_SIZE = 16,
|
||||
ARROWS_VISIBLE,
|
||||
SCROLL_SLIDER_PADDING,
|
||||
SCROLL_SLIDER_SIZE,
|
||||
SCROLL_PADDING,
|
||||
SCROLL_SPEED,
|
||||
} GuiScrollBarProperty;
|
||||
|
||||
typedef enum {
|
||||
CHECK_PADDING = 16
|
||||
} GuiCheckBoxProperty;
|
||||
@ -1038,19 +1023,30 @@ ffi.cdef [[
|
||||
|
||||
typedef enum {
|
||||
ARROW_PADDING = 16,
|
||||
DROPDOWN_ITEMS_SPACING
|
||||
DROPDOWN_ITEMS_PADDING
|
||||
} GuiDropdownBoxProperty;
|
||||
|
||||
typedef enum {
|
||||
TEXT_INNER_PADDING = 16,
|
||||
TEXT_LINES_SPACING
|
||||
TEXT_LINES_PADDING,
|
||||
COLOR_SELECTED_FG,
|
||||
COLOR_SELECTED_BG
|
||||
} GuiTextBoxProperty;
|
||||
|
||||
typedef enum {
|
||||
SPIN_BUTTON_WIDTH = 16,
|
||||
SPIN_BUTTON_SPACING,
|
||||
SPIN_BUTTON_PADDING,
|
||||
} GuiSpinnerProperty;
|
||||
|
||||
typedef enum {
|
||||
ARROWS_SIZE = 16,
|
||||
ARROWS_VISIBLE,
|
||||
SCROLL_SLIDER_PADDING,
|
||||
SCROLL_SLIDER_SIZE,
|
||||
SCROLL_PADDING,
|
||||
SCROLL_SPEED,
|
||||
} GuiScrollBarProperty;
|
||||
|
||||
typedef enum {
|
||||
SCROLLBAR_LEFT_SIDE = 0,
|
||||
SCROLLBAR_RIGHT_SIDE
|
||||
@ -1058,7 +1054,7 @@ ffi.cdef [[
|
||||
|
||||
typedef enum {
|
||||
LIST_ITEMS_HEIGHT = 16,
|
||||
LIST_ITEMS_SPACING,
|
||||
LIST_ITEMS_PADDING,
|
||||
SCROLLBAR_WIDTH,
|
||||
SCROLLBAR_SIDE,
|
||||
} GuiListViewProperty;
|
||||
@ -1079,262 +1075,262 @@ ffi.cdef [[
|
||||
} GuiTextBoxState;
|
||||
|
||||
typedef enum {
|
||||
RAYGUI_ICON_NONE = 0,
|
||||
RAYGUI_ICON_FOLDER_FILE_OPEN = 1,
|
||||
RAYGUI_ICON_FILE_SAVE_CLASSIC = 2,
|
||||
RAYGUI_ICON_FOLDER_OPEN = 3,
|
||||
RAYGUI_ICON_FOLDER_SAVE = 4,
|
||||
RAYGUI_ICON_FILE_OPEN = 5,
|
||||
RAYGUI_ICON_FILE_SAVE = 6,
|
||||
RAYGUI_ICON_FILE_EXPORT = 7,
|
||||
RAYGUI_ICON_FILE_ADD = 8,
|
||||
RAYGUI_ICON_FILE_DELETE = 9,
|
||||
RAYGUI_ICON_FILETYPE_TEXT = 10,
|
||||
RAYGUI_ICON_FILETYPE_AUDIO = 11,
|
||||
RAYGUI_ICON_FILETYPE_IMAGE = 12,
|
||||
RAYGUI_ICON_FILETYPE_PLAY = 13,
|
||||
RAYGUI_ICON_FILETYPE_VIDEO = 14,
|
||||
RAYGUI_ICON_FILETYPE_INFO = 15,
|
||||
RAYGUI_ICON_FILE_COPY = 16,
|
||||
RAYGUI_ICON_FILE_CUT = 17,
|
||||
RAYGUI_ICON_FILE_PASTE = 18,
|
||||
RAYGUI_ICON_CURSOR_HAND = 19,
|
||||
RAYGUI_ICON_CURSOR_POINTER = 20,
|
||||
RAYGUI_ICON_CURSOR_CLASSIC = 21,
|
||||
RAYGUI_ICON_PENCIL = 22,
|
||||
RAYGUI_ICON_PENCIL_BIG = 23,
|
||||
RAYGUI_ICON_BRUSH_CLASSIC = 24,
|
||||
RAYGUI_ICON_BRUSH_PAINTER = 25,
|
||||
RAYGUI_ICON_WATER_DROP = 26,
|
||||
RAYGUI_ICON_COLOR_PICKER = 27,
|
||||
RAYGUI_ICON_RUBBER = 28,
|
||||
RAYGUI_ICON_COLOR_BUCKET = 29,
|
||||
RAYGUI_ICON_TEXT_T = 30,
|
||||
RAYGUI_ICON_TEXT_A = 31,
|
||||
RAYGUI_ICON_SCALE = 32,
|
||||
RAYGUI_ICON_RESIZE = 33,
|
||||
RAYGUI_ICON_FILTER_POINT = 34,
|
||||
RAYGUI_ICON_FILTER_BILINEAR = 35,
|
||||
RAYGUI_ICON_CROP = 36,
|
||||
RAYGUI_ICON_CROP_ALPHA = 37,
|
||||
RAYGUI_ICON_SQUARE_TOGGLE = 38,
|
||||
RAYGUI_ICON_SYMMETRY = 39,
|
||||
RAYGUI_ICON_SYMMETRY_HORIZONTAL = 40,
|
||||
RAYGUI_ICON_SYMMETRY_VERTICAL = 41,
|
||||
RAYGUI_ICON_LENS = 42,
|
||||
RAYGUI_ICON_LENS_BIG = 43,
|
||||
RAYGUI_ICON_EYE_ON = 44,
|
||||
RAYGUI_ICON_EYE_OFF = 45,
|
||||
RAYGUI_ICON_FILTER_TOP = 46,
|
||||
RAYGUI_ICON_FILTER = 47,
|
||||
RAYGUI_ICON_TARGET_POINT = 48,
|
||||
RAYGUI_ICON_TARGET_SMALL = 49,
|
||||
RAYGUI_ICON_TARGET_BIG = 50,
|
||||
RAYGUI_ICON_TARGET_MOVE = 51,
|
||||
RAYGUI_ICON_CURSOR_MOVE = 52,
|
||||
RAYGUI_ICON_CURSOR_SCALE = 53,
|
||||
RAYGUI_ICON_CURSOR_SCALE_RIGHT = 54,
|
||||
RAYGUI_ICON_CURSOR_SCALE_LEFT = 55,
|
||||
RAYGUI_ICON_UNDO = 56,
|
||||
RAYGUI_ICON_REDO = 57,
|
||||
RAYGUI_ICON_REREDO = 58,
|
||||
RAYGUI_ICON_MUTATE = 59,
|
||||
RAYGUI_ICON_ROTATE = 60,
|
||||
RAYGUI_ICON_REPEAT = 61,
|
||||
RAYGUI_ICON_SHUFFLE = 62,
|
||||
RAYGUI_ICON_EMPTYBOX = 63,
|
||||
RAYGUI_ICON_TARGET = 64,
|
||||
RAYGUI_ICON_TARGET_SMALL_FILL = 65,
|
||||
RAYGUI_ICON_TARGET_BIG_FILL = 66,
|
||||
RAYGUI_ICON_TARGET_MOVE_FILL = 67,
|
||||
RAYGUI_ICON_CURSOR_MOVE_FILL = 68,
|
||||
RAYGUI_ICON_CURSOR_SCALE_FILL = 69,
|
||||
RAYGUI_ICON_CURSOR_SCALE_RIGHT_FILL = 70,
|
||||
RAYGUI_ICON_CURSOR_SCALE_LEFT_FILL = 71,
|
||||
RAYGUI_ICON_UNDO_FILL = 72,
|
||||
RAYGUI_ICON_REDO_FILL = 73,
|
||||
RAYGUI_ICON_REREDO_FILL = 74,
|
||||
RAYGUI_ICON_MUTATE_FILL = 75,
|
||||
RAYGUI_ICON_ROTATE_FILL = 76,
|
||||
RAYGUI_ICON_REPEAT_FILL = 77,
|
||||
RAYGUI_ICON_SHUFFLE_FILL = 78,
|
||||
RAYGUI_ICON_EMPTYBOX_SMALL = 79,
|
||||
RAYGUI_ICON_BOX = 80,
|
||||
RAYGUI_ICON_BOX_TOP = 81,
|
||||
RAYGUI_ICON_BOX_TOP_RIGHT = 82,
|
||||
RAYGUI_ICON_BOX_RIGHT = 83,
|
||||
RAYGUI_ICON_BOX_BOTTOM_RIGHT = 84,
|
||||
RAYGUI_ICON_BOX_BOTTOM = 85,
|
||||
RAYGUI_ICON_BOX_BOTTOM_LEFT = 86,
|
||||
RAYGUI_ICON_BOX_LEFT = 87,
|
||||
RAYGUI_ICON_BOX_TOP_LEFT = 88,
|
||||
RAYGUI_ICON_BOX_CENTER = 89,
|
||||
RAYGUI_ICON_BOX_CIRCLE_MASK = 90,
|
||||
RAYGUI_ICON_POT = 91,
|
||||
RAYGUI_ICON_ALPHA_MULTIPLY = 92,
|
||||
RAYGUI_ICON_ALPHA_CLEAR = 93,
|
||||
RAYGUI_ICON_DITHERING = 94,
|
||||
RAYGUI_ICON_MIPMAPS = 95,
|
||||
RAYGUI_ICON_BOX_GRID = 96,
|
||||
RAYGUI_ICON_GRID = 97,
|
||||
RAYGUI_ICON_BOX_CORNERS_SMALL = 98,
|
||||
RAYGUI_ICON_BOX_CORNERS_BIG = 99,
|
||||
RAYGUI_ICON_FOUR_BOXES = 100,
|
||||
RAYGUI_ICON_GRID_FILL = 101,
|
||||
RAYGUI_ICON_BOX_MULTISIZE = 102,
|
||||
RAYGUI_ICON_ZOOM_SMALL = 103,
|
||||
RAYGUI_ICON_ZOOM_MEDIUM = 104,
|
||||
RAYGUI_ICON_ZOOM_BIG = 105,
|
||||
RAYGUI_ICON_ZOOM_ALL = 106,
|
||||
RAYGUI_ICON_ZOOM_CENTER = 107,
|
||||
RAYGUI_ICON_BOX_DOTS_SMALL = 108,
|
||||
RAYGUI_ICON_BOX_DOTS_BIG = 109,
|
||||
RAYGUI_ICON_BOX_CONCENTRIC = 110,
|
||||
RAYGUI_ICON_BOX_GRID_BIG = 111,
|
||||
RAYGUI_ICON_OK_TICK = 112,
|
||||
RAYGUI_ICON_CROSS = 113,
|
||||
RAYGUI_ICON_ARROW_LEFT = 114,
|
||||
RAYGUI_ICON_ARROW_RIGHT = 115,
|
||||
RAYGUI_ICON_ARROW_DOWN = 116,
|
||||
RAYGUI_ICON_ARROW_UP = 117,
|
||||
RAYGUI_ICON_ARROW_LEFT_FILL = 118,
|
||||
RAYGUI_ICON_ARROW_RIGHT_FILL = 119,
|
||||
RAYGUI_ICON_ARROW_DOWN_FILL = 120,
|
||||
RAYGUI_ICON_ARROW_UP_FILL = 121,
|
||||
RAYGUI_ICON_AUDIO = 122,
|
||||
RAYGUI_ICON_FX = 123,
|
||||
RAYGUI_ICON_WAVE = 124,
|
||||
RAYGUI_ICON_WAVE_SINUS = 125,
|
||||
RAYGUI_ICON_WAVE_SQUARE = 126,
|
||||
RAYGUI_ICON_WAVE_TRIANGULAR = 127,
|
||||
RAYGUI_ICON_CROSS_SMALL = 128,
|
||||
RAYGUI_ICON_PLAYER_PREVIOUS = 129,
|
||||
RAYGUI_ICON_PLAYER_PLAY_BACK = 130,
|
||||
RAYGUI_ICON_PLAYER_PLAY = 131,
|
||||
RAYGUI_ICON_PLAYER_PAUSE = 132,
|
||||
RAYGUI_ICON_PLAYER_STOP = 133,
|
||||
RAYGUI_ICON_PLAYER_NEXT = 134,
|
||||
RAYGUI_ICON_PLAYER_RECORD = 135,
|
||||
RAYGUI_ICON_MAGNET = 136,
|
||||
RAYGUI_ICON_LOCK_CLOSE = 137,
|
||||
RAYGUI_ICON_LOCK_OPEN = 138,
|
||||
RAYGUI_ICON_CLOCK = 139,
|
||||
RAYGUI_ICON_TOOLS = 140,
|
||||
RAYGUI_ICON_GEAR = 141,
|
||||
RAYGUI_ICON_GEAR_BIG = 142,
|
||||
RAYGUI_ICON_BIN = 143,
|
||||
RAYGUI_ICON_HAND_POINTER = 144,
|
||||
RAYGUI_ICON_LASER = 145,
|
||||
RAYGUI_ICON_COIN = 146,
|
||||
RAYGUI_ICON_EXPLOSION = 147,
|
||||
RAYGUI_ICON_1UP = 148,
|
||||
RAYGUI_ICON_PLAYER = 149,
|
||||
RAYGUI_ICON_PLAYER_JUMP = 150,
|
||||
RAYGUI_ICON_KEY = 151,
|
||||
RAYGUI_ICON_DEMON = 152,
|
||||
RAYGUI_ICON_TEXT_POPUP = 153,
|
||||
RAYGUI_ICON_GEAR_EX = 154,
|
||||
RAYGUI_ICON_CRACK = 155,
|
||||
RAYGUI_ICON_CRACK_POINTS = 156,
|
||||
RAYGUI_ICON_STAR = 157,
|
||||
RAYGUI_ICON_DOOR = 158,
|
||||
RAYGUI_ICON_EXIT = 159,
|
||||
RAYGUI_ICON_MODE_2D = 160,
|
||||
RAYGUI_ICON_MODE_3D = 161,
|
||||
RAYGUI_ICON_CUBE = 162,
|
||||
RAYGUI_ICON_CUBE_FACE_TOP = 163,
|
||||
RAYGUI_ICON_CUBE_FACE_LEFT = 164,
|
||||
RAYGUI_ICON_CUBE_FACE_FRONT = 165,
|
||||
RAYGUI_ICON_CUBE_FACE_BOTTOM = 166,
|
||||
RAYGUI_ICON_CUBE_FACE_RIGHT = 167,
|
||||
RAYGUI_ICON_CUBE_FACE_BACK = 168,
|
||||
RAYGUI_ICON_CAMERA = 169,
|
||||
RAYGUI_ICON_SPECIAL = 170,
|
||||
RAYGUI_ICON_LINK_NET = 171,
|
||||
RAYGUI_ICON_LINK_BOXES = 172,
|
||||
RAYGUI_ICON_LINK_MULTI = 173,
|
||||
RAYGUI_ICON_LINK = 174,
|
||||
RAYGUI_ICON_LINK_BROKE = 175,
|
||||
RAYGUI_ICON_TEXT_NOTES = 176,
|
||||
RAYGUI_ICON_NOTEBOOK = 177,
|
||||
RAYGUI_ICON_SUITCASE = 178,
|
||||
RAYGUI_ICON_SUITCASE_ZIP = 179,
|
||||
RAYGUI_ICON_MAILBOX = 180,
|
||||
RAYGUI_ICON_MONITOR = 181,
|
||||
RAYGUI_ICON_PRINTER = 182,
|
||||
RAYGUI_ICON_PHOTO_CAMERA = 183,
|
||||
RAYGUI_ICON_PHOTO_CAMERA_FLASH = 184,
|
||||
RAYGUI_ICON_HOUSE = 185,
|
||||
RAYGUI_ICON_HEART = 186,
|
||||
RAYGUI_ICON_CORNER = 187,
|
||||
RAYGUI_ICON_VERTICAL_BARS = 188,
|
||||
RAYGUI_ICON_VERTICAL_BARS_FILL = 189,
|
||||
RAYGUI_ICON_LIFE_BARS = 190,
|
||||
RAYGUI_ICON_INFO = 191,
|
||||
RAYGUI_ICON_CROSSLINE = 192,
|
||||
RAYGUI_ICON_HELP = 193,
|
||||
RAYGUI_ICON_FILETYPE_ALPHA = 194,
|
||||
RAYGUI_ICON_FILETYPE_HOME = 195,
|
||||
RAYGUI_ICON_LAYERS_VISIBLE = 196,
|
||||
RAYGUI_ICON_LAYERS = 197,
|
||||
RAYGUI_ICON_WINDOW = 198,
|
||||
RAYGUI_ICON_HIDPI = 199,
|
||||
RAYGUI_ICON_FILETYPE_BINARY = 200,
|
||||
RAYGUI_ICON_HEX = 201,
|
||||
RAYGUI_ICON_SHIELD = 202,
|
||||
RAYGUI_ICON_FILE_NEW = 203,
|
||||
RAYGUI_ICON_FOLDER_ADD = 204,
|
||||
RAYGUI_ICON_205 = 205,
|
||||
RAYGUI_ICON_206 = 206,
|
||||
RAYGUI_ICON_207 = 207,
|
||||
RAYGUI_ICON_208 = 208,
|
||||
RAYGUI_ICON_209 = 209,
|
||||
RAYGUI_ICON_210 = 210,
|
||||
RAYGUI_ICON_211 = 211,
|
||||
RAYGUI_ICON_212 = 212,
|
||||
RAYGUI_ICON_213 = 213,
|
||||
RAYGUI_ICON_214 = 214,
|
||||
RAYGUI_ICON_215 = 215,
|
||||
RAYGUI_ICON_216 = 216,
|
||||
RAYGUI_ICON_217 = 217,
|
||||
RAYGUI_ICON_218 = 218,
|
||||
RAYGUI_ICON_219 = 219,
|
||||
RAYGUI_ICON_220 = 220,
|
||||
RAYGUI_ICON_221 = 221,
|
||||
RAYGUI_ICON_222 = 222,
|
||||
RAYGUI_ICON_223 = 223,
|
||||
RAYGUI_ICON_224 = 224,
|
||||
RAYGUI_ICON_225 = 225,
|
||||
RAYGUI_ICON_226 = 226,
|
||||
RAYGUI_ICON_227 = 227,
|
||||
RAYGUI_ICON_228 = 228,
|
||||
RAYGUI_ICON_229 = 229,
|
||||
RAYGUI_ICON_230 = 230,
|
||||
RAYGUI_ICON_231 = 231,
|
||||
RAYGUI_ICON_232 = 232,
|
||||
RAYGUI_ICON_233 = 233,
|
||||
RAYGUI_ICON_234 = 234,
|
||||
RAYGUI_ICON_235 = 235,
|
||||
RAYGUI_ICON_236 = 236,
|
||||
RAYGUI_ICON_237 = 237,
|
||||
RAYGUI_ICON_238 = 238,
|
||||
RAYGUI_ICON_239 = 239,
|
||||
RAYGUI_ICON_240 = 240,
|
||||
RAYGUI_ICON_241 = 241,
|
||||
RAYGUI_ICON_242 = 242,
|
||||
RAYGUI_ICON_243 = 243,
|
||||
RAYGUI_ICON_244 = 244,
|
||||
RAYGUI_ICON_245 = 245,
|
||||
RAYGUI_ICON_246 = 246,
|
||||
RAYGUI_ICON_247 = 247,
|
||||
RAYGUI_ICON_248 = 248,
|
||||
RAYGUI_ICON_249 = 249,
|
||||
RAYGUI_ICON_250 = 250,
|
||||
RAYGUI_ICON_251 = 251,
|
||||
RAYGUI_ICON_252 = 252,
|
||||
RAYGUI_ICON_253 = 253,
|
||||
RAYGUI_ICON_254 = 254,
|
||||
RAYGUI_ICON_255 = 255,
|
||||
RICON_NONE = 0,
|
||||
RICON_FOLDER_FILE_OPEN = 1,
|
||||
RICON_FILE_SAVE_CLASSIC = 2,
|
||||
RICON_FOLDER_OPEN = 3,
|
||||
RICON_FOLDER_SAVE = 4,
|
||||
RICON_FILE_OPEN = 5,
|
||||
RICON_FILE_SAVE = 6,
|
||||
RICON_FILE_EXPORT = 7,
|
||||
RICON_FILE_NEW = 8,
|
||||
RICON_FILE_DELETE = 9,
|
||||
RICON_FILETYPE_TEXT = 10,
|
||||
RICON_FILETYPE_AUDIO = 11,
|
||||
RICON_FILETYPE_IMAGE = 12,
|
||||
RICON_FILETYPE_PLAY = 13,
|
||||
RICON_FILETYPE_VIDEO = 14,
|
||||
RICON_FILETYPE_INFO = 15,
|
||||
RICON_FILE_COPY = 16,
|
||||
RICON_FILE_CUT = 17,
|
||||
RICON_FILE_PASTE = 18,
|
||||
RICON_CURSOR_HAND = 19,
|
||||
RICON_CURSOR_POINTER = 20,
|
||||
RICON_CURSOR_CLASSIC = 21,
|
||||
RICON_PENCIL = 22,
|
||||
RICON_PENCIL_BIG = 23,
|
||||
RICON_BRUSH_CLASSIC = 24,
|
||||
RICON_BRUSH_PAINTER = 25,
|
||||
RICON_WATER_DROP = 26,
|
||||
RICON_COLOR_PICKER = 27,
|
||||
RICON_RUBBER = 28,
|
||||
RICON_COLOR_BUCKET = 29,
|
||||
RICON_TEXT_T = 30,
|
||||
RICON_TEXT_A = 31,
|
||||
RICON_SCALE = 32,
|
||||
RICON_RESIZE = 33,
|
||||
RICON_FILTER_POINT = 34,
|
||||
RICON_FILTER_BILINEAR = 35,
|
||||
RICON_CROP = 36,
|
||||
RICON_CROP_ALPHA = 37,
|
||||
RICON_SQUARE_TOGGLE = 38,
|
||||
RICON_SYMMETRY = 39,
|
||||
RICON_SYMMETRY_HORIZONTAL = 40,
|
||||
RICON_SYMMETRY_VERTICAL = 41,
|
||||
RICON_LENS = 42,
|
||||
RICON_LENS_BIG = 43,
|
||||
RICON_EYE_ON = 44,
|
||||
RICON_EYE_OFF = 45,
|
||||
RICON_FILTER_TOP = 46,
|
||||
RICON_FILTER = 47,
|
||||
RICON_TARGET_POINT = 48,
|
||||
RICON_TARGET_SMALL = 49,
|
||||
RICON_TARGET_BIG = 50,
|
||||
RICON_TARGET_MOVE = 51,
|
||||
RICON_CURSOR_MOVE = 52,
|
||||
RICON_CURSOR_SCALE = 53,
|
||||
RICON_CURSOR_SCALE_RIGHT = 54,
|
||||
RICON_CURSOR_SCALE_LEFT = 55,
|
||||
RICON_UNDO = 56,
|
||||
RICON_REDO = 57,
|
||||
RICON_REREDO = 58,
|
||||
RICON_MUTATE = 59,
|
||||
RICON_ROTATE = 60,
|
||||
RICON_REPEAT = 61,
|
||||
RICON_SHUFFLE = 62,
|
||||
RICON_EMPTYBOX = 63,
|
||||
RICON_TARGET = 64,
|
||||
RICON_TARGET_SMALL_FILL = 65,
|
||||
RICON_TARGET_BIG_FILL = 66,
|
||||
RICON_TARGET_MOVE_FILL = 67,
|
||||
RICON_CURSOR_MOVE_FILL = 68,
|
||||
RICON_CURSOR_SCALE_FILL = 69,
|
||||
RICON_CURSOR_SCALE_RIGHT_FILL = 70,
|
||||
RICON_CURSOR_SCALE_LEFT_FILL = 71,
|
||||
RICON_UNDO_FILL = 72,
|
||||
RICON_REDO_FILL = 73,
|
||||
RICON_REREDO_FILL = 74,
|
||||
RICON_MUTATE_FILL = 75,
|
||||
RICON_ROTATE_FILL = 76,
|
||||
RICON_REPEAT_FILL = 77,
|
||||
RICON_SHUFFLE_FILL = 78,
|
||||
RICON_EMPTYBOX_SMALL = 79,
|
||||
RICON_BOX = 80,
|
||||
RICON_BOX_TOP = 81,
|
||||
RICON_BOX_TOP_RIGHT = 82,
|
||||
RICON_BOX_RIGHT = 83,
|
||||
RICON_BOX_BOTTOM_RIGHT = 84,
|
||||
RICON_BOX_BOTTOM = 85,
|
||||
RICON_BOX_BOTTOM_LEFT = 86,
|
||||
RICON_BOX_LEFT = 87,
|
||||
RICON_BOX_TOP_LEFT = 88,
|
||||
RICON_BOX_CENTER = 89,
|
||||
RICON_BOX_CIRCLE_MASK = 90,
|
||||
RICON_POT = 91,
|
||||
RICON_ALPHA_MULTIPLY = 92,
|
||||
RICON_ALPHA_CLEAR = 93,
|
||||
RICON_DITHERING = 94,
|
||||
RICON_MIPMAPS = 95,
|
||||
RICON_BOX_GRID = 96,
|
||||
RICON_GRID = 97,
|
||||
RICON_BOX_CORNERS_SMALL = 98,
|
||||
RICON_BOX_CORNERS_BIG = 99,
|
||||
RICON_FOUR_BOXES = 100,
|
||||
RICON_GRID_FILL = 101,
|
||||
RICON_BOX_MULTISIZE = 102,
|
||||
RICON_ZOOM_SMALL = 103,
|
||||
RICON_ZOOM_MEDIUM = 104,
|
||||
RICON_ZOOM_BIG = 105,
|
||||
RICON_ZOOM_ALL = 106,
|
||||
RICON_ZOOM_CENTER = 107,
|
||||
RICON_BOX_DOTS_SMALL = 108,
|
||||
RICON_BOX_DOTS_BIG = 109,
|
||||
RICON_BOX_CONCENTRIC = 110,
|
||||
RICON_BOX_GRID_BIG = 111,
|
||||
RICON_OK_TICK = 112,
|
||||
RICON_CROSS = 113,
|
||||
RICON_ARROW_LEFT = 114,
|
||||
RICON_ARROW_RIGHT = 115,
|
||||
RICON_ARROW_BOTTOM = 116,
|
||||
RICON_ARROW_TOP = 117,
|
||||
RICON_ARROW_LEFT_FILL = 118,
|
||||
RICON_ARROW_RIGHT_FILL = 119,
|
||||
RICON_ARROW_BOTTOM_FILL = 120,
|
||||
RICON_ARROW_TOP_FILL = 121,
|
||||
RICON_AUDIO = 122,
|
||||
RICON_FX = 123,
|
||||
RICON_WAVE = 124,
|
||||
RICON_WAVE_SINUS = 125,
|
||||
RICON_WAVE_SQUARE = 126,
|
||||
RICON_WAVE_TRIANGULAR = 127,
|
||||
RICON_CROSS_SMALL = 128,
|
||||
RICON_PLAYER_PREVIOUS = 129,
|
||||
RICON_PLAYER_PLAY_BACK = 130,
|
||||
RICON_PLAYER_PLAY = 131,
|
||||
RICON_PLAYER_PAUSE = 132,
|
||||
RICON_PLAYER_STOP = 133,
|
||||
RICON_PLAYER_NEXT = 134,
|
||||
RICON_PLAYER_RECORD = 135,
|
||||
RICON_MAGNET = 136,
|
||||
RICON_LOCK_CLOSE = 137,
|
||||
RICON_LOCK_OPEN = 138,
|
||||
RICON_CLOCK = 139,
|
||||
RICON_TOOLS = 140,
|
||||
RICON_GEAR = 141,
|
||||
RICON_GEAR_BIG = 142,
|
||||
RICON_BIN = 143,
|
||||
RICON_HAND_POINTER = 144,
|
||||
RICON_LASER = 145,
|
||||
RICON_COIN = 146,
|
||||
RICON_EXPLOSION = 147,
|
||||
RICON_1UP = 148,
|
||||
RICON_PLAYER = 149,
|
||||
RICON_PLAYER_JUMP = 150,
|
||||
RICON_KEY = 151,
|
||||
RICON_DEMON = 152,
|
||||
RICON_TEXT_POPUP = 153,
|
||||
RICON_GEAR_EX = 154,
|
||||
RICON_CRACK = 155,
|
||||
RICON_CRACK_POINTS = 156,
|
||||
RICON_STAR = 157,
|
||||
RICON_DOOR = 158,
|
||||
RICON_EXIT = 159,
|
||||
RICON_MODE_2D = 160,
|
||||
RICON_MODE_3D = 161,
|
||||
RICON_CUBE = 162,
|
||||
RICON_CUBE_FACE_TOP = 163,
|
||||
RICON_CUBE_FACE_LEFT = 164,
|
||||
RICON_CUBE_FACE_FRONT = 165,
|
||||
RICON_CUBE_FACE_BOTTOM = 166,
|
||||
RICON_CUBE_FACE_RIGHT = 167,
|
||||
RICON_CUBE_FACE_BACK = 168,
|
||||
RICON_CAMERA = 169,
|
||||
RICON_SPECIAL = 170,
|
||||
RICON_LINK_NET = 171,
|
||||
RICON_LINK_BOXES = 172,
|
||||
RICON_LINK_MULTI = 173,
|
||||
RICON_LINK = 174,
|
||||
RICON_LINK_BROKE = 175,
|
||||
RICON_TEXT_NOTES = 176,
|
||||
RICON_NOTEBOOK = 177,
|
||||
RICON_SUITCASE = 178,
|
||||
RICON_SUITCASE_ZIP = 179,
|
||||
RICON_MAILBOX = 180,
|
||||
RICON_MONITOR = 181,
|
||||
RICON_PRINTER = 182,
|
||||
RICON_PHOTO_CAMERA = 183,
|
||||
RICON_PHOTO_CAMERA_FLASH = 184,
|
||||
RICON_HOUSE = 185,
|
||||
RICON_HEART = 186,
|
||||
RICON_CORNER = 187,
|
||||
RICON_VERTICAL_BARS = 188,
|
||||
RICON_VERTICAL_BARS_FILL = 189,
|
||||
RICON_LIFE_BARS = 190,
|
||||
RICON_INFO = 191,
|
||||
RICON_CROSSLINE = 192,
|
||||
RICON_HELP = 193,
|
||||
RICON_FILETYPE_ALPHA = 194,
|
||||
RICON_FILETYPE_HOME = 195,
|
||||
RICON_LAYERS_VISIBLE = 196,
|
||||
RICON_LAYERS = 197,
|
||||
RICON_WINDOW = 198,
|
||||
RICON_HIDPI = 199,
|
||||
RICON_200 = 200,
|
||||
RICON_201 = 201,
|
||||
RICON_202 = 202,
|
||||
RICON_203 = 203,
|
||||
RICON_204 = 204,
|
||||
RICON_205 = 205,
|
||||
RICON_206 = 206,
|
||||
RICON_207 = 207,
|
||||
RICON_208 = 208,
|
||||
RICON_209 = 209,
|
||||
RICON_210 = 210,
|
||||
RICON_211 = 211,
|
||||
RICON_212 = 212,
|
||||
RICON_213 = 213,
|
||||
RICON_214 = 214,
|
||||
RICON_215 = 215,
|
||||
RICON_216 = 216,
|
||||
RICON_217 = 217,
|
||||
RICON_218 = 218,
|
||||
RICON_219 = 219,
|
||||
RICON_220 = 220,
|
||||
RICON_221 = 221,
|
||||
RICON_222 = 222,
|
||||
RICON_223 = 223,
|
||||
RICON_224 = 224,
|
||||
RICON_225 = 225,
|
||||
RICON_226 = 226,
|
||||
RICON_227 = 227,
|
||||
RICON_228 = 228,
|
||||
RICON_229 = 229,
|
||||
RICON_230 = 230,
|
||||
RICON_231 = 231,
|
||||
RICON_232 = 232,
|
||||
RICON_233 = 233,
|
||||
RICON_234 = 234,
|
||||
RICON_235 = 235,
|
||||
RICON_236 = 236,
|
||||
RICON_237 = 237,
|
||||
RICON_238 = 238,
|
||||
RICON_239 = 239,
|
||||
RICON_240 = 240,
|
||||
RICON_241 = 241,
|
||||
RICON_242 = 242,
|
||||
RICON_243 = 243,
|
||||
RICON_244 = 244,
|
||||
RICON_245 = 245,
|
||||
RICON_246 = 246,
|
||||
RICON_247 = 247,
|
||||
RICON_248 = 248,
|
||||
RICON_249 = 249,
|
||||
RICON_250 = 250,
|
||||
RICON_251 = 251,
|
||||
RICON_252 = 252,
|
||||
RICON_253 = 253,
|
||||
RICON_254 = 254,
|
||||
RICON_255 = 255,
|
||||
} guiIconName;
|
||||
]]
|
||||
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include <extras/easings.h>
|
||||
#include <rgestures.h>
|
||||
|
||||
#define RAYGUI_SUPPORT_RICONS
|
||||
#define RAYGUI_IMPLEMENTATION
|
||||
#define RAYGUI_STATIC
|
||||
#include <raygui.h>
|
||||
@ -39,9 +40,6 @@
|
||||
|
||||
extern const char *raylua_boot_str;
|
||||
|
||||
#ifdef WIN32
|
||||
__declspec(dllexport)
|
||||
#endif
|
||||
void raylua_boot(lua_State *L, lua_CFunction loadfile, lua_CFunction listfiles,
|
||||
bool repl)
|
||||
{
|
||||
@ -79,9 +77,6 @@ void raylua_boot(lua_State *L, lua_CFunction loadfile, lua_CFunction listfiles,
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
__declspec(dllexport)
|
||||
#endif
|
||||
int luaopen_raylua(lua_State *L)
|
||||
{
|
||||
raylua_boot(L, NULL, NULL, false);
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
local load = loadstring
|
||||
|
||||
raylua.version = "v4.0b"
|
||||
raylua.version = "v4.0-dev"
|
||||
|
||||
function raylua.repl()
|
||||
print("> raylua " .. raylua.version .. " <")
|
||||
|
31
tools/api.h
31
tools/api.h
@ -21,12 +21,9 @@ void SetWindowPosition(int x, int y)
|
||||
void SetWindowMonitor(int monitor)
|
||||
void SetWindowMinSize(int width, int height)
|
||||
void SetWindowSize(int width, int height)
|
||||
void SetWindowOpacity(float opacity)
|
||||
void *GetWindowHandle(void)
|
||||
int GetScreenWidth(void)
|
||||
int GetScreenHeight(void)
|
||||
int GetRenderWidth(void)
|
||||
int GetRenderHeight(void)
|
||||
int GetMonitorCount(void)
|
||||
int GetCurrentMonitor(void)
|
||||
Vector2 GetMonitorPosition(int monitor)
|
||||
@ -107,14 +104,12 @@ bool SaveFileText(const char *fileName, char *text)
|
||||
bool FileExists(const char *fileName)
|
||||
bool DirectoryExists(const char *dirPath)
|
||||
bool IsFileExtension(const char *fileName, const char *ext)
|
||||
int GetFileLength(const char *fileName)
|
||||
const char *GetFileExtension(const char *fileName)
|
||||
const char *GetFileName(const char *filePath)
|
||||
const char *GetFileNameWithoutExt(const char *filePath)
|
||||
const char *GetDirectoryPath(const char *filePath)
|
||||
const char *GetPrevDirectoryPath(const char *dirPath)
|
||||
const char *GetWorkingDirectory(void)
|
||||
const char *GetApplicationDirectory(void)
|
||||
char **GetDirectoryFiles(const char *dirPath, int *count)
|
||||
void ClearDirectoryFiles(void)
|
||||
bool ChangeDirectory(const char *dir)
|
||||
@ -122,10 +117,8 @@ bool IsFileDropped(void)
|
||||
char **GetDroppedFiles(int *count)
|
||||
void ClearDroppedFiles(void)
|
||||
long GetFileModTime(const char *fileName)
|
||||
unsigned char *CompressData(const unsigned char *data, int dataSize, int *compDataSize)
|
||||
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)
|
||||
unsigned char *CompressData(unsigned char *data, int dataLength, int *compDataLength)
|
||||
unsigned char *DecompressData(unsigned char *compData, int compDataLength, int *dataLength)
|
||||
bool SaveStorageValue(unsigned int position, int value)
|
||||
int LoadStorageValue(unsigned int position)
|
||||
void OpenURL(const char *url)
|
||||
@ -137,6 +130,7 @@ void SetExitKey(int key)
|
||||
int GetKeyPressed(void)
|
||||
int GetCharPressed(void)
|
||||
bool IsGamepadAvailable(int gamepad)
|
||||
bool IsGamepadName(int gamepad, const char *name)
|
||||
const char *GetGamepadName(int gamepad)
|
||||
bool IsGamepadButtonPressed(int gamepad, int button)
|
||||
bool IsGamepadButtonDown(int gamepad, int button)
|
||||
@ -328,13 +322,11 @@ 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)
|
||||
void UnloadFontData(GlyphInfo *chars, int glyphCount)
|
||||
void UnloadFont(Font font)
|
||||
bool ExportFontAsCode(Font font, const char *fileName)
|
||||
void DrawFPS(int posX, int posY)
|
||||
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 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 DrawTextCodepoints(Font font, const int *codepoints, int count, Vector2 position, float fontSize, float spacing, Color tint)
|
||||
int MeasureText(const char *text, int fontSize)
|
||||
Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing)
|
||||
int GetGlyphIndex(Font font, int codepoint)
|
||||
@ -345,7 +337,7 @@ void UnloadCodepoints(int *codepoints)
|
||||
int GetCodepointCount(const char *text)
|
||||
int GetCodepoint(const char *text, int *bytesProcessed)
|
||||
const char *CodepointToUTF8(int codepoint, int *byteSize)
|
||||
char *TextCodepointsToUTF8(const int *codepoints, int length)
|
||||
char *TextCodepointsToUTF8(int *codepoints, int length)
|
||||
int TextCopy(char *dst, const char *src)
|
||||
bool TextIsEqual(const char *text1, const char *text2)
|
||||
unsigned int TextLength(const char *text)
|
||||
@ -396,10 +388,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 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 UpdateMeshBuffer(Mesh mesh, int index, const void *data, int dataSize, int offset)
|
||||
void UpdateMeshBuffer(Mesh mesh, int index, void *data, int dataSize, int offset)
|
||||
void UnloadMesh(Mesh mesh)
|
||||
void DrawMesh(Mesh mesh, Material material, Matrix transform)
|
||||
void DrawMeshInstanced(Mesh mesh, Material material, const Matrix *transforms, int instances)
|
||||
void DrawMeshInstanced(Mesh mesh, Material material, Matrix *transforms, int instances)
|
||||
bool ExportMesh(Mesh mesh, const char *fileName)
|
||||
BoundingBox GetMeshBoundingBox(Mesh mesh)
|
||||
void GenMeshTangents(Mesh *mesh)
|
||||
@ -430,6 +422,7 @@ bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2)
|
||||
bool CheckCollisionBoxSphere(BoundingBox box, Vector3 center, float radius)
|
||||
RayCollision GetRayCollisionSphere(Ray ray, Vector3 center, float radius)
|
||||
RayCollision GetRayCollisionBox(Ray ray, BoundingBox box)
|
||||
RayCollision GetRayCollisionModel(Ray ray, Model model)
|
||||
RayCollision GetRayCollisionMesh(Ray ray, Mesh mesh, Matrix transform)
|
||||
RayCollision GetRayCollisionTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3)
|
||||
RayCollision GetRayCollisionQuad(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4)
|
||||
@ -456,14 +449,13 @@ int GetSoundsPlaying(void)
|
||||
bool IsSoundPlaying(Sound sound)
|
||||
void SetSoundVolume(Sound sound, float volume)
|
||||
void SetSoundPitch(Sound sound, float pitch)
|
||||
void SetSoundPan(Sound sound, float pan)
|
||||
void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels)
|
||||
Wave WaveCopy(Wave wave)
|
||||
void WaveCrop(Wave *wave, int initSample, int finalSample)
|
||||
void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels)
|
||||
float *LoadWaveSamples(Wave wave)
|
||||
void UnloadWaveSamples(float *samples)
|
||||
Music LoadMusicStream(const char *fileName)
|
||||
Music LoadMusicStreamFromMemory(const char *fileType, const unsigned char* data, int dataSize)
|
||||
Music LoadMusicStreamFromMemory(const char *fileType, unsigned char* data, int dataSize)
|
||||
void UnloadMusicStream(Music music)
|
||||
void PlayMusicStream(Music music)
|
||||
bool IsMusicStreamPlaying(Music music)
|
||||
@ -473,7 +465,6 @@ void PauseMusicStream(Music music)
|
||||
void ResumeMusicStream(Music music)
|
||||
void SeekMusicStream(Music music, float position)
|
||||
void SetMusicVolume(Music music, float volume)
|
||||
void SetMusicPan(Music music, float pan)
|
||||
void SetMusicPitch(Music music, float pitch)
|
||||
float GetMusicTimeLength(Music music)
|
||||
float GetMusicTimePlayed(Music music)
|
||||
@ -488,8 +479,4 @@ bool IsAudioStreamPlaying(AudioStream stream)
|
||||
void StopAudioStream(AudioStream stream)
|
||||
void SetAudioStreamVolume(AudioStream stream, float volume)
|
||||
void SetAudioStreamPitch(AudioStream stream, float pitch)
|
||||
void SetAudioStreamPan(AudioStream stream, float pan)
|
||||
void SetAudioStreamBufferSizeDefault(int size)
|
||||
void SetAudioStreamCallback(AudioStream stream, AudioCallback callback)
|
||||
void AttachAudioStreamProcessor(AudioStream stream, AudioCallback processor)
|
||||
void DetachAudioStreamProcessor(AudioStream stream, AudioCallback processor)
|
||||
|
@ -16,8 +16,7 @@ local structs = {
|
||||
"TextureCubemap", "TraceLogCallback", "PhysicsBody",
|
||||
"GestureEvent", "GuiStyle", "GuiTextBoxState",
|
||||
"TraceLogCallback", "VertexBuffer", "DrawCall", "RenderBatch",
|
||||
"ShaderAttributeDataType", "MaterialMapIndex", "VrStereoConfig",
|
||||
"AudioCallback"
|
||||
"ShaderAttributeDataType", "MaterialMapIndex", "VrStereoConfig"
|
||||
}
|
||||
|
||||
local rl_structs = {
|
||||
|
@ -13,11 +13,13 @@ int GuiGetStyle(int control, int property)
|
||||
bool GuiWindowBox(Rectangle bounds, const char *title)
|
||||
void GuiGroupBox(Rectangle bounds, const char *text)
|
||||
void GuiLine(Rectangle bounds, const char *text)
|
||||
void GuiPanel(Rectangle bounds, const char *text)
|
||||
Rectangle GuiScrollPanel(Rectangle bounds, const char *text, Rectangle content, Vector2 *scroll)
|
||||
void GuiPanel(Rectangle bounds)
|
||||
Rectangle GuiScrollPanel(Rectangle bounds, Rectangle content, Vector2 *scroll)
|
||||
void GuiLabel(Rectangle bounds, const char *text)
|
||||
bool GuiButton(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)
|
||||
int GuiToggleGroup(Rectangle bounds, const char *text, int active)
|
||||
bool GuiCheckBox(Rectangle bounds, const char *text, bool checked)
|
||||
@ -32,23 +34,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)
|
||||
void GuiStatusBar(Rectangle bounds, const char *text)
|
||||
void GuiDummyRec(Rectangle bounds, const char *text)
|
||||
Vector2 GuiGrid(Rectangle bounds, const char *text, float spacing, int subdivs)
|
||||
int GuiScrollBar(Rectangle bounds, int value, int minValue, int maxValue)
|
||||
Vector2 GuiGrid(Rectangle bounds, float spacing, int subdivs)
|
||||
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 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 textMaxSize, int *secretViewActive)
|
||||
Color GuiColorPicker(Rectangle bounds, const char *text, Color color)
|
||||
Color GuiColorPanel(Rectangle bounds, const char *text, Color color)
|
||||
float GuiColorBarAlpha(Rectangle bounds, const char *text, float alpha)
|
||||
float GuiColorBarHue(Rectangle bounds, const char *text, float value)
|
||||
int GuiTextInputBox(Rectangle bounds, const char *title, const char *message, const char *buttons, char *text)
|
||||
Color GuiColorPicker(Rectangle bounds, Color color)
|
||||
Color GuiColorPanel(Rectangle bounds, Color color)
|
||||
float GuiColorBarAlpha(Rectangle bounds, float alpha)
|
||||
float GuiColorBarHue(Rectangle bounds, float value)
|
||||
void GuiLoadStyle(const char *fileName)
|
||||
void GuiLoadStyleDefault(void)
|
||||
const char *GuiIconText(int iconId, const char *text)
|
||||
void GuiDrawIcon(int iconId, int posX, int posY, int pixelSize, Color color)
|
||||
void GuiDrawIcon(int iconId, Vector2 position, int pixelSize, Color color)
|
||||
unsigned int *GuiGetIcons(void)
|
||||
unsigned int *GuiGetIconData(int iconId)
|
||||
void GuiSetIconData(int iconId, unsigned int *data)
|
||||
void GuiSetIconScale(unsigned int scale)
|
||||
void GuiSetIconPixel(int iconId, int x, int y)
|
||||
void GuiClearIconPixel(int iconId, int x, int y)
|
||||
bool GuiCheckIconPixel(int iconId, int x, int y)
|
@ -12,14 +12,12 @@ float Vector2Length(Vector2 v)
|
||||
float Vector2LengthSqr(Vector2 v)
|
||||
float Vector2DotProduct(Vector2 v1, Vector2 v2)
|
||||
float Vector2Distance(Vector2 v1, Vector2 v2)
|
||||
float Vector2DistanceSqr(Vector2 v1, Vector2 v2)
|
||||
float Vector2Angle(Vector2 v1, Vector2 v2)
|
||||
Vector2 Vector2Scale(Vector2 v, float scale)
|
||||
Vector2 Vector2Multiply(Vector2 v1, Vector2 v2)
|
||||
Vector2 Vector2Negate(Vector2 v)
|
||||
Vector2 Vector2Divide(Vector2 v1, Vector2 v2)
|
||||
Vector2 Vector2Normalize(Vector2 v)
|
||||
Vector2 Vector2Transform(Vector2 v, Matrix mat)
|
||||
Vector2 Vector2Lerp(Vector2 v1, Vector2 v2, float amount)
|
||||
Vector2 Vector2Reflect(Vector2 v, Vector2 normal)
|
||||
Vector2 Vector2Rotate(Vector2 v, float degs)
|
||||
@ -38,7 +36,6 @@ float Vector3Length(const Vector3 v)
|
||||
float Vector3LengthSqr(const Vector3 v)
|
||||
float Vector3DotProduct(Vector3 v1, Vector3 v2)
|
||||
float Vector3Distance(Vector3 v1, Vector3 v2)
|
||||
float Vector3DistanceSqr(Vector3 v1, Vector3 v2)
|
||||
Vector2 Vector3Angle(Vector3 v1, Vector3 v2)
|
||||
Vector3 Vector3Negate(Vector3 v)
|
||||
Vector3 Vector3Divide(Vector3 v1, Vector3 v2)
|
||||
@ -56,6 +53,7 @@ float MatrixDeterminant(Matrix mat)
|
||||
float MatrixTrace(Matrix mat)
|
||||
Matrix MatrixTranspose(Matrix mat)
|
||||
Matrix MatrixInvert(Matrix mat)
|
||||
Matrix MatrixNormalize(Matrix mat)
|
||||
Matrix MatrixIdentity(void)
|
||||
Matrix MatrixAdd(Matrix left, Matrix right)
|
||||
Matrix MatrixSubtract(Matrix left, Matrix right)
|
||||
|
17
tools/rlgl.h
17
tools/rlgl.h
@ -84,22 +84,21 @@ void rlDrawRenderBatchActive(void)
|
||||
bool rlCheckRenderBatchLimit(int vCount)
|
||||
void rlSetTexture(unsigned int id)
|
||||
unsigned int rlLoadVertexArray(void)
|
||||
unsigned int rlLoadVertexBuffer(const void *buffer, int size, bool dynamic)
|
||||
unsigned int rlLoadVertexBufferElement(const void *buffer, int size, bool dynamic)
|
||||
void rlUpdateVertexBuffer(unsigned int bufferId, const void *data, int dataSize, int offset)
|
||||
void rlUpdateVertexBufferElements(unsigned int id, const void *data, int dataSize, int offset)
|
||||
unsigned int rlLoadVertexBuffer(void *buffer, int size, bool dynamic)
|
||||
unsigned int rlLoadVertexBufferElement(void *buffer, int size, bool dynamic)
|
||||
void rlUpdateVertexBuffer(unsigned int bufferId, void *data, int dataSize, int offset)
|
||||
void rlUnloadVertexArray(unsigned int vaoId)
|
||||
void rlUnloadVertexBuffer(unsigned int vboId)
|
||||
void rlSetVertexAttribute(unsigned int index, int compSize, int type, bool normalized, int stride, const void *pointer)
|
||||
void rlSetVertexAttribute(unsigned int index, int compSize, int type, bool normalized, int stride, void *pointer)
|
||||
void rlSetVertexAttributeDivisor(unsigned int index, int divisor)
|
||||
void rlSetVertexAttributeDefault(int locIndex, const void *value, int attribType, int count)
|
||||
void rlDrawVertexArray(int offset, int count)
|
||||
void rlDrawVertexArrayElements(int offset, int count, const void *buffer)
|
||||
void rlDrawVertexArrayElements(int offset, int count, void *buffer)
|
||||
void rlDrawVertexArrayInstanced(int offset, int count, int instances)
|
||||
void rlDrawVertexArrayElementsInstanced(int offset, int count, const void *buffer, int instances)
|
||||
unsigned int rlLoadTexture(const void *data, int width, int height, int format, int mipmapCount)
|
||||
void rlDrawVertexArrayElementsInstanced(int offset, int count, void *buffer, int instances)
|
||||
unsigned int rlLoadTexture(void *data, int width, int height, int format, int mipmapCount)
|
||||
unsigned int rlLoadTextureDepth(int width, int height, bool useRenderBuffer)
|
||||
unsigned int rlLoadTextureCubemap(const void *data, int size, int format)
|
||||
unsigned int rlLoadTextureCubemap(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 rlGetGlTextureFormats(int format, int *glInternalFormat, int *glFormat, int *glType)
|
||||
const char *rlGetPixelFormatName(unsigned int format)
|
||||
|
Loading…
Reference in New Issue
Block a user