Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
0cb20c7d7c |
12
.gitignore
vendored
12
.gitignore
vendored
@ -1,12 +1,14 @@
|
|||||||
*.o
|
*.o
|
||||||
*.res
|
wray_standalone\.exe
|
||||||
*.a
|
src/wray_api\.c
|
||||||
|
libwray\.a
|
||||||
|
|
||||||
raylua_e.exe
|
raylua_e.exe
|
||||||
raylua_r.exe
|
|
||||||
raylua_s.exe
|
raylua_s.exe
|
||||||
raylua_s
|
|
||||||
raylua_e
|
|
||||||
src/autogen/bind.c
|
src/autogen/bind.c
|
||||||
src/autogen/boot.c
|
src/autogen/boot.c
|
||||||
src/autogen/builder.c
|
src/autogen/builder.c
|
||||||
|
|
||||||
libraylua.a
|
libraylua.a
|
||||||
|
src/res/icon.res
|
||||||
|
5
.gitmodules
vendored
5
.gitmodules
vendored
@ -1,11 +1,10 @@
|
|||||||
[submodule "LuaJIT"]
|
[submodule "LuaJIT"]
|
||||||
path = luajit
|
path = luajit
|
||||||
url = https://github.com/LuaJIT/LuaJIT
|
url = https://github.com/moonjit/moonjit
|
||||||
branch = v2.0
|
|
||||||
|
|
||||||
[submodule "raylib"]
|
[submodule "raylib"]
|
||||||
path = raylib
|
path = raylib
|
||||||
url = https://github.com/raysan5/raylib
|
url = https://github.com/TSnake41/raylib
|
||||||
|
|
||||||
[submodule "raygui"]
|
[submodule "raygui"]
|
||||||
path = raygui
|
path = raygui
|
||||||
|
70
.travis.yml
70
.travis.yml
@ -1,70 +0,0 @@
|
|||||||
language: c
|
|
||||||
dist: xenial
|
|
||||||
|
|
||||||
git:
|
|
||||||
depth: 3
|
|
||||||
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: linux
|
|
||||||
- os: osx
|
|
||||||
- os: windows
|
|
||||||
|
|
||||||
addons:
|
|
||||||
artifacts:
|
|
||||||
paths:
|
|
||||||
- build
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- gcc-multilib
|
|
||||||
- libasound2-dev
|
|
||||||
- libxcursor-dev
|
|
||||||
- libxinerama-dev
|
|
||||||
- mesa-common-dev
|
|
||||||
- libx11-dev
|
|
||||||
- libxrandr-dev
|
|
||||||
- libxrandr2
|
|
||||||
- libxi-dev
|
|
||||||
- libgl1-mesa-dev
|
|
||||||
- libglu1-mesa-dev
|
|
||||||
|
|
||||||
before_cache:
|
|
||||||
- case $TRAVIS_OS_NAME in
|
|
||||||
windows)
|
|
||||||
$msys2 pacman --sync --clean --noconfirm
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
cache:
|
|
||||||
directories:
|
|
||||||
- $HOME/AppData/Local/Temp/chocolatey
|
|
||||||
- /C/tools/msys64
|
|
||||||
|
|
||||||
before_install:
|
|
||||||
- export MAKE=make
|
|
||||||
- case $TRAVIS_OS_NAME in
|
|
||||||
windows)
|
|
||||||
[[ ! -f C:/tools/msys64/msys2_shell.cmd ]] && rm -rf C:/tools/msys64
|
|
||||||
choco uninstall -y mingw
|
|
||||||
choco upgrade --no-progress -y msys2
|
|
||||||
export msys2='cmd //C RefreshEnv.cmd '
|
|
||||||
export msys2+='& set MSYS=winsymlinks:nativestrict '
|
|
||||||
export msys2+='& C:\\tools\\msys64\\msys2_shell.cmd -defterm -no-start'
|
|
||||||
export mingw64="$msys2 -mingw64 -full-path -here -c "\"\$@"\" --"
|
|
||||||
export msys2+=" -msys2 -c "\"\$@"\" --"
|
|
||||||
$msys2 pacman --sync --noconfirm --needed mingw-w64-x86_64-toolchain
|
|
||||||
taskkill //IM gpg-agent.exe //F
|
|
||||||
export PATH=/C/tools/msys64/mingw64/bin:$PATH
|
|
||||||
export MAKE="$mingw64 make"
|
|
||||||
$msys2 pacman -S mingw-w64-x86_64-toolchain
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
- mkdir build
|
|
||||||
- $RUNNER $CC --version
|
|
||||||
|
|
||||||
before_script:
|
|
||||||
|
|
||||||
script:
|
|
||||||
- $RUNNER $MAKE
|
|
||||||
- mv raylua_s build/
|
|
||||||
- mv raylua_e build/
|
|
181
README.md
181
README.md
@ -1,182 +1,11 @@
|
|||||||
**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.
|
![rayfork-lua logo](assets/logo.png)
|
||||||
|
|
||||||
![raylib-lua logo](assets/logo.png)
|
[![release](https://img.shields.io/github/v/release/TSnake41/rayfork-lua?style=flat-square)](https://github.com/TSnake41/rayfork-lua/releases/latest)
|
||||||
|
[![downloads](https://img.shields.io/github/downloads/tsnake41/rayfork-lua/total?style=flat-square)](https://github.com/TSnake41/rayfork-lua/releases)
|
||||||
|
|
||||||
[![release](https://img.shields.io/github/v/release/TSnake41/raylib-lua?style=flat-square)](https://github.com/TSnake41/raylib-lua/releases/latest)
|
## rayfork-lua
|
||||||
[![downloads](https://img.shields.io/github/downloads/tsnake41/raylib-lua/total?style=flat-square)](https://github.com/TSnake41/raylib-lua/releases)
|
|
||||||
|
|
||||||
## raylib-lua
|
Modular [LuaJIT](https://luajit.org/)-based binding for [SasLuca/rayfork](https://github.com/SasLuca/rayfork).
|
||||||
|
|
||||||
[LuaJIT](https://luajit.org/)-based binding for [raylib](https://www.raylib.com/), a simple and easy-to-use
|
|
||||||
library to learn videogames programming.
|
|
||||||
|
|
||||||
This binding is partially based on [raylib-wren/wray](https://github.com/TSnake41/raylib-wren).
|
|
||||||
|
|
||||||
### Usage (raylua_s)
|
|
||||||
|
|
||||||
raylua_s is the script-mode binary of raylib-lua.
|
|
||||||
Without any argument, you get into the REPL which gives you a minimal Lua]
|
|
||||||
shell that allows you to run Lua code from terminal.]
|
|
||||||
|
|
||||||
You can specify a Lua file as argument to run the specified Lua file.
|
|
||||||
|
|
||||||
### Usage (raylua_e)
|
|
||||||
|
|
||||||
raylua_e is the embedding-mode binary of raylib-lua.
|
|
||||||
|
|
||||||
This binary allows you to build standalone raylib applications from Lua code.
|
|
||||||
|
|
||||||
There are 3 ways to use it :
|
|
||||||
- zip mode :
|
|
||||||
If you specify a zip file as argument, this zip will be used as payload
|
|
||||||
application, this file expects to have a `main.lua` which is the entry point
|
|
||||||
of the application.
|
|
||||||
- directory mode :
|
|
||||||
Similar to zip mode except that it automatically build the zip payload from
|
|
||||||
the specified directory.
|
|
||||||
- lua mode :
|
|
||||||
Build the executable from a single Lua file.
|
|
||||||
|
|
||||||
Using `require` in embedded mode works as expected but `dofile` and `loadfile`
|
|
||||||
may not work as expected as these functions load from a external file rather
|
|
||||||
than from `package` loaders.
|
|
||||||
|
|
||||||
### Building / Updating raylib / Contribution
|
|
||||||
|
|
||||||
To build raylib-lua from source, you need to take care that submodules are
|
|
||||||
imported, if not or you are unsure :
|
|
||||||
|
|
||||||
```shell
|
|
||||||
git submodule init
|
|
||||||
git submodule update
|
|
||||||
```
|
|
||||||
|
|
||||||
This make take some time depending on network bandwidth.
|
|
||||||
Then, raylib-lua should build as expected using `make` tool with a working C compiler.
|
|
||||||
|
|
||||||
A working Lua interpreter is needed, by default the luajit interpreter built
|
|
||||||
along with `libluajit.a` is used. In case of cross-compiling, you may want to
|
|
||||||
change which Lua interpreter is used to a one your system supports.
|
|
||||||
You can specify the interpreter with the `LUA` variable.
|
|
||||||
|
|
||||||
If you need to update raylib binding, there are few tasks to do :
|
|
||||||
- update `tools/api.h` functions signatures, keep file clean with exactly one function per line.
|
|
||||||
- update struct definitions in `src/raylib.lua`
|
|
||||||
|
|
||||||
### Loading embedded ressources
|
|
||||||
|
|
||||||
Currently, raylib-lua support loading ressources 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.
|
|
||||||
|
|
||||||
### Making structs
|
|
||||||
|
|
||||||
To make raylib structs, you need to use the LuaJIT FFI.
|
|
||||||
```lua
|
|
||||||
local ffi = require "ffi"
|
|
||||||
```
|
|
||||||
|
|
||||||
Then use ffi.new to make a struct, e.g `ffi.new("Color", r, g, b, a)`
|
|
||||||
|
|
||||||
#### Note concerning pointers
|
|
||||||
|
|
||||||
You can use `rl.ref` to build a pointer from a struct cdata.
|
|
||||||
This functions only work struct cdata, in case of primitive cdata, you
|
|
||||||
need to make a array and pass it directly.
|
|
||||||
|
|
||||||
e.g :
|
|
||||||
```lua
|
|
||||||
local int_ptr = ffi.new "int [1]"
|
|
||||||
local data = tostring(rl.LoadFileData("test.txt", int_ptr))
|
|
||||||
local count = tonumber(int_ptr[0])
|
|
||||||
```
|
|
||||||
|
|
||||||
### Example
|
|
||||||
|
|
||||||
```lua
|
|
||||||
rl.SetConfigFlags(rl.FLAG_VSYNC_HINT)
|
|
||||||
|
|
||||||
rl.InitWindow(800, 450, "raylib [core] example - basic window")
|
|
||||||
|
|
||||||
while not rl.WindowShouldClose() do
|
|
||||||
rl.BeginDrawing()
|
|
||||||
|
|
||||||
rl.ClearBackground(rl.RAYWHITE)
|
|
||||||
rl.DrawText("Congrats! You created your first window!", 190, 200, 20, rl.LIGHTGRAY)
|
|
||||||
|
|
||||||
rl.EndDrawing()
|
|
||||||
end
|
|
||||||
|
|
||||||
rl.CloseWindow()
|
|
||||||
```
|
|
||||||
|
|
||||||
### Compatibility
|
|
||||||
|
|
||||||
raylib-lua (raylua) currently uses raylib 3.5 API.
|
|
||||||
(see [compat.lua](https://github.com/TSnake41/raylib-lua/blob/master/src/compat.lua)).
|
|
||||||
physac and rlgl modules are built-in by default.
|
|
||||||
raygui is supported, but is minimally tested, please report any issues you have
|
|
||||||
with raygui with raylib-lua (raylua) on GitHub or raylib Discord (#raylib-lua channel)
|
|
||||||
|
|
||||||
#### Global API
|
|
||||||
|
|
||||||
You can make raylib-lua (raylua) partially compatible with
|
|
||||||
[original raylib-lua](https://github.com/raysan5/raylib-lua) or
|
|
||||||
[raylib-lua-sol](https://github.com/RobLoach/raylib-lua-sol) with global API by
|
|
||||||
adding `setmetatable(_G, { __index = rl })` on the first line.
|
|
||||||
|
|
||||||
This will allow direct use of the raylib binding through globals instead of `rl` table.
|
|
||||||
|
|
||||||
You have an example of this in `lua_global_api.lua`.
|
|
||||||
|
|
||||||
### Editor support
|
|
||||||
|
|
||||||
Currently, there is no editor autocompletion/integration support for most editors, but there is a
|
|
||||||
[third-party autocompletion support](https://github.com/Rabios/raylua/tree/master/zerobrane)
|
|
||||||
for [ZeroBrane Studio](https://studio.zerobrane.com/) by [Rabios](https://github.com/Rabios).
|
|
||||||
|
|
||||||
#### Debugging
|
|
||||||
|
|
||||||
You can use [Local Lua Debugger for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=tomblind.local-lua-debugger-vscode)
|
|
||||||
to provide debugging support with Visual Studio Code.
|
|
||||||
You need to add this at the beginning of your code to use it :
|
|
||||||
```lua
|
|
||||||
do local f = getmetatable(rl).__index;rawset(rl, "__index", function (_, k) return select(2, pcall(f, _, k)) end) end
|
|
||||||
package.path = package.path .. os.getenv "LUA_PATH"
|
|
||||||
local lldebugger = require "lldebugger"; lldebugger.start()
|
|
||||||
```
|
|
||||||
You also need to setup a launch configuration in Visual Studio Code to run raylua_s with debugger attached, e.g
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"type": "lua-local",
|
|
||||||
"request": "launch",
|
|
||||||
"name": "(Lua) Launch",
|
|
||||||
"cwd": "${workspaceFolder}",
|
|
||||||
"program": { "command": "PATH TO raylua_s" },
|
|
||||||
"args": [ "main.lua OR ${file} OR WHATEVER" ]
|
|
||||||
}
|
|
||||||
```
|
|
||||||
This debugger doesn't support pausing, you need to place a breakpoint before executing
|
|
||||||
to get a actual debug, otherwise, a error needs to be thrown in the application to get the debugging.
|
|
||||||
This debugger has a significant overhead, expect a performance loss in intensive projects.
|
|
||||||
|
|
||||||
### Other bindings
|
|
||||||
|
|
||||||
raylib-lua (raylua) is not the only Lua binding for raylib.
|
|
||||||
|
|
||||||
There are some other bindings, which may or may not be up to date.
|
|
||||||
|
|
||||||
[RobLoach/raylib-lua-sol](https://github.com/RobLoach/raylib-lua-sol)
|
|
||||||
|
|
||||||
[raysan5/raylib-lua](https://github.com/raysan5/raylib-lua/)
|
|
||||||
|
|
||||||
[HDPLocust/raylib-luamore](https://github.com/HDPLocust/raylib-luamore)
|
|
||||||
|
|
||||||
[alexander-matz ffi binding](https://gist.github.com/alexander-matz/f8ee4eb9fdf676203d70c1e5e329a6ec)
|
|
||||||
|
|
||||||
[darltrash/raylib-luajit](https://github.com/darltrash/raylib-luajit)
|
|
||||||
|
|
||||||
[Rabios/raylua](https://github.com/Rabios/raylua)
|
|
||||||
|
|
||||||
### Licence
|
### Licence
|
||||||
|
|
||||||
|
168
Saphirefile.lua
168
Saphirefile.lua
@ -1,168 +0,0 @@
|
|||||||
--[[
|
|
||||||
Saphire-based build system for raylib-lua
|
|
||||||
Copyright (C) 2021 Astie Teddy
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
|
||||||
OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
|
||||||
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
]]
|
|
||||||
|
|
||||||
local saphire = require "saphire"
|
|
||||||
local c = require "saphire-c"
|
|
||||||
local Future = require "saphire-future"
|
|
||||||
local los = require "los"
|
|
||||||
|
|
||||||
local cc = os.getenv "CC" or "cc"
|
|
||||||
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 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"
|
|
||||||
|
|
||||||
cflags = cflags .. " -Iluajit/src -Iraygui/src -Iraylib/src".. " -D" .. graphics
|
|
||||||
|
|
||||||
local raylua_so_path = "raylua.so" -- assume unix-like by default
|
|
||||||
local so_ldflags = 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
|
|
||||||
if saphire.targets.clean then
|
|
||||||
libluajit = {
|
|
||||||
command = "make -C luajit clean",
|
|
||||||
name = "LuaJIT"
|
|
||||||
}
|
|
||||||
else
|
|
||||||
libluajit = {
|
|
||||||
command = string.format("make -C luajit amalg CC=%s BUILDMODE=static MACOSX_DEPLOYMENT_TARGET=10.13", cc),
|
|
||||||
name = "LuaJIT"
|
|
||||||
}
|
|
||||||
end
|
|
||||||
saphire.do_single(libluajit)
|
|
||||||
libluajit[1] = "luajit/src/libluajit.a"
|
|
||||||
|
|
||||||
local libraylib = Future "raylib/src/libraylib.a"
|
|
||||||
saphire.do_subdir("raylib/src", false, "build/buildRaylib.lua", libraylib)
|
|
||||||
|
|
||||||
local function lua2c(files, output, name)
|
|
||||||
if saphire.targets.clean then
|
|
||||||
return string.format("rm -f %s", output)
|
|
||||||
else
|
|
||||||
return string.format("%s tools/lua2str.lua %s %s %s", lua, output, name, table.concat(files, " "))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local function genbind(output, modules)
|
|
||||||
if saphire.targets.clean then
|
|
||||||
return string.format("rm -f %s", output)
|
|
||||||
else
|
|
||||||
return string.format("%s tools/genbind.lua src/autogen/bind.c %s", lua, modules)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local raylua_src = {
|
|
||||||
c.src("src/raylua.c", function ()
|
|
||||||
-- Generate bind.c and boot.c
|
|
||||||
if needs_luajit_built then
|
|
||||||
-- LuaJIT needs to be built
|
|
||||||
libluajit:wait()
|
|
||||||
end
|
|
||||||
|
|
||||||
saphire.do_multi({
|
|
||||||
{
|
|
||||||
command = lua2c(
|
|
||||||
{ "src/raylib.lua", "src/compat.lua", "src/raylua.lua" },
|
|
||||||
"src/autogen/boot.c",
|
|
||||||
"raylua_boot_lua"
|
|
||||||
),
|
|
||||||
name = "boot.c"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
command = genbind("src/autogen/bind.c", modules),
|
|
||||||
name = "bind.c"
|
|
||||||
}
|
|
||||||
}, true)
|
|
||||||
end)
|
|
||||||
}
|
|
||||||
local raylua_obj = c.compile(raylua_src, cflags .. " -D" .. graphics, "raylua", cc)
|
|
||||||
|
|
||||||
local libraylua = c.lib("libraylua.a", raylua_obj, "raylua", ar)
|
|
||||||
|
|
||||||
local raylua_s_src = {
|
|
||||||
"src/raylua_s.c"
|
|
||||||
}
|
|
||||||
local raylua_s_objs = c.compile(raylua_s_src, cflags, "raylua_s", cc)
|
|
||||||
|
|
||||||
local raylua_e_src = {
|
|
||||||
c.src("src/raylua_builder.c", function ()
|
|
||||||
saphire.do_single(lua2c({ "src/raylua_builder.lua" }, "src/autogen/builder.c", "raylua_builder_lua"), true)
|
|
||||||
end),
|
|
||||||
"src/raylua_e.c",
|
|
||||||
"src/lib/miniz.c",
|
|
||||||
"src/raylua_self.c",
|
|
||||||
}
|
|
||||||
local raylua_e_objs = c.compile(raylua_e_src, cflags, "raylua_e", cc)
|
|
||||||
|
|
||||||
local icon
|
|
||||||
if los.type() == "win32" then
|
|
||||||
icon = c.res("src/res/icon.rc", { "src/res/icon.ico" }, "icon", windres)
|
|
||||||
end
|
|
||||||
|
|
||||||
local raylua_s = c.link("raylua_s",
|
|
||||||
saphire.merge(raylua_s_objs, { libraylua, libraylib, libluajit, icon }),
|
|
||||||
ldflags,
|
|
||||||
false,
|
|
||||||
"raylua_s",
|
|
||||||
cc
|
|
||||||
)
|
|
||||||
|
|
||||||
local raylua_e = c.link("raylua_e",
|
|
||||||
saphire.merge(raylua_e_objs, { libraylua, libraylib, libluajit, icon }),
|
|
||||||
ldflags,
|
|
||||||
false,
|
|
||||||
"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
|
|
||||||
)
|
|
@ -1,101 +0,0 @@
|
|||||||
local saphire = require "saphire"
|
|
||||||
|
|
||||||
local cc = os.getenv "CC" or "cc"
|
|
||||||
local ar = os.getenv "AR" or "ar"
|
|
||||||
|
|
||||||
local cflags = os.getenv "CFLAGS" or "-O2 -s"
|
|
||||||
local ldflags = os.getenv "LDFLAGS" or "-O2 -s -lm"
|
|
||||||
|
|
||||||
local include_paths = "-I. -Iexternal/glfw/include -Iexternal/glfw/deps/mingw"
|
|
||||||
|
|
||||||
local los = require "los"
|
|
||||||
|
|
||||||
local consts = {
|
|
||||||
RAYLIB_VERSION = "3.7.0",
|
|
||||||
RAYLIB_API_VERSION = "370",
|
|
||||||
}
|
|
||||||
|
|
||||||
local vars = saphire.map({
|
|
||||||
{ "RAYLIB_LIBTYPE", "STATIC" },
|
|
||||||
{ "RAYLIB_BUILD_MODE", "RELEASE" },
|
|
||||||
{ "RAYLIB_LIB_NAME", "raylib" },
|
|
||||||
{ "RAYLIB_RES_FILE", "./raylib.dll.rc.data" },
|
|
||||||
{ "PLATFORM", "PLATFORM_DESKTOP" },
|
|
||||||
{ "GRAPHICS", "GRAPHICS_API_OPENGL_33" },
|
|
||||||
{ "USE_EXTERNAL_GLFW", "FALSE" },
|
|
||||||
{ "USE_WAYLAND_DISPLAY", "FALSE" }
|
|
||||||
}, function (v)
|
|
||||||
return { v[1], os.getenv(v[1]) or v[2] }
|
|
||||||
end)
|
|
||||||
|
|
||||||
for i,v in ipairs(vars) do
|
|
||||||
vars[v[1]] = v[2]
|
|
||||||
end
|
|
||||||
|
|
||||||
local function build_c(src, obj, flags)
|
|
||||||
return {
|
|
||||||
command = string.format("%s -fdiagnostics-color=always -c -o %s %s %s %s %s", cc, obj, src, flags or "", cflags, ldflags),
|
|
||||||
name = "raylib",
|
|
||||||
display = obj
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
local function build_a(objs, lib)
|
|
||||||
return {
|
|
||||||
command = string.format("%s rcs %s %s", ar, lib, table.concat(objs, " ")),
|
|
||||||
name = "raylib",
|
|
||||||
lib = lib
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
local function build_e(files, output, flags)
|
|
||||||
return {
|
|
||||||
command = string.format("%s -fdiagnostics-color=always -o %s %s %s %s", cc, output, table.concat(files, " "), flags or "", ldflags),
|
|
||||||
name = "raylib",
|
|
||||||
display = output
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
local function build_res(src, output)
|
|
||||||
return {
|
|
||||||
command = string.format("%s %s -O coff %s", windres, src, output),
|
|
||||||
name = "raylib"
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
local objects = {
|
|
||||||
-- ["obj.o"] = { src... }
|
|
||||||
{ "rcore.o", { "rcore.c", "raylib.h", "rlgl.h", "utils.h", "raymath.h", "camera.h", "rgestures.h" } },
|
|
||||||
{ "rglfw.o", { "rglfw.c", flags = os.getenv "GLFW_OSX" or "" } },
|
|
||||||
{ "rshapes.o", { "rshapes.c", "raylib.h", "rlgl.h" } },
|
|
||||||
{ "rtextures.o", { "rtextures.c", "raylib.h", "rlgl.h", "utils.h" } },
|
|
||||||
{ "rtext.o", { "rtext.c", "raylib.h", "utils.h" } },
|
|
||||||
{ "utils.o", { "utils.c", "utils.h" } },
|
|
||||||
{ "rmodels.o", { "rmodels.c", "raylib.h", "rlgl.h", "raymath.h" } },
|
|
||||||
{ "raudio.o", { "raudio.c", "raylib.h" } }
|
|
||||||
}
|
|
||||||
|
|
||||||
if saphire.targets.clean then
|
|
||||||
saphire.do_multi(
|
|
||||||
saphire.map(objects, function (obj_info)
|
|
||||||
return {
|
|
||||||
command = string.format("rm -f %s", obj_info[1])
|
|
||||||
}
|
|
||||||
end), true)
|
|
||||||
else
|
|
||||||
saphire.do_multi(
|
|
||||||
saphire.map(objects, function (obj_info)
|
|
||||||
return function()
|
|
||||||
local obj, src = unpack(obj_info)
|
|
||||||
saphire.do_recipe(src, obj, build_c(src[1], obj,
|
|
||||||
table.concat({ "-D" .. vars.PLATFORM, "-D" .. vars.GRAPHICS, include_paths, src.flags }, " ")),
|
|
||||||
true)
|
|
||||||
end
|
|
||||||
end), true)
|
|
||||||
|
|
||||||
saphire.do_single(
|
|
||||||
build_a(
|
|
||||||
saphire.map(objects, function (obj) return obj[1] end),
|
|
||||||
"libraylib.a"),
|
|
||||||
true)
|
|
||||||
end
|
|
@ -1,61 +0,0 @@
|
|||||||
local future = arg[1]
|
|
||||||
|
|
||||||
local saphire = require "saphire"
|
|
||||||
local c = require "saphire-c"
|
|
||||||
|
|
||||||
local cc = os.getenv "CC" or "cc"
|
|
||||||
local ar = os.getenv "AR" or "ar"
|
|
||||||
|
|
||||||
local cflags = os.getenv "CFLAGS" or "-O2 -s"
|
|
||||||
|
|
||||||
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",
|
|
||||||
}
|
|
||||||
|
|
||||||
local vars = saphire.map({
|
|
||||||
{ "RAYLIB_LIBTYPE", "STATIC" },
|
|
||||||
{ "RAYLIB_BUILD_MODE", "RELEASE" },
|
|
||||||
{ "RAYLIB_LIB_NAME", "raylib" },
|
|
||||||
{ "RAYLIB_RES_FILE", "./raylib.dll.rc.data" },
|
|
||||||
{ "PLATFORM", "PLATFORM_DESKTOP" },
|
|
||||||
{ "GRAPHICS", "GRAPHICS_API_OPENGL_43" },
|
|
||||||
{ "USE_EXTERNAL_GLFW", "FALSE" },
|
|
||||||
{ "USE_WAYLAND_DISPLAY", "FALSE" }
|
|
||||||
}, function (v)
|
|
||||||
return { v[1], os.getenv(v[1]) or v[2] }
|
|
||||||
end)
|
|
||||||
|
|
||||||
for i,v in ipairs(vars) do
|
|
||||||
vars[v[1]] = v[2]
|
|
||||||
end
|
|
||||||
|
|
||||||
local flags = string.format("%s -D%s -D%s %s", cflags, vars.PLATFORM, vars.GRAPHICS, include_paths)
|
|
||||||
|
|
||||||
local src = {
|
|
||||||
-- ["obj.o"] = { src... }
|
|
||||||
{ "rcore.o", { "rcore.c", "raylib.h", "rlgl.h", "utils.h", "raymath.h", "rcamera.h", "rgestures.h" } },
|
|
||||||
{ "rglfw.o", { "rglfw.c", flags = os.getenv "GLFW_OSX" or "" } },
|
|
||||||
{ "rshapes.o", { "rshapes.c", "raylib.h", "rlgl.h" } },
|
|
||||||
{ "rtextures.o", { "rtextures.c", "raylib.h", "rlgl.h", "utils.h" } },
|
|
||||||
{ "rtext.o", { "rtext.c", "raylib.h", "utils.h" } },
|
|
||||||
{ "utils.o", { "utils.c", "utils.h" } },
|
|
||||||
{ "rmodels.o", { "rmodels.c", "raylib.h", "rlgl.h", "raymath.h" } },
|
|
||||||
{ "raudio.o", { "raudio.c", "raylib.h" } }
|
|
||||||
}
|
|
||||||
|
|
||||||
local objs = c.compile(src, flags, "raylib", cc)
|
|
||||||
local libraylib = c.lib("libraylib.a", objs, "raylib")
|
|
||||||
|
|
||||||
libraylib:wait()
|
|
||||||
if future then
|
|
||||||
future:resolve()
|
|
||||||
end
|
|
@ -4,8 +4,10 @@ rl.InitWindow(800, 450, "raylib [core] example - basic window")
|
|||||||
|
|
||||||
while not rl.WindowShouldClose() do
|
while not rl.WindowShouldClose() do
|
||||||
rl.BeginDrawing()
|
rl.BeginDrawing()
|
||||||
|
|
||||||
rl.ClearBackground(rl.RAYWHITE)
|
rl.ClearBackground(rl.RAYWHITE)
|
||||||
rl.DrawText("Congrats! You created your first window!", 190, 200, 20, rl.LIGHTGRAY)
|
rl.DrawText("Congrats! You created your first window!", 190, 200, 20, rl.LIGHTGRAY)
|
||||||
|
|
||||||
rl.EndDrawing()
|
rl.EndDrawing()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,30 +0,0 @@
|
|||||||
rl.SetTraceLogLevel(rl.LOG_WARNING)
|
|
||||||
rl.SetConfigFlags(rl.FLAG_VSYNC_HINT)
|
|
||||||
rl.InitWindow(800, 450, "raylib [core] example - mouse input");
|
|
||||||
|
|
||||||
local ball_position = rl.new("Vector2", -100, -100)
|
|
||||||
local ball_color = rl.DARKBLUE
|
|
||||||
|
|
||||||
while not rl.WindowShouldClose() do
|
|
||||||
ball_position.x = rl.GetMouseX()
|
|
||||||
ball_position.y = rl.GetMouseY()
|
|
||||||
|
|
||||||
if rl.IsMouseButtonPressed(rl.MOUSE_BUTTON_LEFT) then
|
|
||||||
ball_color = rl.MAROON
|
|
||||||
elseif rl.IsMouseButtonPressed(rl.MOUSE_BUTTON_MIDDLE) then
|
|
||||||
ball_color = rl.LIME
|
|
||||||
elseif rl.IsMouseButtonPressed(rl.MOUSE_BUTTON_RIGHT) then
|
|
||||||
ball_color = rl.DARKBLUE
|
|
||||||
end
|
|
||||||
|
|
||||||
rl.BeginDrawing()
|
|
||||||
|
|
||||||
rl.ClearBackground(rl.RAYWHITE)
|
|
||||||
rl.DrawCircleV(ball_position, 40, ball_color)
|
|
||||||
rl.DrawText("move ball with mouse and click mouse button to change color",
|
|
||||||
10, 10, 20, rl.DARKGRAY)
|
|
||||||
|
|
||||||
rl.EndDrawing()
|
|
||||||
end
|
|
||||||
|
|
||||||
rl.CloseWindow()
|
|
@ -1,27 +0,0 @@
|
|||||||
local width, height = 800, 450
|
|
||||||
|
|
||||||
rl.SetConfigFlags(rl.FLAG_VSYNC_HINT)
|
|
||||||
rl.InitWindow(800, 450, "raylib [shapes] example - basic shapes drawing")
|
|
||||||
rl.InitAudioDevice()
|
|
||||||
|
|
||||||
local logo = rl.LoadTexture "ressources/logo.png"
|
|
||||||
local music = rl.LoadMusicStream "ressources/mini1111.xm"
|
|
||||||
|
|
||||||
rl.PlayMusicStream(music)
|
|
||||||
|
|
||||||
while not rl.WindowShouldClose() do
|
|
||||||
rl.UpdateMusicStream(music)
|
|
||||||
|
|
||||||
rl.BeginDrawing()
|
|
||||||
rl.ClearBackground(rl.RAYWHITE)
|
|
||||||
|
|
||||||
rl.DrawTexture(logo, width/2 - logo.width/2, height/2 - logo.height/2, rl.WHITE)
|
|
||||||
rl.DrawText("this is a texture!", 350, 370, 10, rl.GRAY)
|
|
||||||
|
|
||||||
rl.EndDrawing()
|
|
||||||
end
|
|
||||||
|
|
||||||
rl.UnloadMusicStream(music)
|
|
||||||
|
|
||||||
rl.CloseAudioDevice()
|
|
||||||
rl.CloseWindow()
|
|
Binary file not shown.
Before Width: | Height: | Size: 2.5 KiB |
Binary file not shown.
@ -1,44 +0,0 @@
|
|||||||
local width, height = 1280, 720
|
|
||||||
|
|
||||||
rl.SetConfigFlags(rl.FLAG_WINDOW_UNDECORATED)
|
|
||||||
rl.InitWindow(width, height, "raygui - portable window")
|
|
||||||
rl.SetTargetFPS(75)
|
|
||||||
|
|
||||||
local mouse_pos = rl.new("Vector2", 0, 0)
|
|
||||||
local window_pos = rl.GetWindowPosition()
|
|
||||||
local pan_offset = rl.new("Vector2", mouse_pos)
|
|
||||||
|
|
||||||
local drag_window = false
|
|
||||||
local exit_window = false
|
|
||||||
|
|
||||||
while not exit_window and not rl.WindowShouldClose() do
|
|
||||||
mouse_pos = rl.GetMousePosition()
|
|
||||||
|
|
||||||
if rl.IsMouseButtonPressed(rl.MOUSE_BUTTON_LEFT) then
|
|
||||||
if rl.CheckCollisionPointRec(mouse_pos, rl.new("Rectangle", 0, 0, width, 20)) then
|
|
||||||
drag_window = true
|
|
||||||
pan_offset = rl.new("Vector2", mouse_pos)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if drag_window then
|
|
||||||
window_pos = window_pos + mouse_pos - pan_offset
|
|
||||||
|
|
||||||
if rl.IsMouseButtonReleased(rl.MOUSE_BUTTON_RIGHT) then
|
|
||||||
drag_window = false
|
|
||||||
end
|
|
||||||
|
|
||||||
rl.SetWindowPosition(window_pos.x, window_pos.y)
|
|
||||||
end
|
|
||||||
|
|
||||||
rl.BeginDrawing()
|
|
||||||
|
|
||||||
rl.ClearBackground(rl.RAYWHITE)
|
|
||||||
exit_window = rl.GuiWindowBox(rl.new("Rectangle", 0, 0, width, height), "PORTABLE WINDOW")
|
|
||||||
rl.DrawText(string.format("Mouse Position: [ %.0f, %.0f ]", mouse_pos.x, mouse_pos.y),
|
|
||||||
10, 40, 10, rl.DARKGRAY)
|
|
||||||
|
|
||||||
rl.EndDrawing()
|
|
||||||
end
|
|
||||||
|
|
||||||
rl.CloseWindow()
|
|
@ -20,10 +20,13 @@ local menu = lynx.menu ({
|
|||||||
})
|
})
|
||||||
|
|
||||||
rl.SetConfigFlags(rl.FLAG_VSYNC_HINT)
|
rl.SetConfigFlags(rl.FLAG_VSYNC_HINT)
|
||||||
|
--rl.SetTargetFPS(60)
|
||||||
|
|
||||||
rl.InitWindow(800, 450, "raylib [lua] example - lynx menu")
|
rl.InitWindow(800, 450, "raylib [lua] example - lynx menu")
|
||||||
|
|
||||||
while not rl.WindowShouldClose() do
|
while not rl.WindowShouldClose() do
|
||||||
rl.BeginDrawing()
|
rl.BeginDrawing()
|
||||||
|
|
||||||
rl.ClearBackground(rl.BLACK)
|
rl.ClearBackground(rl.BLACK)
|
||||||
local pos = rl.GetMousePosition()
|
local pos = rl.GetMousePosition()
|
||||||
menu:input_mouse(pos.x, pos.y, 0)
|
menu:input_mouse(pos.x, pos.y, 0)
|
||||||
|
@ -46,7 +46,7 @@ rl.SetConfigFlags(rl.FLAG_VSYNC_HINT)
|
|||||||
rl.InitWindow(windowWidth, windowHeight, "my 32x32 game/demo")
|
rl.InitWindow(windowWidth, windowHeight, "my 32x32 game/demo")
|
||||||
|
|
||||||
local target = rl.LoadRenderTexture(gameScreenWidth, gameScreenHeight)
|
local target = rl.LoadRenderTexture(gameScreenWidth, gameScreenHeight)
|
||||||
rl.SetTextureFilter(target.texture, rl.TEXTURE_FILTER_POINT)
|
rl.SetTextureFilter(target.texture, rl.FILTER_POINT)
|
||||||
|
|
||||||
rl.SetTargetFPS(60)
|
rl.SetTargetFPS(60)
|
||||||
|
|
||||||
|
@ -22,10 +22,10 @@ local camera = rl.new("Camera3D", {
|
|||||||
local num_blocks = 15
|
local num_blocks = 15
|
||||||
|
|
||||||
while not rl.WindowShouldClose() do
|
while not rl.WindowShouldClose() do
|
||||||
local t = rl.GetTime()
|
local time = rl.GetTime()
|
||||||
|
|
||||||
local scale = (2.0 + math.sin(t)) * 0.7
|
local scale = (2.0 + math.sin(time)) * 0.7
|
||||||
local camera_time = t * 0.3
|
local camera_time = time * 0.3
|
||||||
|
|
||||||
camera.position.x = math.cos(camera_time) * 40.0
|
camera.position.x = math.cos(camera_time) * 40.0
|
||||||
camera.position.z = math.sin(camera_time) * 40.0
|
camera.position.z = math.sin(camera_time) * 40.0
|
||||||
@ -40,7 +40,7 @@ while not rl.WindowShouldClose() do
|
|||||||
for y=0,num_blocks-1 do
|
for y=0,num_blocks-1 do
|
||||||
for z=0,num_blocks-1 do
|
for z=0,num_blocks-1 do
|
||||||
local block_scale = (x + y + z) / 30
|
local block_scale = (x + y + z) / 30
|
||||||
local scatter = math.sin(block_scale * 20.0 + t * 4.0)
|
local scatter = math.sin(block_scale * 20.0 + time * 4.0)
|
||||||
|
|
||||||
local cube_pos = rl.new("Vector3",
|
local cube_pos = rl.new("Vector3",
|
||||||
(x - num_blocks / 2) * (scale * 3.0) + scatter,
|
(x - num_blocks / 2) * (scale * 3.0) + scatter,
|
||||||
@ -48,8 +48,10 @@ while not rl.WindowShouldClose() do
|
|||||||
(z - num_blocks / 2) * (scale * 3.0) + scatter)
|
(z - num_blocks / 2) * (scale * 3.0) + scatter)
|
||||||
|
|
||||||
local cube_color = rl.ColorFromHSV(
|
local cube_color = rl.ColorFromHSV(
|
||||||
|
rl.new("Vector3",
|
||||||
(((x + y + z) * 18) % 360), 0.75, 0.9
|
(((x + y + z) * 18) % 360), 0.75, 0.9
|
||||||
)
|
)
|
||||||
|
)
|
||||||
|
|
||||||
local cube_size = (2.4 - scale) * block_scale
|
local cube_size = (2.4 - scale) * block_scale
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ circle.enabled = false
|
|||||||
rl.SetTargetFPS(60)
|
rl.SetTargetFPS(60)
|
||||||
|
|
||||||
while not rl.WindowShouldClose() do
|
while not rl.WindowShouldClose() do
|
||||||
rl.UpdatePhysics()
|
rl.RunPhysicsStep()
|
||||||
|
|
||||||
if needsReset then
|
if needsReset then
|
||||||
floor = rl.CreatePhysicsBodyRectangle({ screenWidth/2, screenHeight }, 500, 100, 10)
|
floor = rl.CreatePhysicsBodyRectangle({ screenWidth/2, screenHeight }, 500, 100, 10)
|
||||||
@ -37,9 +37,9 @@ while not rl.WindowShouldClose() do
|
|||||||
needsReset = true
|
needsReset = true
|
||||||
end
|
end
|
||||||
|
|
||||||
if rl.IsMouseButtonPressed(rl.MOUSE_BUTTON_LEFT) then
|
if rl.IsMouseButtonPressed(rl.MOUSE_LEFT_BUTTON) then
|
||||||
rl.CreatePhysicsBodyPolygon(rl.GetMousePosition(), rl.GetRandomValue(20, 80), rl.GetRandomValue(3, 8), 10);
|
rl.CreatePhysicsBodyPolygon(rl.GetMousePosition(), rl.GetRandomValue(20, 80), rl.GetRandomValue(3, 8), 10);
|
||||||
elseif rl.IsMouseButtonPressed(rl.MOUSE_BUTTON_RIGHT) then
|
elseif rl.IsMouseButtonPressed(rl.MOUSE_RIGHT_BUTTON) then
|
||||||
rl.CreatePhysicsBodyCircle(rl.GetMousePosition(), rl.GetRandomValue(10, 45), 10)
|
rl.CreatePhysicsBodyCircle(rl.GetMousePosition(), rl.GetRandomValue(10, 45), 10)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,134 +0,0 @@
|
|||||||
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()
|
|
||||||
end
|
|
||||||
|
|
||||||
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
|
|
@ -1,232 +0,0 @@
|
|||||||
local screenWidth = 1920
|
|
||||||
local screenHeight = 1080
|
|
||||||
|
|
||||||
local preset = 3
|
|
||||||
local default_sharpness = 1.0
|
|
||||||
|
|
||||||
local presets = {
|
|
||||||
{ 2.0, "Performance" },
|
|
||||||
{ 1.7, "Balanced" },
|
|
||||||
{ 1.5, "Quality" },
|
|
||||||
{ 1.3, "Ultra Quality" },
|
|
||||||
{ 1.0, "Custom (Native)" }
|
|
||||||
}
|
|
||||||
|
|
||||||
local use_fsr = true
|
|
||||||
|
|
||||||
local ratio = presets[preset][1]
|
|
||||||
|
|
||||||
local num_blocks = 15
|
|
||||||
|
|
||||||
local screenSize = rl.new("Vector2", screenWidth, screenHeight)
|
|
||||||
|
|
||||||
local fbWidth = screenWidth / ratio
|
|
||||||
local fbHeight = screenHeight / ratio
|
|
||||||
|
|
||||||
local fbSize = rl.new("Vector2", fbWidth, fbHeight)
|
|
||||||
|
|
||||||
rl.SetConfigFlags(rl.FLAG_FULLSCREEN_MODE)
|
|
||||||
rl.InitWindow(screenWidth, screenHeight, "raylua [shaders] example - AMD FSR")
|
|
||||||
|
|
||||||
local render_texture = rl.LoadRenderTexture(fbWidth, fbHeight)
|
|
||||||
|
|
||||||
local dest_fb = rl.LoadRenderTexture(screenWidth, screenHeight)
|
|
||||||
|
|
||||||
local easu_shader = rl.LoadShader(nil, "resources/fsr/fsrEasu.frag")
|
|
||||||
|
|
||||||
local srcSize_loc = rl.GetShaderLocation(easu_shader, "srcSize")
|
|
||||||
local dstSize_loc = rl.GetShaderLocation(easu_shader, "dstSize")
|
|
||||||
|
|
||||||
rl.SetShaderValue(easu_shader, srcSize_loc, fbSize, rl.SHADER_UNIFORM_VEC2)
|
|
||||||
rl.SetShaderValue(easu_shader, dstSize_loc, screenSize, rl.SHADER_UNIFORM_VEC2)
|
|
||||||
|
|
||||||
local rcas_shader = rl.LoadShader(nil, "resources/fsr/fsrRcas.frag")
|
|
||||||
|
|
||||||
local sharpness_loc = rl.GetShaderLocation(rcas_shader, "sharpness")
|
|
||||||
local size_loc = rl.GetShaderLocation(rcas_shader, "dstSize")
|
|
||||||
|
|
||||||
local sharpness = rl.new("float[1]", default_sharpness)
|
|
||||||
|
|
||||||
rl.SetShaderValue(rcas_shader, sharpness_loc, sharpness, rl.SHADER_UNIFORM_FLOAT)
|
|
||||||
rl.SetShaderValue(rcas_shader, size_loc, screenSize, rl.SHADER_UNIFORM_VEC2)
|
|
||||||
|
|
||||||
local camera = rl.new("Camera3D", {
|
|
||||||
position = { 30, 20, 30 },
|
|
||||||
target = { 0, 0, 0 },
|
|
||||||
up = { 0, 1, 0 },
|
|
||||||
fovy = 70,
|
|
||||||
type = rl.CAMERA_PERSPECTIVE
|
|
||||||
})
|
|
||||||
|
|
||||||
local enable_easu = false
|
|
||||||
local enable_rcas = false
|
|
||||||
|
|
||||||
local stop_animation = false
|
|
||||||
local t = 0.0
|
|
||||||
|
|
||||||
local bilinear = false
|
|
||||||
|
|
||||||
while not rl.WindowShouldClose() do
|
|
||||||
if not stop_animation then
|
|
||||||
t = rl.GetTime()
|
|
||||||
end
|
|
||||||
|
|
||||||
local scale = (2.0 + math.sin(t)) * 0.7
|
|
||||||
local camera_time = t * 0.3
|
|
||||||
|
|
||||||
camera.position.x = math.cos(camera_time) * 40.0
|
|
||||||
camera.position.z = math.sin(camera_time) * 40.0
|
|
||||||
|
|
||||||
if use_fsr then
|
|
||||||
rl.BeginTextureMode(render_texture)
|
|
||||||
else
|
|
||||||
rl.BeginDrawing()
|
|
||||||
end
|
|
||||||
|
|
||||||
rl.BeginMode3D(camera)
|
|
||||||
rl.ClearBackground(rl.RAYWHITE)
|
|
||||||
|
|
||||||
rl.DrawGrid(10, 5.0)
|
|
||||||
|
|
||||||
for x=0,num_blocks-1 do
|
|
||||||
for y=0,num_blocks-1 do
|
|
||||||
for z=0,num_blocks-1 do
|
|
||||||
local block_scale = (x + y + z) / 30
|
|
||||||
local scatter = math.sin(block_scale * 20.0 + t * 4.0)
|
|
||||||
|
|
||||||
local cube_pos = rl.new("Vector3",
|
|
||||||
(x - num_blocks / 2) * (scale * 3.0) + scatter,
|
|
||||||
(y - num_blocks / 2) * (scale * 2.0) + scatter,
|
|
||||||
(z - num_blocks / 2) * (scale * 3.0) + scatter)
|
|
||||||
|
|
||||||
local cube_color = rl.ColorFromHSV(
|
|
||||||
(((x + y + z) * 18) % 360), 0.75, 0.9
|
|
||||||
)
|
|
||||||
|
|
||||||
local cube_size = (2.4 - scale) * block_scale
|
|
||||||
|
|
||||||
rl.DrawCube(cube_pos, cube_size, cube_size, cube_size, cube_color)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
rl.EndMode3D()
|
|
||||||
|
|
||||||
if use_fsr then
|
|
||||||
rl.EndTextureMode()
|
|
||||||
|
|
||||||
rl.BeginTextureMode(dest_fb)
|
|
||||||
rl.ClearBackground(rl.RAYWHITE)
|
|
||||||
|
|
||||||
if enable_easu then
|
|
||||||
rl.BeginShaderMode(easu_shader)
|
|
||||||
end
|
|
||||||
rl.DrawTextureEx(render_texture.texture, screenSize, 180, ratio, rl.WHITE)
|
|
||||||
if enable_easu then
|
|
||||||
rl.EndShaderMode()
|
|
||||||
end
|
|
||||||
|
|
||||||
rl.EndTextureMode()
|
|
||||||
|
|
||||||
rl.BeginDrawing()
|
|
||||||
rl.ClearBackground(rl.WHITE)
|
|
||||||
|
|
||||||
if enable_rcas then
|
|
||||||
rl.BeginShaderMode(rcas_shader)
|
|
||||||
end
|
|
||||||
rl.DrawTextureEx(dest_fb.texture, screenSize, 180, 1.0, rl.WHITE)
|
|
||||||
if enable_rcas then
|
|
||||||
rl.EndShaderMode()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
rl.DrawFPS(10, 10)
|
|
||||||
|
|
||||||
if use_fsr then
|
|
||||||
rl.DrawText("EASU", 10, 32, 20, enable_easu and rl.GREEN or rl.RED)
|
|
||||||
rl.DrawText("RCAS", 10, 54, 20, enable_rcas and rl.GREEN or rl.RED)
|
|
||||||
rl.DrawText(string.format("sharpness: %.1f", sharpness[0]), 10, 74, 10, rl.BLACK)
|
|
||||||
rl.DrawText(string.format("Preset: %s (%.1f)", presets[preset][2], ratio), 10, 86, 10, rl.BLACK)
|
|
||||||
rl.DrawText(string.format("Resolution: %dx%d", fbWidth, fbHeight), 10, 98, 10, rl.BLACK)
|
|
||||||
rl.DrawText(string.format("Filter: %s", bilinear and "bilinear" or "point"), 10, 110, 10, rl.BLACK)
|
|
||||||
else
|
|
||||||
rl.DrawText("NATIVE", 10, 32, 20, rl.BLUE)
|
|
||||||
end
|
|
||||||
|
|
||||||
rl.EndDrawing()
|
|
||||||
|
|
||||||
if rl.IsKeyPressed(rl.KEY_E) then
|
|
||||||
enable_easu = not enable_easu
|
|
||||||
end
|
|
||||||
|
|
||||||
if rl.IsKeyPressed(rl.KEY_R) then
|
|
||||||
enable_rcas = not enable_rcas
|
|
||||||
end
|
|
||||||
|
|
||||||
if rl.IsKeyPressed(rl.KEY_N) then
|
|
||||||
use_fsr = not use_fsr
|
|
||||||
end
|
|
||||||
|
|
||||||
if rl.IsKeyPressed(rl.KEY_LEFT) then
|
|
||||||
sharpness[0] = math.max(0.0, sharpness[0] - 0.1)
|
|
||||||
rl.SetShaderValue(rcas_shader, sharpness_loc, sharpness, rl.SHADER_UNIFORM_FLOAT)
|
|
||||||
end
|
|
||||||
|
|
||||||
if rl.IsKeyPressed(rl.KEY_RIGHT) then
|
|
||||||
sharpness[0] = math.min(2.0, sharpness[0] + 0.1)
|
|
||||||
rl.SetShaderValue(rcas_shader, sharpness_loc, sharpness, rl.SHADER_UNIFORM_FLOAT)
|
|
||||||
end
|
|
||||||
|
|
||||||
if rl.IsKeyPressed(rl.KEY_F) then
|
|
||||||
bilinear = not bilinear
|
|
||||||
|
|
||||||
rl.SetTextureFilter(render_texture.texture,
|
|
||||||
bilinear and rl.TEXTURE_FILTER_BILINEAR or rl.TEXTURE_FILTER_POINT)
|
|
||||||
end
|
|
||||||
|
|
||||||
local preset_changed = false
|
|
||||||
if rl.IsKeyPressed(rl.KEY_UP) then
|
|
||||||
preset_changed = true
|
|
||||||
preset = preset + 1
|
|
||||||
if preset == #presets + 1 then
|
|
||||||
preset = 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if rl.IsKeyPressed(rl.KEY_DOWN) then
|
|
||||||
preset_changed = true
|
|
||||||
preset = preset - 1
|
|
||||||
if preset == 0 then
|
|
||||||
preset = #presets
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if rl.IsKeyPressed(rl.KEY_S) then
|
|
||||||
stop_animation = not stop_animation
|
|
||||||
end
|
|
||||||
|
|
||||||
if rl.IsKeyPressed(rl.KEY_F11) then
|
|
||||||
rl.ToggleFullscreen()
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
if preset_changed then
|
|
||||||
ratio = presets[preset][1]
|
|
||||||
fbWidth = screenWidth / ratio
|
|
||||||
fbHeight = screenHeight / ratio
|
|
||||||
|
|
||||||
fbSize = rl.new("Vector2", fbWidth, fbHeight)
|
|
||||||
|
|
||||||
rl.UnloadRenderTexture(render_texture)
|
|
||||||
|
|
||||||
render_texture = rl.LoadRenderTexture(fbWidth, fbHeight)
|
|
||||||
|
|
||||||
|
|
||||||
rl.SetTextureFilter(render_texture.texture,
|
|
||||||
bilinear and rl.TEXTURE_FILTER_BILINEAR or rl.TEXTURE_FILTER_POINT)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
rl.UnloadRenderTexture(render_texture)
|
|
||||||
rl.UnloadRenderTexture(dest_fb)
|
|
||||||
rl.CloseWindow()
|
|
@ -3,7 +3,7 @@ local lua_color = rl.new("Color", 3, 3, 128, 255)
|
|||||||
local width, height = 800, 450
|
local width, height = 800, 450
|
||||||
|
|
||||||
rl.SetConfigFlags(rl.FLAG_VSYNC_HINT)
|
rl.SetConfigFlags(rl.FLAG_VSYNC_HINT)
|
||||||
rl.InitWindow(800, 450, "raylib [shapes] example - raylib logo")
|
rl.InitWindow(800, 450, "raylib [shapes] example - basic shapes drawing")
|
||||||
|
|
||||||
while not rl.WindowShouldClose() do
|
while not rl.WindowShouldClose() do
|
||||||
rl.BeginDrawing()
|
rl.BeginDrawing()
|
||||||
|
@ -1,18 +0,0 @@
|
|||||||
rl.SetConfigFlags(rl.FLAG_VSYNC_HINT)
|
|
||||||
|
|
||||||
rl.InitWindow(800, 450, "raylib [core] example - basic window")
|
|
||||||
|
|
||||||
local font = rl.LoadFontEx("resources/NotoSans-Medium.ttf", 32, nil, 255)
|
|
||||||
|
|
||||||
while not rl.WindowShouldClose() do
|
|
||||||
rl.BeginDrawing()
|
|
||||||
|
|
||||||
rl.DrawFPS(10, 10)
|
|
||||||
|
|
||||||
rl.ClearBackground(rl.RAYWHITE)
|
|
||||||
rl.DrawTextEx(font, "Congrats! You created your first window!", rl.new("Vector2", 174, 200), 32, 0, rl.BLACK)
|
|
||||||
|
|
||||||
rl.EndDrawing()
|
|
||||||
end
|
|
||||||
|
|
||||||
rl.CloseWindow()
|
|
@ -1,42 +0,0 @@
|
|||||||
local lua_color = rl.new("Color", 3, 3, 128, 255)
|
|
||||||
|
|
||||||
local width, height = 800, 450
|
|
||||||
|
|
||||||
--rl.SetConfigFlags(rl.FLAG_VSYNC_HINT)
|
|
||||||
rl.SetTraceLogLevel(rl.LOG_WARNING)
|
|
||||||
rl.InitWindow(width, height, "raylib [shapes] example - software rendered raylib logo")
|
|
||||||
|
|
||||||
local framebuffer = rl.new "Image"
|
|
||||||
local fb_data = rl.new("Color[?]", width * height)
|
|
||||||
|
|
||||||
framebuffer.width = width
|
|
||||||
framebuffer.height = height
|
|
||||||
framebuffer.format = rl.PIXELFORMAT_UNCOMPRESSED_R8G8B8A8
|
|
||||||
framebuffer.mipmaps = 1
|
|
||||||
framebuffer.data = fb_data
|
|
||||||
|
|
||||||
local fb_texture = rl.LoadTextureFromImage(framebuffer)
|
|
||||||
|
|
||||||
while not rl.WindowShouldClose() do
|
|
||||||
--rl.ImageClearBackground(framebuffer, rl.RAYWHITE)
|
|
||||||
for i=0,width*height-1 do
|
|
||||||
fb_data[i] = rl.RAYWHITE
|
|
||||||
end
|
|
||||||
|
|
||||||
rl.ImageDrawRectangle(framebuffer, width / 2 - 128, height / 2 - 128, 256, 256, lua_color)
|
|
||||||
rl.ImageDrawRectangle(framebuffer, width / 2 - 112, height / 2 - 112, 224, 224, rl.RAYWHITE)
|
|
||||||
rl.ImageDrawText(framebuffer, "raylib", width / 2 - 44, height / 2 + 24, 50, lua_color)
|
|
||||||
rl.ImageDrawText(framebuffer, "Lua", width / 2 - 44, height / 2 + 65, 50, lua_color)
|
|
||||||
|
|
||||||
rl.ImageDrawText(framebuffer, "this is NOT a texture!", 350, 370, 10, rl.GRAY)
|
|
||||||
|
|
||||||
rl.UpdateTexture(fb_texture, fb_data)
|
|
||||||
|
|
||||||
rl.BeginDrawing()
|
|
||||||
rl.ClearBackground(rl.RAYWHITE)
|
|
||||||
rl.DrawTexture(fb_texture, 0, 0, rl.WHITE)
|
|
||||||
rl.DrawFPS(10, 10)
|
|
||||||
rl.EndDrawing()
|
|
||||||
end
|
|
||||||
|
|
||||||
rl.CloseWindow()
|
|
2
luajit
2
luajit
@ -1 +1 @@
|
|||||||
Subproject commit 5e3c45c43bb0e0f1f2917d432e9d2dba12c42a6e
|
Subproject commit 76958aa0c445aa817ff41d3a7987e9b7ba7a58c2
|
47
makefile
47
makefile
@ -6,23 +6,13 @@ LUA ?= luajit/src/luajit
|
|||||||
|
|
||||||
WINDRES ?= windres
|
WINDRES ?= windres
|
||||||
|
|
||||||
CFLAGS += -Iluajit/src -Iraylib/src -Iraygui/src
|
CFLAGS += -Iluajit/src
|
||||||
LDFLAGS += luajit/src/libluajit.a raylib/src/libraylib.a
|
LDFLAGS += -Lluajit/src
|
||||||
|
|
||||||
MODULES := raymath rlgl easings gestures physac raygui
|
MODULES := rayfork
|
||||||
|
|
||||||
# raylib settings
|
|
||||||
PLATFORM ?= PLATFORM_DESKTOP
|
|
||||||
GRAPHICS ?= GRAPHICS_API_OPENGL_33
|
|
||||||
|
|
||||||
CFLAGS += -D$(GRAPHICS) -D$(PLATFORM)
|
|
||||||
|
|
||||||
USE_WAYLAND_DISPLAY ?= 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 \
|
||||||
@ -30,32 +20,17 @@ else ifeq ($(shell uname),Darwin)
|
|||||||
-Wl,-pagezero_size,10000,-image_base,100000000
|
-Wl,-pagezero_size,10000,-image_base,100000000
|
||||||
EXTERNAL_FILES :=
|
EXTERNAL_FILES :=
|
||||||
else
|
else
|
||||||
LDFLAGS += -ldl -lpthread
|
LDFLAGS += -ldl -lX11 -lpthread
|
||||||
ifeq ($(PLATFORM),PLATFORM_DRM)
|
|
||||||
LDFLAGS += -ldrm -lGLESv2 -lEGL -lgbm
|
|
||||||
else
|
|
||||||
LDFLAGS += -lX11
|
|
||||||
endif
|
|
||||||
EXTERNAL_FILES :=
|
EXTERNAL_FILES :=
|
||||||
endif
|
endif
|
||||||
|
|
||||||
all: raylua_s raylua_e raylua_r luajit raylib
|
all: raylua_s raylua_e luajit raylib
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
$(CC) -c -o $@ $< $(CFLAGS)
|
$(CC) -c -o $@ $< $(CFLAGS)
|
||||||
|
|
||||||
luajit:
|
luajit:
|
||||||
$(MAKE) -C luajit amalg \
|
$(MAKE) -C luajit amalg CC=$(CC) BUILDMODE=static MACOSX_DEPLOYMENT_TARGET=10.13
|
||||||
CC=$(CC) BUILDMODE=static \
|
|
||||||
MACOSX_DEPLOYMENT_TARGET=10.13
|
|
||||||
|
|
||||||
raylib:
|
|
||||||
$(MAKE) -C raylib/src \
|
|
||||||
CC=$(CC) AR=$(AR) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
|
|
||||||
USE_WAYLAND_DISPLAY="$(USE_WAYLAND_DISPLAY)" \
|
|
||||||
USE_EXTERNAL_GLFW="$(USE_EXTERNAL_GLFW)" \
|
|
||||||
PLATFORM="$(PLATFORM)" GRAPHICS="$(GRAPHICS)"
|
|
||||||
|
|
||||||
|
|
||||||
raylua_s: src/raylua_s.o $(EXTERNAL_FILES) libraylua.a
|
raylua_s: src/raylua_s.o $(EXTERNAL_FILES) libraylua.a
|
||||||
$(CC) -o $@ $^ $(LDFLAGS) luajit/src/libluajit.a
|
$(CC) -o $@ $^ $(LDFLAGS) luajit/src/libluajit.a
|
||||||
@ -64,14 +39,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 $@
|
||||||
|
|
||||||
libraylua.a: src/raylua.o
|
libraylua.a: src/lib/rayfork.o src/raylua.o
|
||||||
$(AR) rcu $@ $^
|
$(AR) rcu $@ $^
|
||||||
|
|
||||||
raylua.dll: src/raylua.o
|
raylua.dll: src/raylua.o
|
||||||
@ -96,10 +67,8 @@ src/autogen/builder.c: src/raylua_builder.lua
|
|||||||
clean:
|
clean:
|
||||||
rm -rf raylua_s raylua_e libraylua.a src/raylua_e.o src/raylua_s.o \
|
rm -rf raylua_s raylua_e libraylua.a src/raylua_e.o src/raylua_s.o \
|
||||||
src/raylua.o src/raylua_self.o src/raylua_builder.o src/autogen/*.c \
|
src/raylua.o src/raylua_self.o src/raylua_builder.o src/autogen/*.c \
|
||||||
src/lib/miniz.o src/res/icon.res
|
src/lib/miniz.o
|
||||||
$(MAKE) -C luajit clean
|
$(MAKE) -C luajit clean
|
||||||
$(MAKE) -C raylib/src clean
|
|
||||||
rm -f raylib/libraylib.a
|
|
||||||
|
|
||||||
.PHONY: all src/autogen/bind.c src/autogen/boot.c raylua_s raylua_e luajit \
|
.PHONY: all src/autogen/bind.c src/autogen/boot.c raylua_s raylua_e luajit \
|
||||||
raylib clean
|
raylib clean
|
||||||
|
593
rayfork
Normal file
593
rayfork
Normal file
@ -0,0 +1,593 @@
|
|||||||
|
struct rf_lua_bind_entry {
|
||||||
|
const char *name;
|
||||||
|
const char *proto;
|
||||||
|
void *ptr;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct rf_lua_bind_entry rayfork_entries[] = {
|
||||||
|
{ "rf_calloc_wrapper", "", &rf_calloc_wrapper },
|
||||||
|
{ "rf_libc_allocator_wrapper", "", &rf_libc_allocator_wrapper },
|
||||||
|
{ "rf_libc_get_file_size", "r", &rf_libc_get_file_size },
|
||||||
|
{ "rf_libc_load_file_into_buffer", "", &rf_libc_load_file_into_buffer },
|
||||||
|
{ "rf_get_last_recorded_error", "r", &rf_get_last_recorded_error },
|
||||||
|
{ "rf_log_type_string", "", &rf_log_type_string },
|
||||||
|
{ "rf_set_logger", "", &rf_set_logger },
|
||||||
|
{ "rf_set_logger_filter", "", &rf_set_logger_filter },
|
||||||
|
{ "rf_libc_printf_logger", "", &rf_libc_printf_logger },
|
||||||
|
{ "rf_libc_rand_wrapper", "r", &rf_libc_rand_wrapper },
|
||||||
|
{ "rf_decode_utf8_char", "r", &rf_decode_utf8_char },
|
||||||
|
{ "rf_count_utf8_chars", "r", &rf_count_utf8_chars },
|
||||||
|
{ "rf_decode_utf8_to_buffer", "r", &rf_decode_utf8_to_buffer },
|
||||||
|
{ "rf_decode_utf8", "r", &rf_decode_utf8 },
|
||||||
|
{ "rf_next_pot", "", &rf_next_pot },
|
||||||
|
{ "rf_center_to_screen", "r", &rf_center_to_screen },
|
||||||
|
{ "rf_center_to_object", "r", &rf_center_to_object },
|
||||||
|
{ "rf_clamp", "", &rf_clamp },
|
||||||
|
{ "rf_lerp", "", &rf_lerp },
|
||||||
|
{ "rf_vec2_add", "r", &rf_vec2_add },
|
||||||
|
{ "rf_vec2_sub", "r", &rf_vec2_sub },
|
||||||
|
{ "rf_vec2_len", "", &rf_vec2_len },
|
||||||
|
{ "rf_vec2_dot_product", "", &rf_vec2_dot_product },
|
||||||
|
{ "rf_vec2_distance", "", &rf_vec2_distance },
|
||||||
|
{ "rf_vec2_angle", "", &rf_vec2_angle },
|
||||||
|
{ "rf_vec2_scale", "r", &rf_vec2_scale },
|
||||||
|
{ "rf_vec2_mul_v", "r", &rf_vec2_mul_v },
|
||||||
|
{ "rf_vec2_negate", "r", &rf_vec2_negate },
|
||||||
|
{ "rf_vec2_div", "r", &rf_vec2_div },
|
||||||
|
{ "rf_vec2_div_v", "r", &rf_vec2_div_v },
|
||||||
|
{ "rf_vec2_normalize", "r", &rf_vec2_normalize },
|
||||||
|
{ "rf_vec2_lerp", "r", &rf_vec2_lerp },
|
||||||
|
{ "rf_vec3_add", "r", &rf_vec3_add },
|
||||||
|
{ "rf_vec3_sub", "r", &rf_vec3_sub },
|
||||||
|
{ "rf_vec3_mul", "r", &rf_vec3_mul },
|
||||||
|
{ "rf_vec3_mul_v", "r", &rf_vec3_mul_v },
|
||||||
|
{ "rf_vec3_cross_product", "r", &rf_vec3_cross_product },
|
||||||
|
{ "rf_vec3_perpendicular", "r", &rf_vec3_perpendicular },
|
||||||
|
{ "rf_vec3_len", "", &rf_vec3_len },
|
||||||
|
{ "rf_vec3_dot_product", "", &rf_vec3_dot_product },
|
||||||
|
{ "rf_vec3_distance", "", &rf_vec3_distance },
|
||||||
|
{ "rf_vec3_scale", "r", &rf_vec3_scale },
|
||||||
|
{ "rf_vec3_negate", "r", &rf_vec3_negate },
|
||||||
|
{ "rf_vec3_div", "r", &rf_vec3_div },
|
||||||
|
{ "rf_vec3_div_v", "r", &rf_vec3_div_v },
|
||||||
|
{ "rf_vec3_normalize", "r", &rf_vec3_normalize },
|
||||||
|
{ "rf_vec3_ortho_normalize", "", &rf_vec3_ortho_normalize },
|
||||||
|
{ "rf_vec3_transform", "r", &rf_vec3_transform },
|
||||||
|
{ "rf_vec3_rotate_by_quaternion", "r", &rf_vec3_rotate_by_quaternion },
|
||||||
|
{ "rf_vec3_lerp", "r", &rf_vec3_lerp },
|
||||||
|
{ "rf_vec3_reflect", "r", &rf_vec3_reflect },
|
||||||
|
{ "rf_vec3_min", "r", &rf_vec3_min },
|
||||||
|
{ "rf_vec3_max", "r", &rf_vec3_max },
|
||||||
|
{ "rf_vec3_barycenter", "r", &rf_vec3_barycenter },
|
||||||
|
{ "rf_mat_determinant", "", &rf_mat_determinant },
|
||||||
|
{ "rf_mat_trace", "", &rf_mat_trace },
|
||||||
|
{ "rf_mat_transpose", "r", &rf_mat_transpose },
|
||||||
|
{ "rf_mat_invert", "r", &rf_mat_invert },
|
||||||
|
{ "rf_mat_normalize", "r", &rf_mat_normalize },
|
||||||
|
{ "rf_mat_identity", "r", &rf_mat_identity },
|
||||||
|
{ "rf_mat_add", "r", &rf_mat_add },
|
||||||
|
{ "rf_mat_sub", "r", &rf_mat_sub },
|
||||||
|
{ "rf_mat_translate", "r", &rf_mat_translate },
|
||||||
|
{ "rf_mat_rotate", "r", &rf_mat_rotate },
|
||||||
|
{ "rf_mat_rotate_xyz", "r", &rf_mat_rotate_xyz },
|
||||||
|
{ "rf_mat_rotate_x", "r", &rf_mat_rotate_x },
|
||||||
|
{ "rf_mat_rotate_y", "r", &rf_mat_rotate_y },
|
||||||
|
{ "rf_mat_rotate_z", "r", &rf_mat_rotate_z },
|
||||||
|
{ "rf_mat_scale", "r", &rf_mat_scale },
|
||||||
|
{ "rf_mat_mul", "r", &rf_mat_mul },
|
||||||
|
{ "rf_mat_frustum", "r", &rf_mat_frustum },
|
||||||
|
{ "rf_mat_perspective", "r", &rf_mat_perspective },
|
||||||
|
{ "rf_mat_ortho", "r", &rf_mat_ortho },
|
||||||
|
{ "rf_mat_look_at", "r", &rf_mat_look_at },
|
||||||
|
{ "rf_mat_to_float16", "r", &rf_mat_to_float16 },
|
||||||
|
{ "rf_quaternion_identity", "r", &rf_quaternion_identity },
|
||||||
|
{ "rf_quaternion_len", "", &rf_quaternion_len },
|
||||||
|
{ "rf_quaternion_normalize", "r", &rf_quaternion_normalize },
|
||||||
|
{ "rf_quaternion_invert", "r", &rf_quaternion_invert },
|
||||||
|
{ "rf_quaternion_mul", "r", &rf_quaternion_mul },
|
||||||
|
{ "rf_quaternion_lerp", "r", &rf_quaternion_lerp },
|
||||||
|
{ "rf_quaternion_nlerp", "r", &rf_quaternion_nlerp },
|
||||||
|
{ "rf_quaternion_slerp", "r", &rf_quaternion_slerp },
|
||||||
|
{ "rf_quaternion_from_vec3_to_vec3", "r", &rf_quaternion_from_vec3_to_vec3 },
|
||||||
|
{ "rf_quaternion_from_mat", "r", &rf_quaternion_from_mat },
|
||||||
|
{ "rf_quaternion_to_mat", "r", &rf_quaternion_to_mat },
|
||||||
|
{ "rf_quaternion_from_axis_angle", "r", &rf_quaternion_from_axis_angle },
|
||||||
|
{ "rf_quaternion_to_axis_angle", "", &rf_quaternion_to_axis_angle },
|
||||||
|
{ "rf_quaternion_from_euler", "r", &rf_quaternion_from_euler },
|
||||||
|
{ "rf_quaternion_to_euler", "r", &rf_quaternion_to_euler },
|
||||||
|
{ "rf_quaternion_transform", "r", &rf_quaternion_transform },
|
||||||
|
{ "rf_rec_match", "", &rf_rec_match },
|
||||||
|
{ "rf_check_collision_recs", "", &rf_check_collision_recs },
|
||||||
|
{ "rf_check_collision_circles", "", &rf_check_collision_circles },
|
||||||
|
{ "rf_check_collision_circle_rec", "", &rf_check_collision_circle_rec },
|
||||||
|
{ "rf_check_collision_point_rec", "", &rf_check_collision_point_rec },
|
||||||
|
{ "rf_check_collision_point_circle", "", &rf_check_collision_point_circle },
|
||||||
|
{ "rf_check_collision_point_triangle", "", &rf_check_collision_point_triangle },
|
||||||
|
{ "rf_get_collision_rec", "r", &rf_get_collision_rec },
|
||||||
|
{ "rf_check_collision_spheres", "", &rf_check_collision_spheres },
|
||||||
|
{ "rf_check_collision_boxes", "", &rf_check_collision_boxes },
|
||||||
|
{ "rf_check_collision_box_sphere", "", &rf_check_collision_box_sphere },
|
||||||
|
{ "rf_check_collision_ray_sphere", "", &rf_check_collision_ray_sphere },
|
||||||
|
{ "rf_check_collision_ray_sphere_ex", "", &rf_check_collision_ray_sphere_ex },
|
||||||
|
{ "rf_check_collision_ray_box", "", &rf_check_collision_ray_box },
|
||||||
|
{ "rf_collision_ray_model", "r", &rf_collision_ray_model },
|
||||||
|
{ "rf_collision_ray_triangle", "r", &rf_collision_ray_triangle },
|
||||||
|
{ "rf_collision_ray_ground", "r", &rf_collision_ray_ground },
|
||||||
|
{ "rf_get_size_base64", "", &rf_get_size_base64 },
|
||||||
|
{ "rf_decode_base64", "r", &rf_decode_base64 },
|
||||||
|
{ "rf_pixel_format_string", "", &rf_pixel_format_string },
|
||||||
|
{ "rf_is_uncompressed_format", "", &rf_is_uncompressed_format },
|
||||||
|
{ "rf_is_compressed_format", "", &rf_is_compressed_format },
|
||||||
|
{ "rf_bits_per_pixel", "", &rf_bits_per_pixel },
|
||||||
|
{ "rf_bytes_per_pixel", "", &rf_bytes_per_pixel },
|
||||||
|
{ "rf_pixel_buffer_size", "", &rf_pixel_buffer_size },
|
||||||
|
{ "rf_format_pixels_to_normalized", "", &rf_format_pixels_to_normalized },
|
||||||
|
{ "rf_format_pixels_to_rgba32", "", &rf_format_pixels_to_rgba32 },
|
||||||
|
{ "rf_format_pixels", "", &rf_format_pixels },
|
||||||
|
{ "rf_format_one_pixel_to_normalized", "r", &rf_format_one_pixel_to_normalized },
|
||||||
|
{ "rf_format_one_pixel_to_rgba32", "r", &rf_format_one_pixel_to_rgba32 },
|
||||||
|
{ "rf_format_one_pixel", "", &rf_format_one_pixel },
|
||||||
|
{ "rf_color_match_rgb", "", &rf_color_match_rgb },
|
||||||
|
{ "rf_color_match", "", &rf_color_match },
|
||||||
|
{ "rf_color_to_int", "", &rf_color_to_int },
|
||||||
|
{ "rf_color_normalize", "r", &rf_color_normalize },
|
||||||
|
{ "rf_color_from_normalized", "r", &rf_color_from_normalized },
|
||||||
|
{ "rf_color_to_hsv", "r", &rf_color_to_hsv },
|
||||||
|
{ "rf_color_from_hsv", "r", &rf_color_from_hsv },
|
||||||
|
{ "rf_color_from_int", "r", &rf_color_from_int },
|
||||||
|
{ "rf_fade", "r", &rf_fade },
|
||||||
|
{ "rf_unproject", "r", &rf_unproject },
|
||||||
|
{ "rf_get_mouse_ray", "r", &rf_get_mouse_ray },
|
||||||
|
{ "rf_get_camera_matrix", "r", &rf_get_camera_matrix },
|
||||||
|
{ "rf_get_camera_matrix2d", "r", &rf_get_camera_matrix2d },
|
||||||
|
{ "rf_get_world_to_screen", "r", &rf_get_world_to_screen },
|
||||||
|
{ "rf_get_world_to_screen2d", "r", &rf_get_world_to_screen2d },
|
||||||
|
{ "rf_get_screen_to_world2d", "r", &rf_get_screen_to_world2d },
|
||||||
|
{ "rf_set_camera3d_mode", "", &rf_set_camera3d_mode },
|
||||||
|
{ "rf_update_camera3d", "", &rf_update_camera3d },
|
||||||
|
{ "rf_image_size", "", &rf_image_size },
|
||||||
|
{ "rf_image_size_in_format", "", &rf_image_size_in_format },
|
||||||
|
{ "rf_image_get_pixels_as_rgba32_to_buffer", "", &rf_image_get_pixels_as_rgba32_to_buffer },
|
||||||
|
{ "rf_image_get_pixels_as_normalized_to_buffer", "", &rf_image_get_pixels_as_normalized_to_buffer },
|
||||||
|
{ "rf_image_pixels_to_rgba32", "r", &rf_image_pixels_to_rgba32 },
|
||||||
|
{ "rf_image_compute_pixels_to_normalized", "r", &rf_image_compute_pixels_to_normalized },
|
||||||
|
{ "rf_image_extract_palette_to_buffer", "", &rf_image_extract_palette_to_buffer },
|
||||||
|
{ "rf_image_extract_palette", "r", &rf_image_extract_palette },
|
||||||
|
{ "rf_image_alpha_border", "r", &rf_image_alpha_border },
|
||||||
|
{ "rf_supports_image_file_type", "", &rf_supports_image_file_type },
|
||||||
|
{ "rf_load_image_from_file_data_to_buffer", "r", &rf_load_image_from_file_data_to_buffer },
|
||||||
|
{ "rf_load_image_from_file_data", "r", &rf_load_image_from_file_data },
|
||||||
|
{ "rf_load_image_from_hdr_file_data_to_buffer", "r", &rf_load_image_from_hdr_file_data_to_buffer },
|
||||||
|
{ "rf_load_image_from_hdr_file_data", "r", &rf_load_image_from_hdr_file_data },
|
||||||
|
{ "rf_load_image_from_format_to_buffer", "r", &rf_load_image_from_format_to_buffer },
|
||||||
|
{ "rf_load_image_from_file", "r", &rf_load_image_from_file },
|
||||||
|
{ "rf_unload_image", "", &rf_unload_image },
|
||||||
|
{ "rf_mipmaps_image_size", "", &rf_mipmaps_image_size },
|
||||||
|
{ "rf_compute_mipmaps_stats", "r", &rf_compute_mipmaps_stats },
|
||||||
|
{ "rf_image_gen_mipmaps_to_buffer", "r", &rf_image_gen_mipmaps_to_buffer },
|
||||||
|
{ "rf_image_gen_mipmaps", "r", &rf_image_gen_mipmaps },
|
||||||
|
{ "rf_unload_mipmaps_image", "", &rf_unload_mipmaps_image },
|
||||||
|
{ "rf_get_dds_image_size", "r", &rf_get_dds_image_size },
|
||||||
|
{ "rf_load_dds_image_to_buffer", "r", &rf_load_dds_image_to_buffer },
|
||||||
|
{ "rf_load_dds_image", "r", &rf_load_dds_image },
|
||||||
|
{ "rf_load_dds_image_from_file", "r", &rf_load_dds_image_from_file },
|
||||||
|
{ "rf_get_pkm_image_size", "r", &rf_get_pkm_image_size },
|
||||||
|
{ "rf_load_pkm_image_to_buffer", "r", &rf_load_pkm_image_to_buffer },
|
||||||
|
{ "rf_load_pkm_image", "r", &rf_load_pkm_image },
|
||||||
|
{ "rf_load_pkm_image_from_file", "r", &rf_load_pkm_image_from_file },
|
||||||
|
{ "rf_get_ktx_image_size", "r", &rf_get_ktx_image_size },
|
||||||
|
{ "rf_load_ktx_image_to_buffer", "r", &rf_load_ktx_image_to_buffer },
|
||||||
|
{ "rf_load_ktx_image", "r", &rf_load_ktx_image },
|
||||||
|
{ "rf_load_ktx_image_from_file", "r", &rf_load_ktx_image_from_file },
|
||||||
|
{ "rf_load_animated_gif", "r", &rf_load_animated_gif },
|
||||||
|
{ "rf_load_animated_gif_file", "r", &rf_load_animated_gif_file },
|
||||||
|
{ "rf_gif_frame_size", "r", &rf_gif_frame_size },
|
||||||
|
{ "rf_get_frame_from_gif", "r", &rf_get_frame_from_gif },
|
||||||
|
{ "rf_unload_gif", "", &rf_unload_gif },
|
||||||
|
{ "rf_get_seed_for_cellular_image", "r", &rf_get_seed_for_cellular_image },
|
||||||
|
{ "rf_gen_image_color_to_buffer", "r", &rf_gen_image_color_to_buffer },
|
||||||
|
{ "rf_gen_image_color", "r", &rf_gen_image_color },
|
||||||
|
{ "rf_gen_image_gradient_v_to_buffer", "r", &rf_gen_image_gradient_v_to_buffer },
|
||||||
|
{ "rf_gen_image_gradient_v", "r", &rf_gen_image_gradient_v },
|
||||||
|
{ "rf_gen_image_gradient_h_to_buffer", "r", &rf_gen_image_gradient_h_to_buffer },
|
||||||
|
{ "rf_gen_image_gradient_h", "r", &rf_gen_image_gradient_h },
|
||||||
|
{ "rf_gen_image_gradient_radial_to_buffer", "r", &rf_gen_image_gradient_radial_to_buffer },
|
||||||
|
{ "rf_gen_image_gradient_radial", "r", &rf_gen_image_gradient_radial },
|
||||||
|
{ "rf_gen_image_checked_to_buffer", "r", &rf_gen_image_checked_to_buffer },
|
||||||
|
{ "rf_gen_image_checked", "r", &rf_gen_image_checked },
|
||||||
|
{ "rf_gen_image_white_noise_to_buffer", "r", &rf_gen_image_white_noise_to_buffer },
|
||||||
|
{ "rf_gen_image_white_noise", "r", &rf_gen_image_white_noise },
|
||||||
|
{ "rf_gen_image_perlin_noise_to_buffer", "r", &rf_gen_image_perlin_noise_to_buffer },
|
||||||
|
{ "rf_gen_image_perlin_noise", "r", &rf_gen_image_perlin_noise },
|
||||||
|
{ "rf_gen_image_cellular_to_buffer", "r", &rf_gen_image_cellular_to_buffer },
|
||||||
|
{ "rf_gen_image_cellular", "r", &rf_gen_image_cellular },
|
||||||
|
{ "rf_image_copy_to_buffer", "r", &rf_image_copy_to_buffer },
|
||||||
|
{ "rf_image_copy", "r", &rf_image_copy },
|
||||||
|
{ "rf_image_crop_to_buffer", "r", &rf_image_crop_to_buffer },
|
||||||
|
{ "rf_image_crop", "r", &rf_image_crop },
|
||||||
|
{ "rf_image_resize_to_buffer", "r", &rf_image_resize_to_buffer },
|
||||||
|
{ "rf_image_resize", "r", &rf_image_resize },
|
||||||
|
{ "rf_image_resize_nn_to_buffer", "r", &rf_image_resize_nn_to_buffer },
|
||||||
|
{ "rf_image_resize_nn", "r", &rf_image_resize_nn },
|
||||||
|
{ "rf_image_format_to_buffer", "r", &rf_image_format_to_buffer },
|
||||||
|
{ "rf_image_format", "r", &rf_image_format },
|
||||||
|
{ "rf_image_alpha_mask_to_buffer", "r", &rf_image_alpha_mask_to_buffer },
|
||||||
|
{ "rf_image_alpha_clear", "r", &rf_image_alpha_clear },
|
||||||
|
{ "rf_image_alpha_premultiply", "r", &rf_image_alpha_premultiply },
|
||||||
|
{ "rf_image_alpha_crop_rec", "r", &rf_image_alpha_crop_rec },
|
||||||
|
{ "rf_image_alpha_crop", "r", &rf_image_alpha_crop },
|
||||||
|
{ "rf_image_dither", "r", &rf_image_dither },
|
||||||
|
{ "rf_image_flip_vertical_in_place", "", &rf_image_flip_vertical_in_place },
|
||||||
|
{ "rf_image_flip_vertical_to_buffer", "r", &rf_image_flip_vertical_to_buffer },
|
||||||
|
{ "rf_image_flip_vertical", "r", &rf_image_flip_vertical },
|
||||||
|
{ "rf_image_flip_horizontal_in_place", "", &rf_image_flip_horizontal_in_place },
|
||||||
|
{ "rf_image_flip_horizontal_to_buffer", "r", &rf_image_flip_horizontal_to_buffer },
|
||||||
|
{ "rf_image_flip_horizontal", "r", &rf_image_flip_horizontal },
|
||||||
|
{ "rf_image_rotate_cw_to_buffer", "r", &rf_image_rotate_cw_to_buffer },
|
||||||
|
{ "rf_image_rotate_cw", "r", &rf_image_rotate_cw },
|
||||||
|
{ "rf_image_rotate_ccw_to_buffer", "r", &rf_image_rotate_ccw_to_buffer },
|
||||||
|
{ "rf_image_rotate_ccw", "r", &rf_image_rotate_ccw },
|
||||||
|
{ "rf_image_color_tint_to_buffer", "r", &rf_image_color_tint_to_buffer },
|
||||||
|
{ "rf_image_color_tint", "r", &rf_image_color_tint },
|
||||||
|
{ "rf_image_color_invert_to_buffer", "r", &rf_image_color_invert_to_buffer },
|
||||||
|
{ "rf_image_color_invert", "r", &rf_image_color_invert },
|
||||||
|
{ "rf_image_color_grayscale_to_buffer", "r", &rf_image_color_grayscale_to_buffer },
|
||||||
|
{ "rf_image_color_grayscale", "r", &rf_image_color_grayscale },
|
||||||
|
{ "rf_image_color_contrast_to_buffer", "r", &rf_image_color_contrast_to_buffer },
|
||||||
|
{ "rf_image_color_contrast", "r", &rf_image_color_contrast },
|
||||||
|
{ "rf_image_color_brightness_to_buffer", "r", &rf_image_color_brightness_to_buffer },
|
||||||
|
{ "rf_image_color_brightness", "r", &rf_image_color_brightness },
|
||||||
|
{ "rf_image_color_replace_to_buffer", "r", &rf_image_color_replace_to_buffer },
|
||||||
|
{ "rf_image_color_replace", "r", &rf_image_color_replace },
|
||||||
|
{ "rf_image_draw", "", &rf_image_draw },
|
||||||
|
{ "rf_image_draw_rectangle", "", &rf_image_draw_rectangle },
|
||||||
|
{ "rf_image_draw_rectangle_lines", "", &rf_image_draw_rectangle_lines },
|
||||||
|
{ "rf_audio_device_count", "r", &rf_audio_device_count },
|
||||||
|
{ "rf_default_audio_device", "r", &rf_default_audio_device },
|
||||||
|
{ "rf_start_audio_device", "", &rf_start_audio_device },
|
||||||
|
{ "rf_close_audio_device", "", &rf_close_audio_device },
|
||||||
|
{ "rf_is_audio_device_ready", "", &rf_is_audio_device_ready },
|
||||||
|
{ "rf_set_master_volume", "", &rf_set_master_volume },
|
||||||
|
{ "rf_audio_format_from_filename_extension", "r", &rf_audio_format_from_filename_extension },
|
||||||
|
{ "rf_audio_format_from_filename_extension_string", "r", &rf_audio_format_from_filename_extension_string },
|
||||||
|
{ "rf_fully_decode_wav", "r", &rf_fully_decode_wav },
|
||||||
|
{ "rf_fully_decode_ogg", "r", &rf_fully_decode_ogg },
|
||||||
|
{ "rf_fully_decode_flac", "r", &rf_fully_decode_flac },
|
||||||
|
{ "rf_fully_decode_mp3", "r", &rf_fully_decode_mp3 },
|
||||||
|
{ "rf_fully_decode_xm", "r", &rf_fully_decode_xm },
|
||||||
|
{ "rf_fully_decode_mod", "r", &rf_fully_decode_mod },
|
||||||
|
{ "rf_fully_decode_audio_from_buffer", "r", &rf_fully_decode_audio_from_buffer },
|
||||||
|
{ "rf_fully_decode_audio_from_file", "r", &rf_fully_decode_audio_from_file },
|
||||||
|
{ "rf_unload_audio_data", "", &rf_unload_audio_data },
|
||||||
|
{ "rf_load_encoded_audio_from_buffer", "r", &rf_load_encoded_audio_from_buffer },
|
||||||
|
{ "rf_load_encoded_audio_from_file", "r", &rf_load_encoded_audio_from_file },
|
||||||
|
{ "rf_audio_play", "", &rf_audio_play },
|
||||||
|
{ "rf_audio_stop", "", &rf_audio_stop },
|
||||||
|
{ "rf_audio_pause", "", &rf_audio_pause },
|
||||||
|
{ "rf_audio_resume", "", &rf_audio_resume },
|
||||||
|
{ "rf_audio_update", "", &rf_audio_update },
|
||||||
|
{ "rf_audio_set_volume", "", &rf_audio_set_volume },
|
||||||
|
{ "rf_audio_set_pitch", "", &rf_audio_set_pitch },
|
||||||
|
{ "rf_audio_time_len", "", &rf_audio_time_len },
|
||||||
|
{ "rf_audio_time_played", "", &rf_audio_time_played },
|
||||||
|
{ "rf_audio_is_playing", "", &rf_audio_is_playing },
|
||||||
|
{ "rf_audio_volume", "", &rf_audio_volume },
|
||||||
|
{ "rf_audio_pitch", "", &rf_audio_pitch },
|
||||||
|
{ "rf_gfx_load_shader", "r", &rf_gfx_load_shader },
|
||||||
|
{ "rf_gfx_unload_shader", "", &rf_gfx_unload_shader },
|
||||||
|
{ "rf_gfx_get_shader_location", "", &rf_gfx_get_shader_location },
|
||||||
|
{ "rf_gfx_set_shader_value", "", &rf_gfx_set_shader_value },
|
||||||
|
{ "rf_gfx_set_shader_value_v", "", &rf_gfx_set_shader_value_v },
|
||||||
|
{ "rf_gfx_set_shader_value_matrix", "", &rf_gfx_set_shader_value_matrix },
|
||||||
|
{ "rf_gfx_set_shader_value_texture", "", &rf_gfx_set_shader_value_texture },
|
||||||
|
{ "rf_gfx_get_matrix_projection", "r", &rf_gfx_get_matrix_projection },
|
||||||
|
{ "rf_gfx_get_matrix_modelview", "r", &rf_gfx_get_matrix_modelview },
|
||||||
|
{ "rf_gfx_set_matrix_projection", "", &rf_gfx_set_matrix_projection },
|
||||||
|
{ "rf_gfx_set_matrix_modelview", "", &rf_gfx_set_matrix_modelview },
|
||||||
|
{ "rf_gfx_blend_mode", "", &rf_gfx_blend_mode },
|
||||||
|
{ "rf_gfx_matrix_mode", "", &rf_gfx_matrix_mode },
|
||||||
|
{ "rf_gfx_push_matrix", "", &rf_gfx_push_matrix },
|
||||||
|
{ "rf_gfx_pop_matrix", "", &rf_gfx_pop_matrix },
|
||||||
|
{ "rf_gfx_load_identity", "", &rf_gfx_load_identity },
|
||||||
|
{ "rf_gfx_translatef", "", &rf_gfx_translatef },
|
||||||
|
{ "rf_gfx_rotatef", "", &rf_gfx_rotatef },
|
||||||
|
{ "rf_gfx_scalef", "", &rf_gfx_scalef },
|
||||||
|
{ "rf_gfx_mult_matrixf", "", &rf_gfx_mult_matrixf },
|
||||||
|
{ "rf_gfx_frustum", "", &rf_gfx_frustum },
|
||||||
|
{ "rf_gfx_ortho", "", &rf_gfx_ortho },
|
||||||
|
{ "rf_gfx_viewport", "", &rf_gfx_viewport },
|
||||||
|
{ "rf_gfx_begin", "", &rf_gfx_begin },
|
||||||
|
{ "rf_gfx_end", "", &rf_gfx_end },
|
||||||
|
{ "rf_gfx_vertex2i", "", &rf_gfx_vertex2i },
|
||||||
|
{ "rf_gfx_vertex2f", "", &rf_gfx_vertex2f },
|
||||||
|
{ "rf_gfx_vertex3f", "", &rf_gfx_vertex3f },
|
||||||
|
{ "rf_gfx_tex_coord2f", "", &rf_gfx_tex_coord2f },
|
||||||
|
{ "rf_gfx_normal3f", "", &rf_gfx_normal3f },
|
||||||
|
{ "rf_gfx_color4ub", "", &rf_gfx_color4ub },
|
||||||
|
{ "rf_gfx_color3f", "", &rf_gfx_color3f },
|
||||||
|
{ "rf_gfx_color4f", "", &rf_gfx_color4f },
|
||||||
|
{ "rf_gfx_enable_texture", "", &rf_gfx_enable_texture },
|
||||||
|
{ "rf_gfx_disable_texture", "", &rf_gfx_disable_texture },
|
||||||
|
{ "rf_gfx_set_texture_wrap", "", &rf_gfx_set_texture_wrap },
|
||||||
|
{ "rf_gfx_set_texture_filter", "", &rf_gfx_set_texture_filter },
|
||||||
|
{ "rf_gfx_enable_render_texture", "", &rf_gfx_enable_render_texture },
|
||||||
|
{ "rf_gfx_disable_render_texture", "", &rf_gfx_disable_render_texture },
|
||||||
|
{ "rf_gfx_enable_depth_test", "", &rf_gfx_enable_depth_test },
|
||||||
|
{ "rf_gfx_disable_depth_test", "", &rf_gfx_disable_depth_test },
|
||||||
|
{ "rf_gfx_enable_backface_culling", "", &rf_gfx_enable_backface_culling },
|
||||||
|
{ "rf_gfx_disable_backface_culling", "", &rf_gfx_disable_backface_culling },
|
||||||
|
{ "rf_gfx_enable_scissor_test", "", &rf_gfx_enable_scissor_test },
|
||||||
|
{ "rf_gfx_disable_scissor_test", "", &rf_gfx_disable_scissor_test },
|
||||||
|
{ "rf_gfx_scissor", "", &rf_gfx_scissor },
|
||||||
|
{ "rf_gfx_enable_wire_mode", "", &rf_gfx_enable_wire_mode },
|
||||||
|
{ "rf_gfx_disable_wire_mode", "", &rf_gfx_disable_wire_mode },
|
||||||
|
{ "rf_gfx_delete_textures", "", &rf_gfx_delete_textures },
|
||||||
|
{ "rf_gfx_delete_render_textures", "", &rf_gfx_delete_render_textures },
|
||||||
|
{ "rf_gfx_delete_shader", "", &rf_gfx_delete_shader },
|
||||||
|
{ "rf_gfx_delete_vertex_arrays", "", &rf_gfx_delete_vertex_arrays },
|
||||||
|
{ "rf_gfx_delete_buffers", "", &rf_gfx_delete_buffers },
|
||||||
|
{ "rf_gfx_clear_color", "", &rf_gfx_clear_color },
|
||||||
|
{ "rf_gfx_clear_screen_buffers", "", &rf_gfx_clear_screen_buffers },
|
||||||
|
{ "rf_gfx_update_buffer", "", &rf_gfx_update_buffer },
|
||||||
|
{ "rf_gfx_load_attrib_buffer", "", &rf_gfx_load_attrib_buffer },
|
||||||
|
{ "rf_gfx_init_vertex_buffer", "", &rf_gfx_init_vertex_buffer },
|
||||||
|
{ "rf_gfx_close", "", &rf_gfx_close },
|
||||||
|
{ "rf_gfx_draw", "", &rf_gfx_draw },
|
||||||
|
{ "rf_gfx_check_buffer_limit", "", &rf_gfx_check_buffer_limit },
|
||||||
|
{ "rf_gfx_set_debug_marker", "", &rf_gfx_set_debug_marker },
|
||||||
|
{ "rf_gfx_load_texture", "", &rf_gfx_load_texture },
|
||||||
|
{ "rf_gfx_load_texture_depth", "", &rf_gfx_load_texture_depth },
|
||||||
|
{ "rf_gfx_load_texture_cubemap", "", &rf_gfx_load_texture_cubemap },
|
||||||
|
{ "rf_gfx_update_texture", "", &rf_gfx_update_texture },
|
||||||
|
{ "rf_gfx_get_internal_texture_formats", "r", &rf_gfx_get_internal_texture_formats },
|
||||||
|
{ "rf_gfx_unload_texture", "", &rf_gfx_unload_texture },
|
||||||
|
{ "rf_gfx_generate_mipmaps", "", &rf_gfx_generate_mipmaps },
|
||||||
|
{ "rf_gfx_read_texture_pixels_to_buffer", "r", &rf_gfx_read_texture_pixels_to_buffer },
|
||||||
|
{ "rf_gfx_read_texture_pixels", "r", &rf_gfx_read_texture_pixels },
|
||||||
|
{ "rf_gfx_read_screen_pixels", "", &rf_gfx_read_screen_pixels },
|
||||||
|
{ "rf_gfx_load_render_texture", "r", &rf_gfx_load_render_texture },
|
||||||
|
{ "rf_gfx_render_texture_attach", "", &rf_gfx_render_texture_attach },
|
||||||
|
{ "rf_gfx_render_texture_complete", "", &rf_gfx_render_texture_complete },
|
||||||
|
{ "rf_gfx_load_mesh", "", &rf_gfx_load_mesh },
|
||||||
|
{ "rf_gfx_update_mesh", "", &rf_gfx_update_mesh },
|
||||||
|
{ "rf_gfx_update_mesh_at", "", &rf_gfx_update_mesh_at },
|
||||||
|
{ "rf_gfx_draw_mesh", "", &rf_gfx_draw_mesh },
|
||||||
|
{ "rf_gfx_unload_mesh", "", &rf_gfx_unload_mesh },
|
||||||
|
{ "rf_create_custom_render_batch_from_buffers", "r", &rf_create_custom_render_batch_from_buffers },
|
||||||
|
{ "rf_create_custom_render_batch", "r", &rf_create_custom_render_batch },
|
||||||
|
{ "rf_create_default_render_batch", "r", &rf_create_default_render_batch },
|
||||||
|
{ "rf_set_active_render_batch", "", &rf_set_active_render_batch },
|
||||||
|
{ "rf_unload_render_batch", "", &rf_unload_render_batch },
|
||||||
|
{ "rf_load_texture_from_file", "r", &rf_load_texture_from_file },
|
||||||
|
{ "rf_load_texture_from_file_data", "r", &rf_load_texture_from_file_data },
|
||||||
|
{ "rf_load_texture_from_image", "r", &rf_load_texture_from_image },
|
||||||
|
{ "rf_load_texture_from_image_with_mipmaps", "r", &rf_load_texture_from_image_with_mipmaps },
|
||||||
|
{ "rf_load_texture_cubemap_from_image", "r", &rf_load_texture_cubemap_from_image },
|
||||||
|
{ "rf_load_render_texture", "r", &rf_load_render_texture },
|
||||||
|
{ "rf_update_texture", "", &rf_update_texture },
|
||||||
|
{ "rf_gen_texture_mipmaps", "", &rf_gen_texture_mipmaps },
|
||||||
|
{ "rf_set_texture_filter", "", &rf_set_texture_filter },
|
||||||
|
{ "rf_set_texture_wrap", "", &rf_set_texture_wrap },
|
||||||
|
{ "rf_unload_texture", "", &rf_unload_texture },
|
||||||
|
{ "rf_unload_render_texture", "", &rf_unload_render_texture },
|
||||||
|
{ "rf_gen_texture_cubemap", "r", &rf_gen_texture_cubemap },
|
||||||
|
{ "rf_gen_texture_irradiance", "r", &rf_gen_texture_irradiance },
|
||||||
|
{ "rf_gen_texture_prefilter", "r", &rf_gen_texture_prefilter },
|
||||||
|
{ "rf_gen_texture_brdf", "r", &rf_gen_texture_brdf },
|
||||||
|
{ "rf_parse_ttf_font", "r", &rf_parse_ttf_font },
|
||||||
|
{ "rf_compute_ttf_font_glyph_metrics", "", &rf_compute_ttf_font_glyph_metrics },
|
||||||
|
{ "rf_compute_ttf_font_atlas_width", "", &rf_compute_ttf_font_atlas_width },
|
||||||
|
{ "rf_generate_ttf_font_atlas", "r", &rf_generate_ttf_font_atlas },
|
||||||
|
{ "rf_ttf_font_from_atlas", "r", &rf_ttf_font_from_atlas },
|
||||||
|
{ "rf_load_ttf_font_from_data", "r", &rf_load_ttf_font_from_data },
|
||||||
|
{ "rf_load_ttf_font_from_file", "r", &rf_load_ttf_font_from_file },
|
||||||
|
{ "rf_compute_glyph_metrics_from_image", "", &rf_compute_glyph_metrics_from_image },
|
||||||
|
{ "rf_load_image_font_from_data", "r", &rf_load_image_font_from_data },
|
||||||
|
{ "rf_load_image_font", "r", &rf_load_image_font },
|
||||||
|
{ "rf_load_image_font_from_file", "r", &rf_load_image_font_from_file },
|
||||||
|
{ "rf_unload_font", "", &rf_unload_font },
|
||||||
|
{ "rf_get_glyph_index", "r", &rf_get_glyph_index },
|
||||||
|
{ "rf_font_height", "", &rf_font_height },
|
||||||
|
{ "rf_measure_text", "r", &rf_measure_text },
|
||||||
|
{ "rf_measure_text_rec", "r", &rf_measure_text_rec },
|
||||||
|
{ "rf_measure_string", "r", &rf_measure_string },
|
||||||
|
{ "rf_measure_string_rec", "r", &rf_measure_string_rec },
|
||||||
|
{ "rf_clear", "", &rf_clear },
|
||||||
|
{ "rf_begin", "", &rf_begin },
|
||||||
|
{ "rf_end", "", &rf_end },
|
||||||
|
{ "rf_begin_2d", "", &rf_begin_2d },
|
||||||
|
{ "rf_end_2d", "", &rf_end_2d },
|
||||||
|
{ "rf_begin_3d", "", &rf_begin_3d },
|
||||||
|
{ "rf_end_3d", "", &rf_end_3d },
|
||||||
|
{ "rf_begin_render_to_texture", "", &rf_begin_render_to_texture },
|
||||||
|
{ "rf_end_render_to_texture", "", &rf_end_render_to_texture },
|
||||||
|
{ "rf_begin_scissor_mode", "", &rf_begin_scissor_mode },
|
||||||
|
{ "rf_end_scissor_mode", "", &rf_end_scissor_mode },
|
||||||
|
{ "rf_begin_shader", "", &rf_begin_shader },
|
||||||
|
{ "rf_end_shader", "", &rf_end_shader },
|
||||||
|
{ "rf_begin_blend_mode", "", &rf_begin_blend_mode },
|
||||||
|
{ "rf_end_blend_mode", "", &rf_end_blend_mode },
|
||||||
|
{ "rf_draw_pixel", "", &rf_draw_pixel },
|
||||||
|
{ "rf_draw_pixel_v", "", &rf_draw_pixel_v },
|
||||||
|
{ "rf_draw_line", "", &rf_draw_line },
|
||||||
|
{ "rf_draw_line_v", "", &rf_draw_line_v },
|
||||||
|
{ "rf_draw_line_ex", "", &rf_draw_line_ex },
|
||||||
|
{ "rf_draw_line_bezier", "", &rf_draw_line_bezier },
|
||||||
|
{ "rf_draw_line_strip", "", &rf_draw_line_strip },
|
||||||
|
{ "rf_draw_circle", "", &rf_draw_circle },
|
||||||
|
{ "rf_draw_circle_v", "", &rf_draw_circle_v },
|
||||||
|
{ "rf_draw_circle_sector", "", &rf_draw_circle_sector },
|
||||||
|
{ "rf_draw_circle_sector_lines", "", &rf_draw_circle_sector_lines },
|
||||||
|
{ "rf_draw_circle_gradient", "", &rf_draw_circle_gradient },
|
||||||
|
{ "rf_draw_circle_lines", "", &rf_draw_circle_lines },
|
||||||
|
{ "rf_draw_ring", "", &rf_draw_ring },
|
||||||
|
{ "rf_draw_ring_lines", "", &rf_draw_ring_lines },
|
||||||
|
{ "rf_draw_rectangle", "", &rf_draw_rectangle },
|
||||||
|
{ "rf_draw_rectangle_v", "", &rf_draw_rectangle_v },
|
||||||
|
{ "rf_draw_rectangle_rec", "", &rf_draw_rectangle_rec },
|
||||||
|
{ "rf_draw_rectangle_pro", "", &rf_draw_rectangle_pro },
|
||||||
|
{ "rf_draw_rectangle_gradient_v", "", &rf_draw_rectangle_gradient_v },
|
||||||
|
{ "rf_draw_rectangle_gradient_h", "", &rf_draw_rectangle_gradient_h },
|
||||||
|
{ "rf_draw_rectangle_gradient", "", &rf_draw_rectangle_gradient },
|
||||||
|
{ "rf_draw_rectangle_outline", "", &rf_draw_rectangle_outline },
|
||||||
|
{ "rf_draw_rectangle_rounded", "", &rf_draw_rectangle_rounded },
|
||||||
|
{ "rf_draw_rectangle_rounded_lines", "", &rf_draw_rectangle_rounded_lines },
|
||||||
|
{ "rf_draw_triangle", "", &rf_draw_triangle },
|
||||||
|
{ "rf_draw_triangle_lines", "", &rf_draw_triangle_lines },
|
||||||
|
{ "rf_draw_triangle_fan", "", &rf_draw_triangle_fan },
|
||||||
|
{ "rf_draw_triangle_strip", "", &rf_draw_triangle_strip },
|
||||||
|
{ "rf_draw_poly", "", &rf_draw_poly },
|
||||||
|
{ "rf_draw_texture", "", &rf_draw_texture },
|
||||||
|
{ "rf_draw_texture_ex", "", &rf_draw_texture_ex },
|
||||||
|
{ "rf_draw_texture_region", "", &rf_draw_texture_region },
|
||||||
|
{ "rf_draw_texture_npatch", "", &rf_draw_texture_npatch },
|
||||||
|
{ "rf_draw_string", "", &rf_draw_string },
|
||||||
|
{ "rf_draw_string_ex", "", &rf_draw_string_ex },
|
||||||
|
{ "rf_draw_string_wrap", "", &rf_draw_string_wrap },
|
||||||
|
{ "rf_draw_string_rec", "", &rf_draw_string_rec },
|
||||||
|
{ "rf_draw_text", "", &rf_draw_text },
|
||||||
|
{ "rf_draw_text_ex", "", &rf_draw_text_ex },
|
||||||
|
{ "rf_draw_text_wrap", "", &rf_draw_text_wrap },
|
||||||
|
{ "rf_draw_text_rec", "", &rf_draw_text_rec },
|
||||||
|
{ "rf_draw_line3d", "", &rf_draw_line3d },
|
||||||
|
{ "rf_draw_circle3d", "", &rf_draw_circle3d },
|
||||||
|
{ "rf_draw_cube", "", &rf_draw_cube },
|
||||||
|
{ "rf_draw_cube_wires", "", &rf_draw_cube_wires },
|
||||||
|
{ "rf_draw_cube_texture", "", &rf_draw_cube_texture },
|
||||||
|
{ "rf_draw_sphere", "", &rf_draw_sphere },
|
||||||
|
{ "rf_draw_sphere_ex", "", &rf_draw_sphere_ex },
|
||||||
|
{ "rf_draw_sphere_wires", "", &rf_draw_sphere_wires },
|
||||||
|
{ "rf_draw_cylinder", "", &rf_draw_cylinder },
|
||||||
|
{ "rf_draw_cylinder_wires", "", &rf_draw_cylinder_wires },
|
||||||
|
{ "rf_draw_plane", "", &rf_draw_plane },
|
||||||
|
{ "rf_draw_ray", "", &rf_draw_ray },
|
||||||
|
{ "rf_draw_grid", "", &rf_draw_grid },
|
||||||
|
{ "rf_draw_gizmo", "", &rf_draw_gizmo },
|
||||||
|
{ "rf_draw_model", "", &rf_draw_model },
|
||||||
|
{ "rf_draw_model_ex", "", &rf_draw_model_ex },
|
||||||
|
{ "rf_draw_model_wires", "", &rf_draw_model_wires },
|
||||||
|
{ "rf_draw_bounding_box", "", &rf_draw_bounding_box },
|
||||||
|
{ "rf_draw_billboard", "", &rf_draw_billboard },
|
||||||
|
{ "rf_draw_billboard_rec", "", &rf_draw_billboard_rec },
|
||||||
|
{ "rf_mesh_bounding_box", "r", &rf_mesh_bounding_box },
|
||||||
|
{ "rf_mesh_compute_tangents", "", &rf_mesh_compute_tangents },
|
||||||
|
{ "rf_mesh_compute_binormals", "", &rf_mesh_compute_binormals },
|
||||||
|
{ "rf_unload_mesh", "", &rf_unload_mesh },
|
||||||
|
{ "rf_load_model", "r", &rf_load_model },
|
||||||
|
{ "rf_load_model_from_obj", "r", &rf_load_model_from_obj },
|
||||||
|
{ "rf_load_model_from_iqm", "r", &rf_load_model_from_iqm },
|
||||||
|
{ "rf_load_model_from_gltf", "r", &rf_load_model_from_gltf },
|
||||||
|
{ "rf_load_model_from_mesh", "r", &rf_load_model_from_mesh },
|
||||||
|
{ "rf_unload_model", "", &rf_unload_model },
|
||||||
|
{ "rf_load_materials_from_mtl", "r", &rf_load_materials_from_mtl },
|
||||||
|
{ "rf_set_material_texture", "", &rf_set_material_texture },
|
||||||
|
{ "rf_set_model_mesh_material", "", &rf_set_model_mesh_material },
|
||||||
|
{ "rf_unload_material", "", &rf_unload_material },
|
||||||
|
{ "rf_load_model_animations_from_iqm_file", "r", &rf_load_model_animations_from_iqm_file },
|
||||||
|
{ "rf_load_model_animations_from_iqm", "r", &rf_load_model_animations_from_iqm },
|
||||||
|
{ "rf_update_model_animation", "", &rf_update_model_animation },
|
||||||
|
{ "rf_is_model_animation_valid", "", &rf_is_model_animation_valid },
|
||||||
|
{ "rf_unload_model_animation", "", &rf_unload_model_animation },
|
||||||
|
{ "rf_gen_mesh_cube", "r", &rf_gen_mesh_cube },
|
||||||
|
{ "rf_gen_mesh_poly", "r", &rf_gen_mesh_poly },
|
||||||
|
{ "rf_gen_mesh_plane", "r", &rf_gen_mesh_plane },
|
||||||
|
{ "rf_gen_mesh_sphere", "r", &rf_gen_mesh_sphere },
|
||||||
|
{ "rf_gen_mesh_hemi_sphere", "r", &rf_gen_mesh_hemi_sphere },
|
||||||
|
{ "rf_gen_mesh_cylinder", "r", &rf_gen_mesh_cylinder },
|
||||||
|
{ "rf_gen_mesh_torus", "r", &rf_gen_mesh_torus },
|
||||||
|
{ "rf_gen_mesh_knot", "r", &rf_gen_mesh_knot },
|
||||||
|
{ "rf_gen_mesh_heightmap", "r", &rf_gen_mesh_heightmap },
|
||||||
|
{ "rf_gen_mesh_cubicmap", "r", &rf_gen_mesh_cubicmap },
|
||||||
|
{ "rf_init_context", "", &rf_init_context },
|
||||||
|
{ "rf_init_gfx", "", &rf_init_gfx },
|
||||||
|
{ "rf_init_audio", "", &rf_init_audio },
|
||||||
|
{ "rf_load_default_material", "r", &rf_load_default_material },
|
||||||
|
{ "rf_load_default_shader", "r", &rf_load_default_shader },
|
||||||
|
{ "rf_get_current_render_batch", "r", &rf_get_current_render_batch },
|
||||||
|
{ "rf_get_default_font", "r", &rf_get_default_font },
|
||||||
|
{ "rf_get_default_shader", "r", &rf_get_default_shader },
|
||||||
|
{ "rf_get_default_texture", "r", &rf_get_default_texture },
|
||||||
|
{ "rf_get_context", "r", &rf_get_context },
|
||||||
|
{ "rf_get_screen_data", "r", &rf_get_screen_data },
|
||||||
|
{ "rf_set_global_context_pointer", "", &rf_set_global_context_pointer },
|
||||||
|
{ "rf_set_viewport", "", &rf_set_viewport },
|
||||||
|
{ "rf_set_shapes_texture", "", &rf_set_shapes_texture },
|
||||||
|
{ "rf_load_default_material_ez", "r", &rf_load_default_material_ez },
|
||||||
|
{ "rf_get_screen_data_ez", "r", &rf_get_screen_data_ez },
|
||||||
|
{ "rf_decode_base64_ez", "r", &rf_decode_base64_ez },
|
||||||
|
{ "rf_gfx_read_texture_pixels_ez", "r", &rf_gfx_read_texture_pixels_ez },
|
||||||
|
{ "rf_image_pixels_to_rgba32_ez", "r", &rf_image_pixels_to_rgba32_ez },
|
||||||
|
{ "rf_image_compute_pixels_to_normalized_ez", "r", &rf_image_compute_pixels_to_normalized_ez },
|
||||||
|
{ "rf_image_extract_palette_ez", "r", &rf_image_extract_palette_ez },
|
||||||
|
{ "rf_load_image_from_file_data_ez", "r", &rf_load_image_from_file_data_ez },
|
||||||
|
{ "rf_load_image_from_hdr_file_data_ez", "r", &rf_load_image_from_hdr_file_data_ez },
|
||||||
|
{ "rf_load_image_from_file_ez", "r", &rf_load_image_from_file_ez },
|
||||||
|
{ "rf_unload_image_ez", "", &rf_unload_image_ez },
|
||||||
|
{ "rf_image_copy_ez", "r", &rf_image_copy_ez },
|
||||||
|
{ "rf_image_crop_ez", "r", &rf_image_crop_ez },
|
||||||
|
{ "rf_image_resize_ez", "r", &rf_image_resize_ez },
|
||||||
|
{ "rf_image_resize_nn_ez", "r", &rf_image_resize_nn_ez },
|
||||||
|
{ "rf_image_format_ez", "r", &rf_image_format_ez },
|
||||||
|
{ "rf_image_alpha_clear_ez", "r", &rf_image_alpha_clear_ez },
|
||||||
|
{ "rf_image_alpha_premultiply_ez", "r", &rf_image_alpha_premultiply_ez },
|
||||||
|
{ "rf_image_alpha_crop_ez", "r", &rf_image_alpha_crop_ez },
|
||||||
|
{ "rf_image_dither_ez", "r", &rf_image_dither_ez },
|
||||||
|
{ "rf_image_flip_vertical_ez", "r", &rf_image_flip_vertical_ez },
|
||||||
|
{ "rf_image_flip_horizontal_ez", "r", &rf_image_flip_horizontal_ez },
|
||||||
|
{ "rf_get_seed_for_cellular_image_ez", "r", &rf_get_seed_for_cellular_image_ez },
|
||||||
|
{ "rf_gen_image_color_ez", "r", &rf_gen_image_color_ez },
|
||||||
|
{ "rf_gen_image_gradient_v_ez", "r", &rf_gen_image_gradient_v_ez },
|
||||||
|
{ "rf_gen_image_gradient_h_ez", "r", &rf_gen_image_gradient_h_ez },
|
||||||
|
{ "rf_gen_image_gradient_radial_ez", "r", &rf_gen_image_gradient_radial_ez },
|
||||||
|
{ "rf_gen_image_checked_ez", "r", &rf_gen_image_checked_ez },
|
||||||
|
{ "rf_gen_image_white_noise_ez", "r", &rf_gen_image_white_noise_ez },
|
||||||
|
{ "rf_gen_image_perlin_noise_ez", "r", &rf_gen_image_perlin_noise_ez },
|
||||||
|
{ "rf_gen_image_cellular_ez", "r", &rf_gen_image_cellular_ez },
|
||||||
|
{ "rf_image_gen_mipmaps_ez", "r", &rf_image_gen_mipmaps_ez },
|
||||||
|
{ "rf_unload_mipmaps_image_ez", "", &rf_unload_mipmaps_image_ez },
|
||||||
|
{ "rf_load_dds_image_ez", "r", &rf_load_dds_image_ez },
|
||||||
|
{ "rf_load_dds_image_from_file_ez", "r", &rf_load_dds_image_from_file_ez },
|
||||||
|
{ "rf_load_pkm_image_ez", "r", &rf_load_pkm_image_ez },
|
||||||
|
{ "rf_load_pkm_image_from_file_ez", "r", &rf_load_pkm_image_from_file_ez },
|
||||||
|
{ "rf_load_ktx_image_ez", "r", &rf_load_ktx_image_ez },
|
||||||
|
{ "rf_load_ktx_image_from_file_ez", "r", &rf_load_ktx_image_from_file_ez },
|
||||||
|
{ "rf_load_animated_gif_ez", "r", &rf_load_animated_gif_ez },
|
||||||
|
{ "rf_load_animated_gif_file_ez", "r", &rf_load_animated_gif_file_ez },
|
||||||
|
{ "rf_unload_gif_ez", "", &rf_unload_gif_ez },
|
||||||
|
{ "rf_load_texture_from_file_ez", "r", &rf_load_texture_from_file_ez },
|
||||||
|
{ "rf_load_texture_from_file_data_ez", "r", &rf_load_texture_from_file_data_ez },
|
||||||
|
{ "rf_load_texture_cubemap_from_image_ez", "r", &rf_load_texture_cubemap_from_image_ez },
|
||||||
|
{ "rf_load_ttf_font_from_data_ez", "r", &rf_load_ttf_font_from_data_ez },
|
||||||
|
{ "rf_load_ttf_font_from_file_ez", "r", &rf_load_ttf_font_from_file_ez },
|
||||||
|
{ "rf_load_image_font_ez", "r", &rf_load_image_font_ez },
|
||||||
|
{ "rf_load_image_font_from_file_ez", "r", &rf_load_image_font_from_file_ez },
|
||||||
|
{ "rf_unload_font_ez", "", &rf_unload_font_ez },
|
||||||
|
{ "rf_decode_utf8_ez", "r", &rf_decode_utf8_ez },
|
||||||
|
{ "rf_image_draw_ez", "", &rf_image_draw_ez },
|
||||||
|
{ "rf_image_draw_rectangle_ez", "", &rf_image_draw_rectangle_ez },
|
||||||
|
{ "rf_image_draw_rectangle_lines_ez", "", &rf_image_draw_rectangle_lines_ez },
|
||||||
|
{ "rf_mesh_compute_tangents_ez", "", &rf_mesh_compute_tangents_ez },
|
||||||
|
{ "rf_unload_mesh_ez", "", &rf_unload_mesh_ez },
|
||||||
|
{ "rf_load_model_ez", "r", &rf_load_model_ez },
|
||||||
|
{ "rf_load_model_from_obj_ez", "r", &rf_load_model_from_obj_ez },
|
||||||
|
{ "rf_load_model_from_iqm_ez", "r", &rf_load_model_from_iqm_ez },
|
||||||
|
{ "rf_load_model_from_gltf_ez", "r", &rf_load_model_from_gltf_ez },
|
||||||
|
{ "rf_load_model_from_mesh_ez", "r", &rf_load_model_from_mesh_ez },
|
||||||
|
{ "rf_unload_model_ez", "", &rf_unload_model_ez },
|
||||||
|
{ "rf_load_materials_from_mtl_ez", "r", &rf_load_materials_from_mtl_ez },
|
||||||
|
{ "rf_unload_material_ez", "", &rf_unload_material_ez },
|
||||||
|
{ "rf_load_model_animations_from_iqm_file_ez", "r", &rf_load_model_animations_from_iqm_file_ez },
|
||||||
|
{ "rf_load_model_animations_from_iqm_ez", "r", &rf_load_model_animations_from_iqm_ez },
|
||||||
|
{ "rf_unload_model_animation_ez", "", &rf_unload_model_animation_ez },
|
||||||
|
{ "rf_gen_mesh_cube_ez", "r", &rf_gen_mesh_cube_ez },
|
||||||
|
{ "rf_gen_mesh_poly_ez", "r", &rf_gen_mesh_poly_ez },
|
||||||
|
{ "rf_gen_mesh_plane_ez", "r", &rf_gen_mesh_plane_ez },
|
||||||
|
{ "rf_gen_mesh_sphere_ez", "r", &rf_gen_mesh_sphere_ez },
|
||||||
|
{ "rf_gen_mesh_hemi_sphere_ez", "r", &rf_gen_mesh_hemi_sphere_ez },
|
||||||
|
{ "rf_gen_mesh_cylinder_ez", "r", &rf_gen_mesh_cylinder_ez },
|
||||||
|
{ "rf_gen_mesh_torus_ez", "r", &rf_gen_mesh_torus_ez },
|
||||||
|
{ "rf_gen_mesh_knot_ez", "r", &rf_gen_mesh_knot_ez },
|
||||||
|
{ "rf_gen_mesh_heightmap_ez", "r", &rf_gen_mesh_heightmap_ez },
|
||||||
|
{ "rf_gen_mesh_cubicmap_ez", "r", &rf_gen_mesh_cubicmap_ez },
|
||||||
|
{ NULL, NULL, NULL },
|
||||||
|
};
|
2
raygui
2
raygui
@ -1 +1 @@
|
|||||||
Subproject commit 865bb293764073c01e74314ef647464f1f10fd96
|
Subproject commit 07b30c30af7309b396cfa458d30f54b38ef78808
|
1
raylib
1
raylib
@ -1 +0,0 @@
|
|||||||
Subproject commit 559ffc633164c30824065a63324ba08efa651ee6
|
|
@ -14,43 +14,26 @@
|
|||||||
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
]]
|
]]
|
||||||
|
|
||||||
|
-- math metamethods
|
||||||
local new = ffi.new
|
local new = ffi.new
|
||||||
|
|
||||||
-- Load*() wrappers.
|
ffi.metatype("rf_vec2", {
|
||||||
if raylua.loadfile then
|
|
||||||
local LoadMusicStream = rl.LoadMusicStream
|
|
||||||
function rl.LoadMusicStream(path)
|
|
||||||
local f, err = raylua.loadfile(path)
|
|
||||||
|
|
||||||
if f then
|
|
||||||
local ext = "." .. path:gsub(".+%.", "")
|
|
||||||
|
|
||||||
return rl.LoadMusicStreamFromMemory(ext, ffi.cast("void *", f), #f)
|
|
||||||
else
|
|
||||||
print(("RAYLUA: %s"):format(err))
|
|
||||||
return LoadMusicStream(path)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- math metamethods
|
|
||||||
ffi.metatype("Vector2", {
|
|
||||||
__add = function (a, b)
|
__add = function (a, b)
|
||||||
if ffi.istype("Vector2", b) then
|
if ffi.istype("rf_vec2", b) then
|
||||||
return new("Vector2", a.x + b.x, a.y + b.y)
|
return new("rf_vec2", a.x + b.x, a.y + b.y)
|
||||||
else
|
else
|
||||||
error "Invalid operation."
|
error "Invalid operation."
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
__sub = function (a, b)
|
__sub = function (a, b)
|
||||||
if ffi.istype("Vector2", b) then
|
if ffi.istype("rf_vec2", b) then
|
||||||
return new("Vector2", a.x - b.x, a.y - b.y)
|
return new("rf_vec2", a.x - b.x, a.y - b.y)
|
||||||
else
|
else
|
||||||
error "Invalid operation."
|
error "Invalid operation."
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
__unm = function (a)
|
__unm = function (a)
|
||||||
return new("Vector2", -a.x, -a.y)
|
return new("rf_vec2", -a.x, -a.y)
|
||||||
end,
|
end,
|
||||||
__len = function (a)
|
__len = function (a)
|
||||||
return math.sqrt(a.x * a.x + a.y * a.y)
|
return math.sqrt(a.x * a.x + a.y * a.y)
|
||||||
@ -61,43 +44,43 @@ ffi.metatype("Vector2", {
|
|||||||
a, b = b, a
|
a, b = b, a
|
||||||
end
|
end
|
||||||
|
|
||||||
if ffi.istype("Vector2", b) then -- dot product
|
if ffi.istype("rf_vec2", b) then -- dot product
|
||||||
return a.x * b.x + a.y * b.y
|
return a.x * b.x + a.y * b.y
|
||||||
elseif type(b) == "number" then
|
elseif type(b) == "number" then
|
||||||
return new("Vector2", a.x * b, a.y * b)
|
return new("rf_vec2", a.x * b, a.y * b)
|
||||||
else
|
else
|
||||||
error "Invalid operation."
|
error "Invalid operation."
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
__div = function (a, b)
|
__div = function (a, b)
|
||||||
if type(b) == "number" then
|
if type(b) == "number" then
|
||||||
return new("Vector2", a.x / b, a.y / b)
|
return new("rf_vec2", a.x / b, a.y / b)
|
||||||
else
|
else
|
||||||
error "Invalid operation"
|
error "Invalid operation"
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
__tostring = function (a)
|
__tostring = function (a)
|
||||||
return string.format("Vector2: (%g %g)", a.x, a.y)
|
return string.format("rf_vec2: (%g %g)", a.x, a.y)
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
ffi.metatype("Vector3", {
|
ffi.metatype("rf_vec3", {
|
||||||
__add = function (a, b)
|
__add = function (a, b)
|
||||||
if ffi.istype("Vector3", b) then
|
if ffi.istype("rf_vec3", b) then
|
||||||
return new("Vector3", a.x + b.x, a.y + b.y, a.z + b.z)
|
return new("rf_vec3", a.x + b.x, a.y + b.y, a.z + b.z)
|
||||||
else
|
else
|
||||||
error "Invalid operation."
|
error "Invalid operation."
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
__sub = function (a, b)
|
__sub = function (a, b)
|
||||||
if ffi.istype("Vector3", b) then
|
if ffi.istype("rf_vec3", b) then
|
||||||
return new("Vector3", a.x - b.x, a.y - b.y, a.z - b.z)
|
return new("rf_vec3", a.x - b.x, a.y - b.y, a.z - b.z)
|
||||||
else
|
else
|
||||||
error "Invalid operation."
|
error "Invalid operation."
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
__unm = function (a)
|
__unm = function (a)
|
||||||
return new("Vector3", -a.x, -a.y, -a.z)
|
return new("rf_vec3", -a.x, -a.y, -a.z)
|
||||||
end,
|
end,
|
||||||
__len = function (a)
|
__len = function (a)
|
||||||
return math.sqrt(a.x * a.x + a.y * a.y + a.z * a.z)
|
return math.sqrt(a.x * a.x + a.y * a.y + a.z * a.z)
|
||||||
@ -108,23 +91,23 @@ ffi.metatype("Vector3", {
|
|||||||
a, b = b, a
|
a, b = b, a
|
||||||
end
|
end
|
||||||
|
|
||||||
if ffi.istype("Vector3", b) then -- dot product
|
if ffi.istype("rf_vec3", b) then -- dot product
|
||||||
return a.x * b.x + a.y * b.y + a.z * b.z
|
return a.x * b.x + a.y * b.y + a.z * b.z
|
||||||
elseif type(b) == "number" then
|
elseif type(b) == "number" then
|
||||||
return new("Vector3", a.x * b, a.y * b, a.z * b)
|
return new("rf_vec3", a.x * b, a.y * b, a.z * b)
|
||||||
else
|
else
|
||||||
error "Invalid operation."
|
error "Invalid operation."
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
__div = function (a, b)
|
__div = function (a, b)
|
||||||
if type(b) == "number" then
|
if type(b) == "number" then
|
||||||
return new("Vector3", a.x / b, a.y / b, a.z / b)
|
return new("rf_vec3", a.x / b, a.y / b, a.z / b)
|
||||||
else
|
else
|
||||||
error "Invalid operation"
|
error "Invalid operation"
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
__tostring = function (a)
|
__tostring = function (a)
|
||||||
return string.format("Vector3: (%g %g %g)", a.x, a.y, a.z)
|
return string.format("rf_vec3: (%g %g %g)", a.x, a.y, a.z)
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
41616
src/lib/rayfork.c
Normal file
41616
src/lib/rayfork.c
Normal file
File diff suppressed because it is too large
Load Diff
2662
src/lib/rayfork.h
Normal file
2662
src/lib/rayfork.h
Normal file
File diff suppressed because it is too large
Load Diff
2210
src/raylib.lua
2210
src/raylib.lua
File diff suppressed because it is too large
Load Diff
30
src/raylua.c
30
src/raylua.c
@ -20,28 +20,13 @@
|
|||||||
#include <lauxlib.h>
|
#include <lauxlib.h>
|
||||||
#include <lualib.h>
|
#include <lualib.h>
|
||||||
|
|
||||||
#include <raylib.h>
|
#include "lib/rayfork.h"
|
||||||
#include <rlgl.h>
|
|
||||||
|
|
||||||
#include <raymath.h>
|
|
||||||
#include <extras/easings.h>
|
|
||||||
#include <rgestures.h>
|
|
||||||
|
|
||||||
#define RAYGUI_IMPLEMENTATION
|
|
||||||
#define RAYGUI_STATIC
|
|
||||||
#include <raygui.h>
|
|
||||||
|
|
||||||
#define PHYSAC_IMPLEMENTATION
|
|
||||||
#include <extras/physac.h>
|
|
||||||
|
|
||||||
#include "autogen/bind.c"
|
#include "autogen/bind.c"
|
||||||
#include "autogen/boot.c"
|
#include "autogen/boot.c"
|
||||||
|
|
||||||
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)
|
||||||
{
|
{
|
||||||
@ -60,28 +45,19 @@ void raylua_boot(lua_State *L, lua_CFunction loadfile, lua_CFunction listfiles,
|
|||||||
}
|
}
|
||||||
|
|
||||||
lua_pushstring(L, "bind_entries");
|
lua_pushstring(L, "bind_entries");
|
||||||
lua_pushlightuserdata(L, raylua_entries);
|
lua_pushlightuserdata(L, rayfork_entries);
|
||||||
lua_settable(L, -3);
|
lua_settable(L, -3);
|
||||||
|
|
||||||
lua_pushstring(L, "isrepl");
|
lua_pushstring(L, "isrepl");
|
||||||
lua_pushboolean(L, repl);
|
lua_pushboolean(L, repl);
|
||||||
lua_settable(L, -3);
|
lua_settable(L, -3);
|
||||||
|
|
||||||
lua_pushstring(L, "raylib_version");
|
|
||||||
lua_pushstring(L, RAYLIB_VERSION);
|
|
||||||
lua_settable(L, -3);
|
|
||||||
|
|
||||||
lua_setglobal(L, "raylua");
|
lua_setglobal(L, "raylua");
|
||||||
|
|
||||||
if (luaL_dostring(L, raylua_boot_lua)) {
|
if (luaL_dostring(L, raylua_boot_lua))
|
||||||
fputs(luaL_checkstring(L, -1), stderr);
|
fputs(luaL_checkstring(L, -1), stderr);
|
||||||
fputc('\n', stderr);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#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);
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
local load = loadstring
|
local load = loadstring
|
||||||
|
|
||||||
raylua.version = "v4.0b"
|
raylua.version = "v0.9 rayfork"
|
||||||
|
|
||||||
function raylua.repl()
|
function raylua.repl()
|
||||||
print("> raylua " .. raylua.version .. " <")
|
print("> raylua " .. raylua.version .. " <")
|
||||||
@ -45,10 +45,6 @@ end
|
|||||||
|
|
||||||
package.path = "?.lua;?/init.lua"
|
package.path = "?.lua;?/init.lua"
|
||||||
|
|
||||||
if os.getenv "LUA_PATH" then
|
|
||||||
package.path = package.path .. ";" .. os.getenv "LUA_PATH"
|
|
||||||
end
|
|
||||||
|
|
||||||
if raylua.loadfile then
|
if raylua.loadfile then
|
||||||
-- Change the second loader to load files using raylua.loadfile
|
-- Change the second loader to load files using raylua.loadfile
|
||||||
package.loaders[2] = function (name)
|
package.loaders[2] = function (name)
|
||||||
@ -69,37 +65,16 @@ if raylua.loadfile then
|
|||||||
end
|
end
|
||||||
|
|
||||||
print "RAYLUA: Load main.lua from payload."
|
print "RAYLUA: Load main.lua from payload."
|
||||||
|
require "main"
|
||||||
local f, err = load(raylua.loadfile "main.lua", "main.lua")
|
|
||||||
if f then
|
|
||||||
local status, f_err = xpcall(f, debug.traceback)
|
|
||||||
|
|
||||||
if not status then
|
|
||||||
print(f_err)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
print(err)
|
|
||||||
end
|
|
||||||
|
|
||||||
if not raylua.isrepl then
|
if not raylua.isrepl then
|
||||||
|
-- Keep launching the repl even with `loadfile` defined.
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Keep launching the repl even with `loadfile` defined.
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if arg and arg[1] then
|
if arg and arg[1] then
|
||||||
local f, err = loadfile(arg[1])
|
dofile(arg[1])
|
||||||
if f then
|
|
||||||
local status, f_err = xpcall(f, debug.traceback)
|
|
||||||
|
|
||||||
if not status then
|
|
||||||
print(f_err)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
print(err)
|
|
||||||
end
|
|
||||||
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -150,7 +150,7 @@ static int list_dir(lua_State *L)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
struct dirent *entry;
|
struct dirent *entry;
|
||||||
size_t count = 1;
|
size_t count = 0;
|
||||||
|
|
||||||
lua_newtable(L);
|
lua_newtable(L);
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ if t == "directory" then
|
|||||||
|
|
||||||
local function add_dir(root, dir)
|
local function add_dir(root, dir)
|
||||||
for i,file in ipairs(list_dir(path_concat(root, dir))) do
|
for i,file in ipairs(list_dir(path_concat(root, dir))) do
|
||||||
if file ~= ".." and file ~= "." then
|
if file ~= ".." then
|
||||||
local partial_file_path, full_file_path
|
local partial_file_path, full_file_path
|
||||||
|
|
||||||
if dir then
|
if dir then
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#include <lualib.h>
|
#include <lualib.h>
|
||||||
#include <lauxlib.h>
|
#include <lauxlib.h>
|
||||||
|
|
||||||
#include <raylib.h>
|
#include "lib/rayfork.h"
|
||||||
|
|
||||||
#include "raylua.h"
|
#include "raylua.h"
|
||||||
#include "lib/miniz.h"
|
#include "lib/miniz.h"
|
||||||
@ -62,12 +62,7 @@ int raylua_loadfile(lua_State *L)
|
|||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mz_zip_reader_extract_to_mem(&zip_file, index, buffer, size, 0)) {
|
mz_zip_reader_extract_to_mem(&zip_file, index, buffer, size, 0);
|
||||||
free(buffer);
|
|
||||||
lua_pushnil(L);
|
|
||||||
lua_pushfstring(L, "%s: Can't extract file.", path);
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
lua_pushlstring(L, buffer, size);
|
lua_pushlstring(L, buffer, size);
|
||||||
free(buffer);
|
free(buffer);
|
||||||
@ -97,28 +92,24 @@ unsigned char *raylua_loadFileData(const char *path, unsigned int *out_size)
|
|||||||
{
|
{
|
||||||
int index = mz_zip_reader_locate_file(&zip_file, path, NULL, 0);
|
int index = mz_zip_reader_locate_file(&zip_file, path, NULL, 0);
|
||||||
if (index == -1) {
|
if (index == -1) {
|
||||||
printf("RAYLUA: WARN: File not found in payload. '%s'\n", path);
|
printf("RAYLUA: WARN: File not found in payload : '%s'", path);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
mz_zip_archive_file_stat stat;
|
mz_zip_archive_file_stat stat;
|
||||||
if (!mz_zip_reader_file_stat(&zip_file, index, &stat)) {
|
if (!mz_zip_reader_file_stat(&zip_file, index, &stat)) {
|
||||||
printf("RAYLUA: WARN: Can't get file information in payload. '%s'\n", path);
|
printf("RAYLUA: WARN: Can't get file information of '%s' in payload.", path);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t size = stat.m_uncomp_size;
|
size_t size = stat.m_uncomp_size;
|
||||||
unsigned char *buffer = RL_MALLOC(size);
|
unsigned char *buffer = malloc(size);
|
||||||
if (buffer == NULL) {
|
if (buffer == NULL) {
|
||||||
printf("RAYLUA: WARN: Can't allocate file buffer. '%s'\n", path);
|
printf("RAYLUA: WARN: Can't allocate file buffer for '%s'.", path);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mz_zip_reader_extract_to_mem(&zip_file, index, buffer, size, 0)) {
|
mz_zip_reader_extract_to_mem(&zip_file, index, buffer, size, 0);
|
||||||
free(buffer);
|
|
||||||
printf("RAYLUA: WARN: Can't extract file. '%s'\n", path);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
*out_size = size;
|
*out_size = size;
|
||||||
return buffer;
|
return buffer;
|
||||||
@ -128,31 +119,26 @@ char *raylua_loadFileText(const char *path)
|
|||||||
{
|
{
|
||||||
int index = mz_zip_reader_locate_file(&zip_file, path, NULL, 0);
|
int index = mz_zip_reader_locate_file(&zip_file, path, NULL, 0);
|
||||||
if (index == -1) {
|
if (index == -1) {
|
||||||
printf("RAYLUA: WARN: File not found in payload. '%s'\n", path);
|
printf("RAYLUA: WARN: File not found in payload : '%s'", path);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
mz_zip_archive_file_stat stat;
|
mz_zip_archive_file_stat stat;
|
||||||
if (!mz_zip_reader_file_stat(&zip_file, index, &stat)) {
|
if (!mz_zip_reader_file_stat(&zip_file, index, &stat)) {
|
||||||
printf("RAYLUA: WARN: Can't get file information in payload. '%s'\n", path);
|
printf("RAYLUA: WARN: Can't get file information of '%s' in payload.", path);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t size = stat.m_uncomp_size;
|
size_t size = stat.m_uncomp_size;
|
||||||
char *buffer = RL_MALLOC(size + 1);
|
char *buffer = malloc(size + 1);
|
||||||
if (buffer == NULL) {
|
if (buffer == NULL) {
|
||||||
printf("RAYLUA: WARN: Can't allocate file buffer. '%s'\n", path);
|
printf("RAYLUA: WARN: Can't allocate file buffer for '%s'.", path);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer[size] = '\0';
|
buffer[size] = '\0';
|
||||||
|
|
||||||
if (!mz_zip_reader_extract_to_mem(&zip_file, index, buffer, size, 0)) {
|
mz_zip_reader_extract_to_mem(&zip_file, index, buffer, size, 0);
|
||||||
free(buffer);
|
|
||||||
printf("RAYLUA: WARN: Can't extract file. '%s'\n", path);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -195,9 +181,6 @@ int main(int argc, const char **argv)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
SetLoadFileDataCallback(raylua_loadFileData);
|
|
||||||
SetLoadFileTextCallback(raylua_loadFileText);
|
|
||||||
|
|
||||||
if (!raylua_init_payload(self)) {
|
if (!raylua_init_payload(self)) {
|
||||||
#ifdef RAYLUA_NO_BUILDER
|
#ifdef RAYLUA_NO_BUILDER
|
||||||
puts("RAYLUA: No payload.");
|
puts("RAYLUA: No payload.");
|
||||||
|
495
tools/api.h
495
tools/api.h
@ -1,495 +0,0 @@
|
|||||||
void InitWindow(int width, int height, const char *title)
|
|
||||||
bool WindowShouldClose(void)
|
|
||||||
void CloseWindow(void)
|
|
||||||
bool IsWindowReady(void)
|
|
||||||
bool IsWindowFullscreen(void)
|
|
||||||
bool IsWindowHidden(void)
|
|
||||||
bool IsWindowMinimized(void)
|
|
||||||
bool IsWindowMaximized(void)
|
|
||||||
bool IsWindowFocused(void)
|
|
||||||
bool IsWindowResized(void)
|
|
||||||
bool IsWindowState(unsigned int flag)
|
|
||||||
void SetWindowState(unsigned int flags)
|
|
||||||
void ClearWindowState(unsigned int flags)
|
|
||||||
void ToggleFullscreen(void)
|
|
||||||
void MaximizeWindow(void)
|
|
||||||
void MinimizeWindow(void)
|
|
||||||
void RestoreWindow(void)
|
|
||||||
void SetWindowIcon(Image image)
|
|
||||||
void SetWindowTitle(const char *title)
|
|
||||||
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)
|
|
||||||
int GetMonitorWidth(int monitor)
|
|
||||||
int GetMonitorHeight(int monitor)
|
|
||||||
int GetMonitorPhysicalWidth(int monitor)
|
|
||||||
int GetMonitorPhysicalHeight(int monitor)
|
|
||||||
int GetMonitorRefreshRate(int monitor)
|
|
||||||
Vector2 GetWindowPosition(void)
|
|
||||||
Vector2 GetWindowScaleDPI(void)
|
|
||||||
const char *GetMonitorName(int monitor)
|
|
||||||
void SetClipboardText(const char *text)
|
|
||||||
const char *GetClipboardText(void)
|
|
||||||
void SwapScreenBuffer(void)
|
|
||||||
void PollInputEvents(void)
|
|
||||||
void WaitTime(float ms)
|
|
||||||
void ShowCursor(void)
|
|
||||||
void HideCursor(void)
|
|
||||||
bool IsCursorHidden(void)
|
|
||||||
void EnableCursor(void)
|
|
||||||
void DisableCursor(void)
|
|
||||||
bool IsCursorOnScreen(void)
|
|
||||||
void ClearBackground(Color color)
|
|
||||||
void BeginDrawing(void)
|
|
||||||
void EndDrawing(void)
|
|
||||||
void BeginMode2D(Camera2D camera)
|
|
||||||
void EndMode2D(void)
|
|
||||||
void BeginMode3D(Camera3D camera)
|
|
||||||
void EndMode3D(void)
|
|
||||||
void BeginTextureMode(RenderTexture2D target)
|
|
||||||
void EndTextureMode(void)
|
|
||||||
void BeginShaderMode(Shader shader)
|
|
||||||
void EndShaderMode(void)
|
|
||||||
void BeginBlendMode(int mode)
|
|
||||||
void EndBlendMode(void)
|
|
||||||
void BeginScissorMode(int x, int y, int width, int height)
|
|
||||||
void EndScissorMode(void)
|
|
||||||
void BeginVrStereoMode(VrStereoConfig config)
|
|
||||||
void EndVrStereoMode(void)
|
|
||||||
VrStereoConfig LoadVrStereoConfig(VrDeviceInfo device)
|
|
||||||
void UnloadVrStereoConfig(VrStereoConfig config)
|
|
||||||
Shader LoadShader(const char *vsFileName, const char *fsFileName)
|
|
||||||
Shader LoadShaderFromMemory(const char *vsCode, const char *fsCode)
|
|
||||||
int GetShaderLocation(Shader shader, const char *uniformName)
|
|
||||||
int GetShaderLocationAttrib(Shader shader, const char *attribName)
|
|
||||||
void SetShaderValue(Shader shader, int locIndex, const void *value, int uniformType)
|
|
||||||
void SetShaderValueV(Shader shader, int locIndex, const void *value, int uniformType, int count)
|
|
||||||
void SetShaderValueMatrix(Shader shader, int locIndex, Matrix mat)
|
|
||||||
void SetShaderValueTexture(Shader shader, int locIndex, Texture2D texture)
|
|
||||||
void UnloadShader(Shader shader)
|
|
||||||
Ray GetMouseRay(Vector2 mousePosition, Camera camera)
|
|
||||||
Matrix GetCameraMatrix(Camera camera)
|
|
||||||
Matrix GetCameraMatrix2D(Camera2D camera)
|
|
||||||
Vector2 GetWorldToScreen(Vector3 position, Camera camera)
|
|
||||||
Vector2 GetWorldToScreenEx(Vector3 position, Camera camera, int width, int height)
|
|
||||||
Vector2 GetWorldToScreen2D(Vector2 position, Camera2D camera)
|
|
||||||
Vector2 GetScreenToWorld2D(Vector2 position, Camera2D camera)
|
|
||||||
void SetTargetFPS(int fps)
|
|
||||||
int GetFPS(void)
|
|
||||||
float GetFrameTime(void)
|
|
||||||
double GetTime(void)
|
|
||||||
int GetRandomValue(int min, int max)
|
|
||||||
void SetRandomSeed(unsigned int seed)
|
|
||||||
void TakeScreenshot(const char *fileName)
|
|
||||||
void SetConfigFlags(unsigned int flags)
|
|
||||||
void TraceLog(int logLevel, const char *text, ...)
|
|
||||||
void SetTraceLogLevel(int logLevel)
|
|
||||||
void *MemAlloc(int size)
|
|
||||||
void *MemRealloc(void *ptr, int size)
|
|
||||||
void MemFree(void *ptr)
|
|
||||||
void SetTraceLogCallback(TraceLogCallback callback)
|
|
||||||
unsigned char *LoadFileData(const char *fileName, unsigned int *bytesRead)
|
|
||||||
void UnloadFileData(unsigned char *data)
|
|
||||||
bool SaveFileData(const char *fileName, void *data, unsigned int bytesToWrite)
|
|
||||||
char *LoadFileText(const char *fileName)
|
|
||||||
void UnloadFileText(char *text)
|
|
||||||
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)
|
|
||||||
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)
|
|
||||||
bool SaveStorageValue(unsigned int position, int value)
|
|
||||||
int LoadStorageValue(unsigned int position)
|
|
||||||
void OpenURL(const char *url)
|
|
||||||
bool IsKeyPressed(int key)
|
|
||||||
bool IsKeyDown(int key)
|
|
||||||
bool IsKeyReleased(int key)
|
|
||||||
bool IsKeyUp(int key)
|
|
||||||
void SetExitKey(int key)
|
|
||||||
int GetKeyPressed(void)
|
|
||||||
int GetCharPressed(void)
|
|
||||||
bool IsGamepadAvailable(int gamepad)
|
|
||||||
const char *GetGamepadName(int gamepad)
|
|
||||||
bool IsGamepadButtonPressed(int gamepad, int button)
|
|
||||||
bool IsGamepadButtonDown(int gamepad, int button)
|
|
||||||
bool IsGamepadButtonReleased(int gamepad, int button)
|
|
||||||
bool IsGamepadButtonUp(int gamepad, int button)
|
|
||||||
int GetGamepadButtonPressed(void)
|
|
||||||
int GetGamepadAxisCount(int gamepad)
|
|
||||||
float GetGamepadAxisMovement(int gamepad, int axis)
|
|
||||||
int SetGamepadMappings(const char *mappings)
|
|
||||||
bool IsMouseButtonPressed(int button)
|
|
||||||
bool IsMouseButtonDown(int button)
|
|
||||||
bool IsMouseButtonReleased(int button)
|
|
||||||
bool IsMouseButtonUp(int button)
|
|
||||||
int GetMouseX(void)
|
|
||||||
int GetMouseY(void)
|
|
||||||
Vector2 GetMousePosition(void)
|
|
||||||
Vector2 GetMouseDelta(void)
|
|
||||||
void SetMousePosition(int x, int y)
|
|
||||||
void SetMouseOffset(int offsetX, int offsetY)
|
|
||||||
void SetMouseScale(float scaleX, float scaleY)
|
|
||||||
float GetMouseWheelMove(void)
|
|
||||||
void SetMouseCursor(int cursor)
|
|
||||||
int GetTouchX(void)
|
|
||||||
int GetTouchY(void)
|
|
||||||
Vector2 GetTouchPosition(int index)
|
|
||||||
int GetTouchPointId(int index)
|
|
||||||
int GetTouchPointCount(void)
|
|
||||||
void SetGesturesEnabled(unsigned int flags)
|
|
||||||
bool IsGestureDetected(int gesture)
|
|
||||||
int GetGestureDetected(void)
|
|
||||||
float GetGestureHoldDuration(void)
|
|
||||||
Vector2 GetGestureDragVector(void)
|
|
||||||
float GetGestureDragAngle(void)
|
|
||||||
Vector2 GetGesturePinchVector(void)
|
|
||||||
float GetGesturePinchAngle(void)
|
|
||||||
void SetCameraMode(Camera camera, int mode)
|
|
||||||
void UpdateCamera(Camera *camera)
|
|
||||||
void SetCameraPanControl(int keyPan)
|
|
||||||
void SetCameraAltControl(int keyAlt)
|
|
||||||
void SetCameraSmoothZoomControl(int keySmoothZoom)
|
|
||||||
void SetCameraMoveControls(int keyFront, int keyBack, int keyRight, int keyLeft, int keyUp, int keyDown)
|
|
||||||
void SetShapesTexture(Texture2D texture, Rectangle source)
|
|
||||||
void DrawPixel(int posX, int posY, Color color)
|
|
||||||
void DrawPixelV(Vector2 position, Color color)
|
|
||||||
void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color)
|
|
||||||
void DrawLineV(Vector2 startPos, Vector2 endPos, Color color)
|
|
||||||
void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color)
|
|
||||||
void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color)
|
|
||||||
void DrawLineBezierQuad(Vector2 startPos, Vector2 endPos, Vector2 controlPos, float thick, Color color)
|
|
||||||
void DrawLineBezierCubic(Vector2 startPos, Vector2 endPos, Vector2 startControlPos, Vector2 endControlPos, float thick, Color color)
|
|
||||||
void DrawLineStrip(Vector2 *points, int pointCount, Color color)
|
|
||||||
void DrawCircle(int centerX, int centerY, float radius, Color color)
|
|
||||||
void DrawCircleSector(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color)
|
|
||||||
void DrawCircleSectorLines(Vector2 center, float radius, float startAngle, float endAngle, int segments, Color color)
|
|
||||||
void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2)
|
|
||||||
void DrawCircleV(Vector2 center, float radius, Color color)
|
|
||||||
void DrawCircleLines(int centerX, int centerY, float radius, Color color)
|
|
||||||
void DrawEllipse(int centerX, int centerY, float radiusH, float radiusV, Color color)
|
|
||||||
void DrawEllipseLines(int centerX, int centerY, float radiusH, float radiusV, Color color)
|
|
||||||
void DrawRing(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color)
|
|
||||||
void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, float startAngle, float endAngle, int segments, Color color)
|
|
||||||
void DrawRectangle(int posX, int posY, int width, int height, Color color)
|
|
||||||
void DrawRectangleV(Vector2 position, Vector2 size, Color color)
|
|
||||||
void DrawRectangleRec(Rectangle rec, Color color)
|
|
||||||
void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color)
|
|
||||||
void DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2)
|
|
||||||
void DrawRectangleGradientH(int posX, int posY, int width, int height, Color color1, Color color2)
|
|
||||||
void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4)
|
|
||||||
void DrawRectangleLines(int posX, int posY, int width, int height, Color color)
|
|
||||||
void DrawRectangleLinesEx(Rectangle rec, float lineThick, Color color)
|
|
||||||
void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color)
|
|
||||||
void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, float lineThick, Color color)
|
|
||||||
void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color)
|
|
||||||
void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color)
|
|
||||||
void DrawTriangleFan(Vector2 *points, int pointCount, Color color)
|
|
||||||
void DrawTriangleStrip(Vector2 *points, int pointCount, Color color)
|
|
||||||
void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color)
|
|
||||||
void DrawPolyLines(Vector2 center, int sides, float radius, float rotation, Color color)
|
|
||||||
void DrawPolyLinesEx(Vector2 center, int sides, float radius, float rotation, float lineThick, Color color)
|
|
||||||
bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2)
|
|
||||||
bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, float radius2)
|
|
||||||
bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec)
|
|
||||||
bool CheckCollisionPointRec(Vector2 point, Rectangle rec)
|
|
||||||
bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius)
|
|
||||||
bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3)
|
|
||||||
bool CheckCollisionLines(Vector2 startPos1, Vector2 endPos1, Vector2 startPos2, Vector2 endPos2, Vector2 *collisionPoint)
|
|
||||||
bool CheckCollisionPointLine(Vector2 point, Vector2 p1, Vector2 p2, int threshold)
|
|
||||||
Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2)
|
|
||||||
Image LoadImage(const char *fileName)
|
|
||||||
Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize)
|
|
||||||
Image LoadImageAnim(const char *fileName, int *frames)
|
|
||||||
Image LoadImageFromMemory(const char *fileType, const unsigned char *fileData, int dataSize)
|
|
||||||
Image LoadImageFromTexture(Texture2D texture)
|
|
||||||
Image LoadImageFromScreen(void)
|
|
||||||
void UnloadImage(Image image)
|
|
||||||
bool ExportImage(Image image, const char *fileName)
|
|
||||||
bool ExportImageAsCode(Image image, const char *fileName)
|
|
||||||
Image GenImageColor(int width, int height, Color color)
|
|
||||||
Image GenImageGradientV(int width, int height, Color top, Color bottom)
|
|
||||||
Image GenImageGradientH(int width, int height, Color left, Color right)
|
|
||||||
Image GenImageGradientRadial(int width, int height, float density, Color inner, Color outer)
|
|
||||||
Image GenImageChecked(int width, int height, int checksX, int checksY, Color col1, Color col2)
|
|
||||||
Image GenImageWhiteNoise(int width, int height, float factor)
|
|
||||||
Image GenImageCellular(int width, int height, int tileSize)
|
|
||||||
Image ImageCopy(Image image)
|
|
||||||
Image ImageFromImage(Image image, Rectangle rec)
|
|
||||||
Image ImageText(const char *text, int fontSize, Color color)
|
|
||||||
Image ImageTextEx(Font font, const char *text, float fontSize, float spacing, Color tint)
|
|
||||||
void ImageFormat(Image *image, int newFormat)
|
|
||||||
void ImageToPOT(Image *image, Color fill)
|
|
||||||
void ImageCrop(Image *image, Rectangle crop)
|
|
||||||
void ImageAlphaCrop(Image *image, float threshold)
|
|
||||||
void ImageAlphaClear(Image *image, Color color, float threshold)
|
|
||||||
void ImageAlphaMask(Image *image, Image alphaMask)
|
|
||||||
void ImageAlphaPremultiply(Image *image)
|
|
||||||
void ImageResize(Image *image, int newWidth, int newHeight)
|
|
||||||
void ImageResizeNN(Image *image, int newWidth,int newHeight)
|
|
||||||
void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color fill)
|
|
||||||
void ImageMipmaps(Image *image)
|
|
||||||
void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp)
|
|
||||||
void ImageFlipVertical(Image *image)
|
|
||||||
void ImageFlipHorizontal(Image *image)
|
|
||||||
void ImageRotateCW(Image *image)
|
|
||||||
void ImageRotateCCW(Image *image)
|
|
||||||
void ImageColorTint(Image *image, Color color)
|
|
||||||
void ImageColorInvert(Image *image)
|
|
||||||
void ImageColorGrayscale(Image *image)
|
|
||||||
void ImageColorContrast(Image *image, float contrast)
|
|
||||||
void ImageColorBrightness(Image *image, int brightness)
|
|
||||||
void ImageColorReplace(Image *image, Color color, Color replace)
|
|
||||||
Color *LoadImageColors(Image image)
|
|
||||||
Color *LoadImagePalette(Image image, int maxPaletteSize, int *colorCount)
|
|
||||||
void UnloadImageColors(Color *colors)
|
|
||||||
void UnloadImagePalette(Color *colors)
|
|
||||||
Rectangle GetImageAlphaBorder(Image image, float threshold)
|
|
||||||
Color GetImageColor(Image image, int x, int y)
|
|
||||||
void ImageClearBackground(Image *dst, Color color)
|
|
||||||
void ImageDrawPixel(Image *dst, int posX, int posY, Color color)
|
|
||||||
void ImageDrawPixelV(Image *dst, Vector2 position, Color color)
|
|
||||||
void ImageDrawLine(Image *dst, int startPosX, int startPosY, int endPosX, int endPosY, Color color)
|
|
||||||
void ImageDrawLineV(Image *dst, Vector2 start, Vector2 end, Color color)
|
|
||||||
void ImageDrawCircle(Image *dst, int centerX, int centerY, int radius, Color color)
|
|
||||||
void ImageDrawCircleV(Image *dst, Vector2 center, int radius, Color color)
|
|
||||||
void ImageDrawRectangle(Image *dst, int posX, int posY, int width, int height, Color color)
|
|
||||||
void ImageDrawRectangleV(Image *dst, Vector2 position, Vector2 size, Color color)
|
|
||||||
void ImageDrawRectangleRec(Image *dst, Rectangle rec, Color color)
|
|
||||||
void ImageDrawRectangleLines(Image *dst, Rectangle rec, int thick, Color color)
|
|
||||||
void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint)
|
|
||||||
void ImageDrawText(Image *dst, const char *text, int posX, int posY, int fontSize, Color color)
|
|
||||||
void ImageDrawTextEx(Image *dst, Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint)
|
|
||||||
Texture2D LoadTexture(const char *fileName)
|
|
||||||
Texture2D LoadTextureFromImage(Image image)
|
|
||||||
TextureCubemap LoadTextureCubemap(Image image, int layout)
|
|
||||||
RenderTexture2D LoadRenderTexture(int width, int height)
|
|
||||||
void UnloadTexture(Texture2D texture)
|
|
||||||
void UnloadRenderTexture(RenderTexture2D target)
|
|
||||||
void UpdateTexture(Texture2D texture, const void *pixels)
|
|
||||||
void UpdateTextureRec(Texture2D texture, Rectangle rec, const void *pixels)
|
|
||||||
void GenTextureMipmaps(Texture2D *texture)
|
|
||||||
void SetTextureFilter(Texture2D texture, int filter)
|
|
||||||
void SetTextureWrap(Texture2D texture, int wrap)
|
|
||||||
void DrawTexture(Texture2D texture, int posX, int posY, Color tint)
|
|
||||||
void DrawTextureV(Texture2D texture, Vector2 position, Color tint)
|
|
||||||
void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint)
|
|
||||||
void DrawTextureRec(Texture2D texture, Rectangle source, Vector2 position, Color tint)
|
|
||||||
void DrawTextureQuad(Texture2D texture, Vector2 tiling, Vector2 offset, Rectangle quad, Color tint)
|
|
||||||
void DrawTextureTiled(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, float scale, Color tint)
|
|
||||||
void DrawTexturePro(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, Color tint)
|
|
||||||
void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint)
|
|
||||||
void DrawTexturePoly(Texture2D texture, Vector2 center, Vector2 *points, Vector2 *texcoords, int pointCount, Color tint)
|
|
||||||
Color Fade(Color color, float alpha)
|
|
||||||
int ColorToInt(Color color)
|
|
||||||
Vector4 ColorNormalize(Color color)
|
|
||||||
Color ColorFromNormalized(Vector4 normalized)
|
|
||||||
Vector3 ColorToHSV(Color color)
|
|
||||||
Color ColorFromHSV(float hue, float saturation, float value)
|
|
||||||
Color ColorAlpha(Color color, float alpha)
|
|
||||||
Color ColorAlphaBlend(Color dst, Color src, Color tint)
|
|
||||||
Color GetColor(int hexValue)
|
|
||||||
Color GetPixelColor(void *srcPtr, int format)
|
|
||||||
void SetPixelColor(void *dstPtr, Color color, int format)
|
|
||||||
int GetPixelDataSize(int width, int height, int format)
|
|
||||||
Font GetFontDefault(void)
|
|
||||||
Font LoadFont(const char *fileName)
|
|
||||||
Font LoadFontEx(const char *fileName, int fontSize, int *fontChars, int glyphCount)
|
|
||||||
Font LoadFontFromImage(Image image, Color key, int firstChar)
|
|
||||||
Font LoadFontFromMemory(const char *fileType, const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int glyphCount)
|
|
||||||
GlyphInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int glyphCount, int type)
|
|
||||||
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)
|
|
||||||
GlyphInfo GetGlyphInfo(Font font, int codepoint)
|
|
||||||
Rectangle GetGlyphAtlasRec(Font font, int codepoint)
|
|
||||||
int *LoadCodepoints(const char *text, int *count)
|
|
||||||
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)
|
|
||||||
int TextCopy(char *dst, const char *src)
|
|
||||||
bool TextIsEqual(const char *text1, const char *text2)
|
|
||||||
unsigned int TextLength(const char *text)
|
|
||||||
const char *TextFormat(const char *text, ...)
|
|
||||||
const char *TextSubtext(const char *text, int position, int length)
|
|
||||||
char *TextReplace(char *text, const char *replace, const char *by)
|
|
||||||
char *TextInsert(const char *text, const char *insert, int position)
|
|
||||||
const char *TextJoin(const char **textList, int count, const char *delimiter)
|
|
||||||
const char **TextSplit(const char *text, char delimiter, int *count)
|
|
||||||
void TextAppend(char *text, const char *append, int *position)
|
|
||||||
int TextFindIndex(const char *text, const char *find)
|
|
||||||
const char *TextToUpper(const char *text)
|
|
||||||
const char *TextToLower(const char *text)
|
|
||||||
const char *TextToPascal(const char *text)
|
|
||||||
int TextToInteger(const char *text)
|
|
||||||
void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color)
|
|
||||||
void DrawPoint3D(Vector3 position, Color color)
|
|
||||||
void DrawCircle3D(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color)
|
|
||||||
void DrawTriangle3D(Vector3 v1, Vector3 v2, Vector3 v3, Color color)
|
|
||||||
void DrawTriangleStrip3D(Vector3 *points, int pointCount, Color color)
|
|
||||||
void DrawCube(Vector3 position, float width, float height, float length, Color color)
|
|
||||||
void DrawCubeV(Vector3 position, Vector3 size, Color color)
|
|
||||||
void DrawCubeWires(Vector3 position, float width, float height, float length, Color color)
|
|
||||||
void DrawCubeWiresV(Vector3 position, Vector3 size, Color color)
|
|
||||||
void DrawCubeTexture(Texture2D texture, Vector3 position, float width, float height, float length, Color color)
|
|
||||||
void DrawCubeTextureRec(Texture2D texture, Rectangle source, Vector3 position, float width, float height, float length, Color color)
|
|
||||||
void DrawSphere(Vector3 centerPos, float radius, Color color)
|
|
||||||
void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color color)
|
|
||||||
void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Color color)
|
|
||||||
void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color)
|
|
||||||
void DrawCylinderEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color)
|
|
||||||
void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color)
|
|
||||||
void DrawCylinderWiresEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color)
|
|
||||||
void DrawPlane(Vector3 centerPos, Vector2 size, Color color)
|
|
||||||
void DrawRay(Ray ray, Color color)
|
|
||||||
void DrawGrid(int slices, float spacing)
|
|
||||||
Model LoadModel(const char *fileName)
|
|
||||||
Model LoadModelFromMesh(Mesh mesh)
|
|
||||||
void UnloadModel(Model model)
|
|
||||||
void UnloadModelKeepMeshes(Model model)
|
|
||||||
BoundingBox GetModelBoundingBox(Model model)
|
|
||||||
void DrawModel(Model model, Vector3 position, float scale, Color tint)
|
|
||||||
void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint)
|
|
||||||
void DrawModelWires(Model model, Vector3 position, float scale, Color tint)
|
|
||||||
void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint)
|
|
||||||
void DrawBoundingBox(BoundingBox box, Color color)
|
|
||||||
void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float 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 UploadMesh(Mesh *mesh, bool dynamic)
|
|
||||||
void UpdateMeshBuffer(Mesh mesh, int index, const 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)
|
|
||||||
bool ExportMesh(Mesh mesh, const char *fileName)
|
|
||||||
BoundingBox GetMeshBoundingBox(Mesh mesh)
|
|
||||||
void GenMeshTangents(Mesh *mesh)
|
|
||||||
void GenMeshBinormals(Mesh *mesh)
|
|
||||||
Mesh GenMeshPoly(int sides, float radius)
|
|
||||||
Mesh GenMeshPlane(float width, float length, int resX, int resZ)
|
|
||||||
Mesh GenMeshCube(float width, float height, float length)
|
|
||||||
Mesh GenMeshSphere(float radius, int rings, int slices)
|
|
||||||
Mesh GenMeshHemiSphere(float radius, int rings, int slices)
|
|
||||||
Mesh GenMeshCylinder(float radius, float height, int slices)
|
|
||||||
Mesh GenMeshCone(float radius, float height, int slices)
|
|
||||||
Mesh GenMeshTorus(float radius, float size, int radSeg, int sides)
|
|
||||||
Mesh GenMeshKnot(float radius, float size, int radSeg, int sides)
|
|
||||||
Mesh GenMeshHeightmap(Image heightmap, Vector3 size)
|
|
||||||
Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize)
|
|
||||||
Material *LoadMaterials(const char *fileName, int *materialCount)
|
|
||||||
Material LoadMaterialDefault(void)
|
|
||||||
void UnloadMaterial(Material material)
|
|
||||||
void SetMaterialTexture(Material *material, int mapType, Texture2D texture)
|
|
||||||
void SetModelMeshMaterial(Model *model, int meshId, int materialId)
|
|
||||||
ModelAnimation *LoadModelAnimations(const char *fileName, unsigned int *animCount)
|
|
||||||
void UpdateModelAnimation(Model model, ModelAnimation anim, int frame)
|
|
||||||
void UnloadModelAnimation(ModelAnimation anim)
|
|
||||||
void UnloadModelAnimations(ModelAnimation* animations, unsigned int count)
|
|
||||||
bool IsModelAnimationValid(Model model, ModelAnimation anim)
|
|
||||||
bool CheckCollisionSpheres(Vector3 center1, float radius1, Vector3 center2, float radius2)
|
|
||||||
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 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)
|
|
||||||
void InitAudioDevice(void)
|
|
||||||
void CloseAudioDevice(void)
|
|
||||||
bool IsAudioDeviceReady(void)
|
|
||||||
void SetMasterVolume(float volume)
|
|
||||||
Wave LoadWave(const char *fileName)
|
|
||||||
Wave LoadWaveFromMemory(const char *fileType, const unsigned char *fileData, int dataSize)
|
|
||||||
Sound LoadSound(const char *fileName)
|
|
||||||
Sound LoadSoundFromWave(Wave wave)
|
|
||||||
void UpdateSound(Sound sound, const void *data, int sampleCount)
|
|
||||||
void UnloadWave(Wave wave)
|
|
||||||
void UnloadSound(Sound sound)
|
|
||||||
bool ExportWave(Wave wave, const char *fileName)
|
|
||||||
bool ExportWaveAsCode(Wave wave, const char *fileName)
|
|
||||||
void PlaySound(Sound sound)
|
|
||||||
void StopSound(Sound sound)
|
|
||||||
void PauseSound(Sound sound)
|
|
||||||
void ResumeSound(Sound sound)
|
|
||||||
void PlaySoundMulti(Sound sound)
|
|
||||||
void StopSoundMulti(void)
|
|
||||||
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)
|
|
||||||
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)
|
|
||||||
void UnloadMusicStream(Music music)
|
|
||||||
void PlayMusicStream(Music music)
|
|
||||||
bool IsMusicStreamPlaying(Music music)
|
|
||||||
void UpdateMusicStream(Music music)
|
|
||||||
void StopMusicStream(Music music)
|
|
||||||
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)
|
|
||||||
AudioStream LoadAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels)
|
|
||||||
void UnloadAudioStream(AudioStream stream)
|
|
||||||
void UpdateAudioStream(AudioStream stream, const void *data, int frameCount)
|
|
||||||
bool IsAudioStreamProcessed(AudioStream stream)
|
|
||||||
void PlayAudioStream(AudioStream stream)
|
|
||||||
void PauseAudioStream(AudioStream stream)
|
|
||||||
void ResumeAudioStream(AudioStream stream)
|
|
||||||
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)
|
|
@ -1,139 +0,0 @@
|
|||||||
local json = require "json"
|
|
||||||
|
|
||||||
local content = io.open(arg[1], "r"):read "*a"
|
|
||||||
local t = json.decode(content)
|
|
||||||
|
|
||||||
print "---@diagnostic disable"
|
|
||||||
|
|
||||||
print "---raylib-lua binding"
|
|
||||||
print "rl = {}"
|
|
||||||
|
|
||||||
local ffi_type_list = {}
|
|
||||||
|
|
||||||
local function luaify(t)
|
|
||||||
-- strings
|
|
||||||
for _,v in ipairs { "void %*", "char %*" } do
|
|
||||||
if string.find(t, v) then
|
|
||||||
return 'string|lightuserdata'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
for _,v in ipairs { "char" } do
|
|
||||||
if string.find(t, v) then
|
|
||||||
return "number|string[]"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
for _,v in ipairs { "int", "long", "float", "double" } do
|
|
||||||
if string.find(t, v) then
|
|
||||||
return "number"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local t = t:gsub(" ", "_"):gsub("*", "_ptr"):gsub("__", "_")
|
|
||||||
if t:find "_ptr" then
|
|
||||||
t = t .. "|lightuserdata"
|
|
||||||
end
|
|
||||||
|
|
||||||
return t
|
|
||||||
end
|
|
||||||
|
|
||||||
for _,enum in ipairs(t.enums) do
|
|
||||||
print("---@alias " .. enum.name)
|
|
||||||
for _,v in pairs(enum.values) do
|
|
||||||
print(string.format("---| '%s'", v.name))
|
|
||||||
end
|
|
||||||
|
|
||||||
if enum.description ~= "" then
|
|
||||||
print("---" .. enum.description)
|
|
||||||
end
|
|
||||||
|
|
||||||
print ""
|
|
||||||
|
|
||||||
for _,v in pairs(enum.values) do
|
|
||||||
if v.description ~= "" then
|
|
||||||
print("---" .. v.description)
|
|
||||||
end
|
|
||||||
print(string.format("rl.%s = %u", v.name, v.value))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
for _,struct in ipairs(t.structs) do
|
|
||||||
print(string.format("---@class %s%s", struct.name,
|
|
||||||
(struct.description ~= "") and string.format(" @ %s", struct.description) or ""))
|
|
||||||
|
|
||||||
print(string.format("---@alias %s_ptr %s", struct.name, struct.name))
|
|
||||||
print(string.format("---@alias %s_ptr_ptr %s", struct.name, struct.name))
|
|
||||||
|
|
||||||
if struct.name == "Texture" then
|
|
||||||
print "---@alias Texture2D Texture"
|
|
||||||
end
|
|
||||||
if struct.name == "RenderTexture" then
|
|
||||||
print "---@alias RenderTexture2D RenderTexture"
|
|
||||||
end
|
|
||||||
|
|
||||||
ffi_type_list[#ffi_type_list+1] = struct.name
|
|
||||||
|
|
||||||
for _,field in pairs(struct.fields) do
|
|
||||||
for n in field.name:gmatch "([^, ]+),?" do
|
|
||||||
local arraySize = n:match "%[(.-)%]"
|
|
||||||
if arraySize then
|
|
||||||
n = n:match("(%S-)%[.-%]")
|
|
||||||
field.type = string.format("%s[]", luaify(field.type), arraySize)
|
|
||||||
end
|
|
||||||
|
|
||||||
print(string.format('---@field %s %s%s', n, luaify(field.type),
|
|
||||||
(field.description ~= "") and string.format(" # %s", field.description) or ""))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
print(string.format('---Constructed using `rl.new("%s", ...)`', struct.name))
|
|
||||||
print(string.format("local %s = {}", struct.name))
|
|
||||||
end
|
|
||||||
|
|
||||||
for _,func in ipairs(t.functions) do
|
|
||||||
local arraySize
|
|
||||||
|
|
||||||
local args = {}
|
|
||||||
local vla = false
|
|
||||||
|
|
||||||
for i,param in ipairs(func.params or {}) do
|
|
||||||
if param.name ~= "" then
|
|
||||||
arraySize = param.name:match "%[(.-)%]"
|
|
||||||
if arraySize then
|
|
||||||
param.name = param.name:match("(%S-)%[.-%]")
|
|
||||||
param.type = string.format("%s[%d]", param.type, arraySize)
|
|
||||||
end
|
|
||||||
|
|
||||||
arraySize = param.name:match "%[(.-)%]"
|
|
||||||
if arraySize then
|
|
||||||
param.name = param.name:match("(%S-)%[.-%]")
|
|
||||||
param.type = string.format("%s[%d]", luaify(param.type), arraySize)
|
|
||||||
end
|
|
||||||
|
|
||||||
print(string.format('---@param %s %s', param.name, luaify(param.type)))
|
|
||||||
|
|
||||||
args[#args + 1] = param.name
|
|
||||||
else
|
|
||||||
vla = true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if func.returnType and func.returnType ~= "void" then
|
|
||||||
print(string.format('---@return %s', luaify(func.returnType)))
|
|
||||||
end
|
|
||||||
|
|
||||||
if vla then
|
|
||||||
print "---@vararg any"
|
|
||||||
end
|
|
||||||
|
|
||||||
if func.description ~= "" then
|
|
||||||
print("---" .. func.description)
|
|
||||||
end
|
|
||||||
print(string.format("function rl.%s(%s%s) end", func.name, table.concat(args, ","), vla and ", ..." or ""))
|
|
||||||
end
|
|
||||||
|
|
||||||
print "---Create a new variable of ffi type `t`"
|
|
||||||
for i,t in ipairs(ffi_type_list) do
|
|
||||||
print(string.format([[---@overload fun(t: '"%s"', ...): %s]], t, t))
|
|
||||||
end
|
|
||||||
print("function rl.new(...) end")
|
|
@ -1,388 +0,0 @@
|
|||||||
--
|
|
||||||
-- json.lua
|
|
||||||
--
|
|
||||||
-- Copyright (c) 2020 rxi
|
|
||||||
--
|
|
||||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
||||||
-- this software and associated documentation files (the "Software"), to deal in
|
|
||||||
-- the Software without restriction, including without limitation the rights to
|
|
||||||
-- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
||||||
-- of the Software, and to permit persons to whom the Software is furnished to do
|
|
||||||
-- so, subject to the following conditions:
|
|
||||||
--
|
|
||||||
-- The above copyright notice and this permission notice shall be included in all
|
|
||||||
-- copies or substantial portions of the Software.
|
|
||||||
--
|
|
||||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
-- SOFTWARE.
|
|
||||||
--
|
|
||||||
|
|
||||||
local json = { _version = "0.1.2" }
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
-- Encode
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
local encode
|
|
||||||
|
|
||||||
local escape_char_map = {
|
|
||||||
[ "\\" ] = "\\",
|
|
||||||
[ "\"" ] = "\"",
|
|
||||||
[ "\b" ] = "b",
|
|
||||||
[ "\f" ] = "f",
|
|
||||||
[ "\n" ] = "n",
|
|
||||||
[ "\r" ] = "r",
|
|
||||||
[ "\t" ] = "t",
|
|
||||||
}
|
|
||||||
|
|
||||||
local escape_char_map_inv = { [ "/" ] = "/" }
|
|
||||||
for k, v in pairs(escape_char_map) do
|
|
||||||
escape_char_map_inv[v] = k
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
local function escape_char(c)
|
|
||||||
return "\\" .. (escape_char_map[c] or string.format("u%04x", c:byte()))
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
local function encode_nil(val)
|
|
||||||
return "null"
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
local function encode_table(val, stack)
|
|
||||||
local res = {}
|
|
||||||
stack = stack or {}
|
|
||||||
|
|
||||||
-- Circular reference?
|
|
||||||
if stack[val] then error("circular reference") end
|
|
||||||
|
|
||||||
stack[val] = true
|
|
||||||
|
|
||||||
if rawget(val, 1) ~= nil or next(val) == nil then
|
|
||||||
-- Treat as array -- check keys are valid and it is not sparse
|
|
||||||
local n = 0
|
|
||||||
for k in pairs(val) do
|
|
||||||
if type(k) ~= "number" then
|
|
||||||
error("invalid table: mixed or invalid key types")
|
|
||||||
end
|
|
||||||
n = n + 1
|
|
||||||
end
|
|
||||||
if n ~= #val then
|
|
||||||
error("invalid table: sparse array")
|
|
||||||
end
|
|
||||||
-- Encode
|
|
||||||
for i, v in ipairs(val) do
|
|
||||||
table.insert(res, encode(v, stack))
|
|
||||||
end
|
|
||||||
stack[val] = nil
|
|
||||||
return "[" .. table.concat(res, ",") .. "]"
|
|
||||||
|
|
||||||
else
|
|
||||||
-- Treat as an object
|
|
||||||
for k, v in pairs(val) do
|
|
||||||
if type(k) ~= "string" then
|
|
||||||
error("invalid table: mixed or invalid key types")
|
|
||||||
end
|
|
||||||
table.insert(res, encode(k, stack) .. ":" .. encode(v, stack))
|
|
||||||
end
|
|
||||||
stack[val] = nil
|
|
||||||
return "{" .. table.concat(res, ",") .. "}"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
local function encode_string(val)
|
|
||||||
return '"' .. val:gsub('[%z\1-\31\\"]', escape_char) .. '"'
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
local function encode_number(val)
|
|
||||||
-- Check for NaN, -inf and inf
|
|
||||||
if val ~= val or val <= -math.huge or val >= math.huge then
|
|
||||||
error("unexpected number value '" .. tostring(val) .. "'")
|
|
||||||
end
|
|
||||||
return string.format("%.14g", val)
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
local type_func_map = {
|
|
||||||
[ "nil" ] = encode_nil,
|
|
||||||
[ "table" ] = encode_table,
|
|
||||||
[ "string" ] = encode_string,
|
|
||||||
[ "number" ] = encode_number,
|
|
||||||
[ "boolean" ] = tostring,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
encode = function(val, stack)
|
|
||||||
local t = type(val)
|
|
||||||
local f = type_func_map[t]
|
|
||||||
if f then
|
|
||||||
return f(val, stack)
|
|
||||||
end
|
|
||||||
error("unexpected type '" .. t .. "'")
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
function json.encode(val)
|
|
||||||
return ( encode(val) )
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
-- Decode
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
local parse
|
|
||||||
|
|
||||||
local function create_set(...)
|
|
||||||
local res = {}
|
|
||||||
for i = 1, select("#", ...) do
|
|
||||||
res[ select(i, ...) ] = true
|
|
||||||
end
|
|
||||||
return res
|
|
||||||
end
|
|
||||||
|
|
||||||
local space_chars = create_set(" ", "\t", "\r", "\n")
|
|
||||||
local delim_chars = create_set(" ", "\t", "\r", "\n", "]", "}", ",")
|
|
||||||
local escape_chars = create_set("\\", "/", '"', "b", "f", "n", "r", "t", "u")
|
|
||||||
local literals = create_set("true", "false", "null")
|
|
||||||
|
|
||||||
local literal_map = {
|
|
||||||
[ "true" ] = true,
|
|
||||||
[ "false" ] = false,
|
|
||||||
[ "null" ] = nil,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
local function next_char(str, idx, set, negate)
|
|
||||||
for i = idx, #str do
|
|
||||||
if set[str:sub(i, i)] ~= negate then
|
|
||||||
return i
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return #str + 1
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
local function decode_error(str, idx, msg)
|
|
||||||
local line_count = 1
|
|
||||||
local col_count = 1
|
|
||||||
for i = 1, idx - 1 do
|
|
||||||
col_count = col_count + 1
|
|
||||||
if str:sub(i, i) == "\n" then
|
|
||||||
line_count = line_count + 1
|
|
||||||
col_count = 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
error( string.format("%s at line %d col %d", msg, line_count, col_count) )
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
local function codepoint_to_utf8(n)
|
|
||||||
-- http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=iws-appendixa
|
|
||||||
local f = math.floor
|
|
||||||
if n <= 0x7f then
|
|
||||||
return string.char(n)
|
|
||||||
elseif n <= 0x7ff then
|
|
||||||
return string.char(f(n / 64) + 192, n % 64 + 128)
|
|
||||||
elseif n <= 0xffff then
|
|
||||||
return string.char(f(n / 4096) + 224, f(n % 4096 / 64) + 128, n % 64 + 128)
|
|
||||||
elseif n <= 0x10ffff then
|
|
||||||
return string.char(f(n / 262144) + 240, f(n % 262144 / 4096) + 128,
|
|
||||||
f(n % 4096 / 64) + 128, n % 64 + 128)
|
|
||||||
end
|
|
||||||
error( string.format("invalid unicode codepoint '%x'", n) )
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
local function parse_unicode_escape(s)
|
|
||||||
local n1 = tonumber( s:sub(1, 4), 16 )
|
|
||||||
local n2 = tonumber( s:sub(7, 10), 16 )
|
|
||||||
-- Surrogate pair?
|
|
||||||
if n2 then
|
|
||||||
return codepoint_to_utf8((n1 - 0xd800) * 0x400 + (n2 - 0xdc00) + 0x10000)
|
|
||||||
else
|
|
||||||
return codepoint_to_utf8(n1)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
local function parse_string(str, i)
|
|
||||||
local res = ""
|
|
||||||
local j = i + 1
|
|
||||||
local k = j
|
|
||||||
|
|
||||||
while j <= #str do
|
|
||||||
local x = str:byte(j)
|
|
||||||
|
|
||||||
if x < 32 then
|
|
||||||
decode_error(str, j, "control character in string")
|
|
||||||
|
|
||||||
elseif x == 92 then -- `\`: Escape
|
|
||||||
res = res .. str:sub(k, j - 1)
|
|
||||||
j = j + 1
|
|
||||||
local c = str:sub(j, j)
|
|
||||||
if c == "u" then
|
|
||||||
local hex = str:match("^[dD][89aAbB]%x%x\\u%x%x%x%x", j + 1)
|
|
||||||
or str:match("^%x%x%x%x", j + 1)
|
|
||||||
or decode_error(str, j - 1, "invalid unicode escape in string")
|
|
||||||
res = res .. parse_unicode_escape(hex)
|
|
||||||
j = j + #hex
|
|
||||||
else
|
|
||||||
if not escape_chars[c] then
|
|
||||||
decode_error(str, j - 1, "invalid escape char '" .. c .. "' in string")
|
|
||||||
end
|
|
||||||
res = res .. escape_char_map_inv[c]
|
|
||||||
end
|
|
||||||
k = j + 1
|
|
||||||
|
|
||||||
elseif x == 34 then -- `"`: End of string
|
|
||||||
res = res .. str:sub(k, j - 1)
|
|
||||||
return res, j + 1
|
|
||||||
end
|
|
||||||
|
|
||||||
j = j + 1
|
|
||||||
end
|
|
||||||
|
|
||||||
decode_error(str, i, "expected closing quote for string")
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
local function parse_number(str, i)
|
|
||||||
local x = next_char(str, i, delim_chars)
|
|
||||||
local s = str:sub(i, x - 1)
|
|
||||||
local n = tonumber(s)
|
|
||||||
if not n then
|
|
||||||
decode_error(str, i, "invalid number '" .. s .. "'")
|
|
||||||
end
|
|
||||||
return n, x
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
local function parse_literal(str, i)
|
|
||||||
local x = next_char(str, i, delim_chars)
|
|
||||||
local word = str:sub(i, x - 1)
|
|
||||||
if not literals[word] then
|
|
||||||
decode_error(str, i, "invalid literal '" .. word .. "'")
|
|
||||||
end
|
|
||||||
return literal_map[word], x
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
local function parse_array(str, i)
|
|
||||||
local res = {}
|
|
||||||
local n = 1
|
|
||||||
i = i + 1
|
|
||||||
while 1 do
|
|
||||||
local x
|
|
||||||
i = next_char(str, i, space_chars, true)
|
|
||||||
-- Empty / end of array?
|
|
||||||
if str:sub(i, i) == "]" then
|
|
||||||
i = i + 1
|
|
||||||
break
|
|
||||||
end
|
|
||||||
-- Read token
|
|
||||||
x, i = parse(str, i)
|
|
||||||
res[n] = x
|
|
||||||
n = n + 1
|
|
||||||
-- Next token
|
|
||||||
i = next_char(str, i, space_chars, true)
|
|
||||||
local chr = str:sub(i, i)
|
|
||||||
i = i + 1
|
|
||||||
if chr == "]" then break end
|
|
||||||
if chr ~= "," then decode_error(str, i, "expected ']' or ','") end
|
|
||||||
end
|
|
||||||
return res, i
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
local function parse_object(str, i)
|
|
||||||
local res = {}
|
|
||||||
i = i + 1
|
|
||||||
while 1 do
|
|
||||||
local key, val
|
|
||||||
i = next_char(str, i, space_chars, true)
|
|
||||||
-- Empty / end of object?
|
|
||||||
if str:sub(i, i) == "}" then
|
|
||||||
i = i + 1
|
|
||||||
break
|
|
||||||
end
|
|
||||||
-- Read key
|
|
||||||
if str:sub(i, i) ~= '"' then
|
|
||||||
decode_error(str, i, "expected string for key")
|
|
||||||
end
|
|
||||||
key, i = parse(str, i)
|
|
||||||
-- Read ':' delimiter
|
|
||||||
i = next_char(str, i, space_chars, true)
|
|
||||||
if str:sub(i, i) ~= ":" then
|
|
||||||
decode_error(str, i, "expected ':' after key")
|
|
||||||
end
|
|
||||||
i = next_char(str, i + 1, space_chars, true)
|
|
||||||
-- Read value
|
|
||||||
val, i = parse(str, i)
|
|
||||||
-- Set
|
|
||||||
res[key] = val
|
|
||||||
-- Next token
|
|
||||||
i = next_char(str, i, space_chars, true)
|
|
||||||
local chr = str:sub(i, i)
|
|
||||||
i = i + 1
|
|
||||||
if chr == "}" then break end
|
|
||||||
if chr ~= "," then decode_error(str, i, "expected '}' or ','") end
|
|
||||||
end
|
|
||||||
return res, i
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
local char_func_map = {
|
|
||||||
[ '"' ] = parse_string,
|
|
||||||
[ "0" ] = parse_number,
|
|
||||||
[ "1" ] = parse_number,
|
|
||||||
[ "2" ] = parse_number,
|
|
||||||
[ "3" ] = parse_number,
|
|
||||||
[ "4" ] = parse_number,
|
|
||||||
[ "5" ] = parse_number,
|
|
||||||
[ "6" ] = parse_number,
|
|
||||||
[ "7" ] = parse_number,
|
|
||||||
[ "8" ] = parse_number,
|
|
||||||
[ "9" ] = parse_number,
|
|
||||||
[ "-" ] = parse_number,
|
|
||||||
[ "t" ] = parse_literal,
|
|
||||||
[ "f" ] = parse_literal,
|
|
||||||
[ "n" ] = parse_literal,
|
|
||||||
[ "[" ] = parse_array,
|
|
||||||
[ "{" ] = parse_object,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
parse = function(str, idx)
|
|
||||||
local chr = str:sub(idx, idx)
|
|
||||||
local f = char_func_map[chr]
|
|
||||||
if f then
|
|
||||||
return f(str, idx)
|
|
||||||
end
|
|
||||||
decode_error(str, idx, "unexpected character '" .. chr .. "'")
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
function json.decode(str)
|
|
||||||
if type(str) ~= "string" then
|
|
||||||
error("expected argument of type string, got " .. type(str))
|
|
||||||
end
|
|
||||||
local res, idx = parse(str, next_char(str, 1, space_chars, true))
|
|
||||||
idx = next_char(str, idx, space_chars, true)
|
|
||||||
if idx <= #str then
|
|
||||||
decode_error(str, idx, "trailing garbage")
|
|
||||||
end
|
|
||||||
return res
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
return json
|
|
File diff suppressed because it is too large
Load Diff
@ -1,28 +0,0 @@
|
|||||||
float EaseLinearNone(float t, float b, float c, float d)
|
|
||||||
float EaseLinearIn(float t, float b, float c, float d)
|
|
||||||
float EaseLinearOut(float t, float b, float c, float d)
|
|
||||||
float EaseLinearInOut(float t,float b, float c, float d)
|
|
||||||
float EaseSineIn(float t, float b, float c, float d)
|
|
||||||
float EaseSineOut(float t, float b, float c, float d)
|
|
||||||
float EaseSineInOut(float t, float b, float c, float d)
|
|
||||||
float EaseCircIn(float t, float b, float c, float d)
|
|
||||||
float EaseCircOut(float t, float b, float c, float d)
|
|
||||||
float EaseCircInOut(float t, float b, float c, float d)
|
|
||||||
float EaseCubicIn(float t, float b, float c, float d)
|
|
||||||
float EaseCubicOut(float t, float b, float c, float d)
|
|
||||||
float EaseCubicInOut(float t, float b, float c, float d)
|
|
||||||
float EaseQuadIn(float t, float b, float c, float d)
|
|
||||||
float EaseQuadOut(float t, float b, float c, float d)
|
|
||||||
float EaseQuadInOut(float t, float b, float c, float d)
|
|
||||||
float EaseExpoIn(float t, float b, float c, float d)
|
|
||||||
float EaseExpoOut(float t, float b, float c, float d)
|
|
||||||
float EaseExpoInOut(float t, float b, float c, float d)
|
|
||||||
float EaseBackIn(float t, float b, float c, float d)
|
|
||||||
float EaseBackOut(float t, float b, float c, float d)
|
|
||||||
float EaseBackInOut(float t, float b, float c, float d)
|
|
||||||
float EaseBounceOut(float t, float b, float c, float d)
|
|
||||||
float EaseBounceIn(float t, float b, float c, float d)
|
|
||||||
float EaseBounceInOut(float t, float b, float c, float d)
|
|
||||||
float EaseElasticIn(float t, float b, float c, float d)
|
|
||||||
float EaseElasticOut(float t, float b, float c, float d)
|
|
||||||
float EaseElasticInOut(float t, float b, float c, float d)
|
|
@ -1,117 +1,53 @@
|
|||||||
local keywords = {
|
local keywords = {
|
||||||
"int", "long", "short", "char", "float", "double",
|
"int", "long", "short", "char", "float", "double",
|
||||||
"uint8_t", "uint16_t", "uint32_t", "uint64_t",
|
"uint8_t", "uint16_t", "uint32_t", "uint64_t",
|
||||||
"const", "unsigned", "register",
|
"const", "unsigned", "register", "va_list";
|
||||||
"void", "intptr_t", "bool"
|
"void", "intptr_t", "bool"
|
||||||
}
|
}
|
||||||
|
|
||||||
local structs = {
|
|
||||||
"Vector2", "Vector3", "Vector4", "Quaternion",
|
|
||||||
"Matrix", "Color", "Rectangle", "Image", "Texture", "Texture2D",
|
|
||||||
"RenderTexture", "NPatchInfo", "GlyphInfo", "Font",
|
|
||||||
"Camera", "Camera2D", "Mesh", "Shader", "MaterialMap",
|
|
||||||
"Material", "Model", "Transform", "BoneInfo", "ModelAnimation",
|
|
||||||
"Ray", "RayCollision", "BoundingBox", "Wave", "Sound", "Music",
|
|
||||||
"AudioStream", "VrDeviceInfo", "Camera3D", "RenderTexture2D",
|
|
||||||
"TextureCubemap", "TraceLogCallback", "PhysicsBody",
|
|
||||||
"GestureEvent", "GuiStyle", "GuiTextBoxState",
|
|
||||||
"TraceLogCallback", "VertexBuffer", "DrawCall", "RenderBatch",
|
|
||||||
"ShaderAttributeDataType", "MaterialMapIndex", "VrStereoConfig",
|
|
||||||
"AudioCallback"
|
|
||||||
}
|
|
||||||
|
|
||||||
local rl_structs = {
|
|
||||||
"rlTraceLogLevel", "rlPixelFormat", "rlTextureFilter",
|
|
||||||
"rlBlendMode", "rlShaderLocationIndex", "rlShaderUniformDataType",
|
|
||||||
"rlShaderAttributeDataType", "rlFramebufferAttachType",
|
|
||||||
"rlFramebufferAttachTextureType", "rlVertexBuffer", "rlDrawCall",
|
|
||||||
"rlRenderBatch"
|
|
||||||
}
|
|
||||||
|
|
||||||
local functions = {}
|
local functions = {}
|
||||||
local proto = {}
|
local proto = {}
|
||||||
|
|
||||||
local counter = 0
|
local counter = 0
|
||||||
local file = io.open(arg[1], "wb")
|
|
||||||
local modules = { "api" }
|
|
||||||
local funcname
|
|
||||||
|
|
||||||
local custom_support = {
|
local custom_support = {
|
||||||
["rlgl"] = function (line)
|
["rayfork"] = function (line)
|
||||||
return line:gsub("([%s*]+)(rl%w+)", function (pre, part)
|
return line:gsub("(rf_[^( ]+)(%()", function (part)
|
||||||
functions[#functions + 1] = part
|
functions[#functions + 1] = part
|
||||||
funcname = part
|
|
||||||
counter = counter + 1
|
counter = counter + 1
|
||||||
|
|
||||||
if counter == 2 then
|
if counter == 2 then
|
||||||
print("WARN: Multiple matches for: " .. line)
|
print("WARN: Multiple matches for: " .. line)
|
||||||
end
|
end
|
||||||
|
|
||||||
return "(*)"
|
return "(*)("
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
for i=2,#arg do
|
local file = io.open(arg[1], "wb")
|
||||||
modules[i] = arg[i]
|
local modules = { }
|
||||||
|
|
||||||
|
for i=1,#arg do
|
||||||
|
modules[i] = arg[i + 1]
|
||||||
end
|
end
|
||||||
|
|
||||||
file:write [[
|
|
||||||
struct raylua_bind_entry {
|
|
||||||
const char *name;
|
|
||||||
const char *proto;
|
|
||||||
void *ptr;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct raylua_bind_entry raylua_entries[] = {
|
|
||||||
]]
|
|
||||||
|
|
||||||
for _,modname in ipairs(modules) do
|
for _,modname in ipairs(modules) do
|
||||||
for line in io.lines("tools/" .. modname .. ".h") do
|
for line in io.lines("tools/" .. modname .. ".h") do
|
||||||
if line:sub(1, 2) ~= "//" then
|
|
||||||
if line:sub(1, 1) == "#" then
|
|
||||||
file:write(" " .. line .. "\n")
|
|
||||||
else
|
|
||||||
counter = 0
|
|
||||||
funcname = nil
|
|
||||||
|
|
||||||
if custom_support[modname] then
|
if custom_support[modname] then
|
||||||
line = custom_support[modname](line)
|
line = custom_support[modname](line)
|
||||||
end
|
end
|
||||||
|
|
||||||
line = line:gsub("(%W)([%l%d][%w_]*)", function (before, part)
|
counter = 0
|
||||||
for i,keyword in ipairs(keywords) do
|
|
||||||
if part == keyword
|
|
||||||
or part == "t" then -- uintX_t workaround
|
|
||||||
return before .. part
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
for i,s in ipairs(rl_structs) do
|
line = line:gsub("[^ *(),]+", function (part)
|
||||||
if part == s then
|
for _,keyword in pairs(keywords) do
|
||||||
return before .. part
|
if part == keyword then
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return before
|
|
||||||
end)
|
|
||||||
|
|
||||||
line = line:gsub("%u%w+", function (part)
|
|
||||||
for i,struct in ipairs(structs) do
|
|
||||||
if part == struct then
|
|
||||||
return part
|
return part
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
functions[#functions + 1] = part
|
return part:sub(0, 3) == "rf_" and part or ""
|
||||||
funcname = part
|
|
||||||
counter = counter + 1
|
|
||||||
|
|
||||||
if counter == 2 then
|
|
||||||
print("WARN: Multiple matches for: " .. line)
|
|
||||||
end
|
|
||||||
|
|
||||||
return "(*)"
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- Strip spaces
|
-- Strip spaces
|
||||||
@ -119,21 +55,26 @@ for _,modname in ipairs(modules) do
|
|||||||
line = line:gsub("(%w)%s+([(),*.])", function (a, b) return a .. b end)
|
line = line:gsub("(%w)%s+([(),*.])", function (a, b) return a .. b end)
|
||||||
|
|
||||||
proto[#proto + 1] = line
|
proto[#proto + 1] = line
|
||||||
|
|
||||||
if funcname and line then
|
|
||||||
file:write(string.format(' { "%s", "%s", &%s },\n', funcname, line, funcname))
|
|
||||||
elseif counter == 0 then
|
|
||||||
print("WARN: Invalid entry", funcname, line)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
assert(#proto == #functions, "Mismatching proto and function count : " ..
|
assert(#proto == #functions, "Mismatching proto and function count : " ..
|
||||||
#proto .. " ~= " .. #functions)
|
#proto .. " ~= " .. #functions)
|
||||||
|
|
||||||
print(string.format("Bound %d functions.", #proto))
|
file:write [[
|
||||||
|
struct rf_lua_bind_entry {
|
||||||
|
const char *name;
|
||||||
|
const char *proto;
|
||||||
|
void *ptr;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct rf_lua_bind_entry rayfork_entries[] = {
|
||||||
|
]]
|
||||||
|
|
||||||
|
for i=1,#proto do
|
||||||
|
local name, proto = functions[i], proto[i]
|
||||||
|
file:write(string.format('{ "%s", "%s", &%s },\n', name, proto, name))
|
||||||
|
end
|
||||||
|
|
||||||
file:write '{ NULL, NULL, NULL },\n'
|
file:write '{ NULL, NULL, NULL },\n'
|
||||||
file:write "};\n"
|
file:write "};\n"
|
||||||
|
@ -1,2 +0,0 @@
|
|||||||
void ProcessGestureEvent(GestureEvent event)
|
|
||||||
void UpdateGestures(void)
|
|
@ -1,19 +1,20 @@
|
|||||||
void InitPhysics(void)
|
void InitPhysics(void)
|
||||||
void UpdatePhysics(void)
|
void RunPhysicsStep(void)
|
||||||
void ResetPhysics(void)
|
|
||||||
void ClosePhysics(void)
|
|
||||||
void SetPhysicsTimeStep(double delta)
|
void SetPhysicsTimeStep(double delta)
|
||||||
|
bool IsPhysicsEnabled(void)
|
||||||
void SetPhysicsGravity(float x, float y)
|
void SetPhysicsGravity(float x, float y)
|
||||||
PhysicsBody CreatePhysicsBodyCircle(Vector2 pos, float radius, float density)
|
PhysicsBody CreatePhysicsBodyCircle(Vector2 pos, float radius, float density)
|
||||||
PhysicsBody CreatePhysicsBodyRectangle(Vector2 pos, float width, float height, float density)
|
PhysicsBody CreatePhysicsBodyRectangle(Vector2 pos, float width, float height, float density)
|
||||||
PhysicsBody CreatePhysicsBodyPolygon(Vector2 pos, float radius, int sides, float density)
|
PhysicsBody CreatePhysicsBodyPolygon(Vector2 pos, float radius, int sides, float density)
|
||||||
void DestroyPhysicsBody(PhysicsBody body)
|
|
||||||
void PhysicsAddForce(PhysicsBody body, Vector2 force)
|
void PhysicsAddForce(PhysicsBody body, Vector2 force)
|
||||||
void PhysicsAddTorque(PhysicsBody body, float amount)
|
void PhysicsAddTorque(PhysicsBody body, float amount)
|
||||||
void PhysicsShatter(PhysicsBody body, Vector2 position, float force)
|
void PhysicsShatter(PhysicsBody body, Vector2 position, float force)
|
||||||
void SetPhysicsBodyRotation(PhysicsBody body, float radians)
|
|
||||||
PhysicsBody GetPhysicsBody(int index)
|
|
||||||
int GetPhysicsBodiesCount(void)
|
int GetPhysicsBodiesCount(void)
|
||||||
|
PhysicsBody GetPhysicsBody(int index)
|
||||||
int GetPhysicsShapeType(int index)
|
int GetPhysicsShapeType(int index)
|
||||||
int GetPhysicsShapeVerticesCount(int index)
|
int GetPhysicsShapeVerticesCount(int index)
|
||||||
Vector2 GetPhysicsShapeVertex(PhysicsBody body, int vertex)
|
Vector2 GetPhysicsShapeVertex(PhysicsBody body, int vertex)
|
||||||
|
void SetPhysicsBodyRotation(PhysicsBody body, float radians)
|
||||||
|
void DestroyPhysicsBody(PhysicsBody body)
|
||||||
|
void ResetPhysics(void)
|
||||||
|
void ClosePhysics(void)
|
||||||
|
546
tools/rayfork.h
Normal file
546
tools/rayfork.h
Normal file
@ -0,0 +1,546 @@
|
|||||||
|
void* rf_calloc_wrapper(rf_allocator allocator, rf_int amount, rf_int size);
|
||||||
|
void* rf_libc_allocator_wrapper(struct rf_allocator* this_allocator, rf_source_location source_location, rf_allocator_mode mode, rf_allocator_args args);
|
||||||
|
rf_int rf_libc_get_file_size(void* user_data, const char* filename);
|
||||||
|
bool rf_libc_load_file_into_buffer(void* user_data, const char* filename, void* dst, rf_int dst_size);
|
||||||
|
rf_recorded_error rf_get_last_recorded_error();
|
||||||
|
const char* rf_log_type_string(rf_log_type);
|
||||||
|
void rf_set_logger(rf_logger logger);
|
||||||
|
void rf_set_logger_filter(rf_log_type);
|
||||||
|
void rf_libc_printf_logger(struct rf_logger* logger, rf_source_location source_location, rf_log_type log_type, const char* msg, rf_error_type error_type, va_list args);
|
||||||
|
rf_int rf_libc_rand_wrapper(rf_int min, rf_int max);
|
||||||
|
rf_decoded_rune rf_decode_utf8_char(const char* text, rf_int len);
|
||||||
|
rf_decoded_utf8_stats rf_count_utf8_chars(const char* text, rf_int len);
|
||||||
|
rf_decoded_string rf_decode_utf8_to_buffer(const char* text, rf_int len, rf_rune* dst, rf_int dst_size);
|
||||||
|
rf_decoded_string rf_decode_utf8(const char* text, rf_int len, rf_allocator allocator);
|
||||||
|
float rf_next_pot(float it);
|
||||||
|
rf_vec2 rf_center_to_screen(float w, float h);
|
||||||
|
rf_vec2 rf_center_to_object(rf_sizef center_this, rf_rec to_this);
|
||||||
|
float rf_clamp(float value, float min, float max);
|
||||||
|
float rf_lerp(float start, float end, float amount);
|
||||||
|
rf_vec2 rf_vec2_add(rf_vec2 v1, rf_vec2 v2);
|
||||||
|
rf_vec2 rf_vec2_sub(rf_vec2 v1, rf_vec2 v2);
|
||||||
|
float rf_vec2_len(rf_vec2 v);
|
||||||
|
float rf_vec2_dot_product(rf_vec2 v1, rf_vec2 v2);
|
||||||
|
float rf_vec2_distance(rf_vec2 v1, rf_vec2 v2);
|
||||||
|
float rf_vec2_angle(rf_vec2 v1, rf_vec2 v2);
|
||||||
|
rf_vec2 rf_vec2_scale(rf_vec2 v, float scale);
|
||||||
|
rf_vec2 rf_vec2_mul_v(rf_vec2 v1, rf_vec2 v2);
|
||||||
|
rf_vec2 rf_vec2_negate(rf_vec2 v);
|
||||||
|
rf_vec2 rf_vec2_div(rf_vec2 v, float div);
|
||||||
|
rf_vec2 rf_vec2_div_v(rf_vec2 v1, rf_vec2 v2);
|
||||||
|
rf_vec2 rf_vec2_normalize(rf_vec2 v);
|
||||||
|
rf_vec2 rf_vec2_lerp(rf_vec2 v1, rf_vec2 v2, float amount);
|
||||||
|
rf_vec3 rf_vec3_add(rf_vec3 v1, rf_vec3 v2);
|
||||||
|
rf_vec3 rf_vec3_sub(rf_vec3 v1, rf_vec3 v2);
|
||||||
|
rf_vec3 rf_vec3_mul(rf_vec3 v, float scalar);
|
||||||
|
rf_vec3 rf_vec3_mul_v(rf_vec3 v1, rf_vec3 v2);
|
||||||
|
rf_vec3 rf_vec3_cross_product(rf_vec3 v1, rf_vec3 v2);
|
||||||
|
rf_vec3 rf_vec3_perpendicular(rf_vec3 v);
|
||||||
|
float rf_vec3_len(rf_vec3 v);
|
||||||
|
float rf_vec3_dot_product(rf_vec3 v1, rf_vec3 v2);
|
||||||
|
float rf_vec3_distance(rf_vec3 v1, rf_vec3 v2);
|
||||||
|
rf_vec3 rf_vec3_scale(rf_vec3 v, float scale);
|
||||||
|
rf_vec3 rf_vec3_negate(rf_vec3 v);
|
||||||
|
rf_vec3 rf_vec3_div(rf_vec3 v, float div);
|
||||||
|
rf_vec3 rf_vec3_div_v(rf_vec3 v1, rf_vec3 v2);
|
||||||
|
rf_vec3 rf_vec3_normalize(rf_vec3 v);
|
||||||
|
void rf_vec3_ortho_normalize(rf_vec3* v1, rf_vec3* v2);
|
||||||
|
rf_vec3 rf_vec3_transform(rf_vec3 v, rf_mat mat);
|
||||||
|
rf_vec3 rf_vec3_rotate_by_quaternion(rf_vec3 v, rf_quaternion q);
|
||||||
|
rf_vec3 rf_vec3_lerp(rf_vec3 v1, rf_vec3 v2, float amount);
|
||||||
|
rf_vec3 rf_vec3_reflect(rf_vec3 v, rf_vec3 normal);
|
||||||
|
rf_vec3 rf_vec3_min(rf_vec3 v1, rf_vec3 v2);
|
||||||
|
rf_vec3 rf_vec3_max(rf_vec3 v1, rf_vec3 v2);
|
||||||
|
rf_vec3 rf_vec3_barycenter(rf_vec3 p, rf_vec3 a, rf_vec3 b, rf_vec3 c);
|
||||||
|
float rf_mat_determinant(rf_mat mat);
|
||||||
|
float rf_mat_trace(rf_mat mat);
|
||||||
|
rf_mat rf_mat_transpose(rf_mat mat);
|
||||||
|
rf_mat rf_mat_invert(rf_mat mat);
|
||||||
|
rf_mat rf_mat_normalize(rf_mat mat);
|
||||||
|
rf_mat rf_mat_identity(void);
|
||||||
|
rf_mat rf_mat_add(rf_mat left, rf_mat right);
|
||||||
|
rf_mat rf_mat_sub(rf_mat left, rf_mat right);
|
||||||
|
rf_mat rf_mat_translate(float x, float y, float z);
|
||||||
|
rf_mat rf_mat_rotate(rf_vec3 axis, float angle);
|
||||||
|
rf_mat rf_mat_rotate_xyz(rf_vec3 ang);
|
||||||
|
rf_mat rf_mat_rotate_x(float angle);
|
||||||
|
rf_mat rf_mat_rotate_y(float angle);
|
||||||
|
rf_mat rf_mat_rotate_z(float angle);
|
||||||
|
rf_mat rf_mat_scale(float x, float y, float z);
|
||||||
|
rf_mat rf_mat_mul(rf_mat left, rf_mat right);
|
||||||
|
rf_mat rf_mat_frustum(double left, double right, double bottom, double top, double near_val, double far_val);
|
||||||
|
rf_mat rf_mat_perspective(double fovy, double aspect, double near_val, double far_val);
|
||||||
|
rf_mat rf_mat_ortho(double left, double right, double bottom, double top, double near_val, double far_val);
|
||||||
|
rf_mat rf_mat_look_at(rf_vec3 eye, rf_vec3 target, rf_vec3 up);
|
||||||
|
rf_float16 rf_mat_to_float16(rf_mat mat);
|
||||||
|
rf_quaternion rf_quaternion_identity(void);
|
||||||
|
float rf_quaternion_len(rf_quaternion q);
|
||||||
|
rf_quaternion rf_quaternion_normalize(rf_quaternion q);
|
||||||
|
rf_quaternion rf_quaternion_invert(rf_quaternion q);
|
||||||
|
rf_quaternion rf_quaternion_mul(rf_quaternion q1, rf_quaternion q2);
|
||||||
|
rf_quaternion rf_quaternion_lerp(rf_quaternion q1, rf_quaternion q2, float amount);
|
||||||
|
rf_quaternion rf_quaternion_nlerp(rf_quaternion q1, rf_quaternion q2, float amount);
|
||||||
|
rf_quaternion rf_quaternion_slerp(rf_quaternion q1, rf_quaternion q2, float amount);
|
||||||
|
rf_quaternion rf_quaternion_from_vector3_to_vector3(rf_vec3 from, rf_vec3 to);
|
||||||
|
rf_quaternion rf_quaternion_from_matrix(rf_mat mat);
|
||||||
|
rf_mat rf_quaternion_to_matrix(rf_quaternion q);
|
||||||
|
rf_quaternion rf_quaternion_from_axis_angle(rf_vec3 axis, float angle);
|
||||||
|
void rf_quaternion_to_axis_angle(rf_quaternion q, rf_vec3* outAxis, float* outAngle);
|
||||||
|
rf_quaternion rf_quaternion_from_euler(float roll, float pitch, float yaw);
|
||||||
|
rf_vec3 rf_quaternion_to_euler(rf_quaternion q);
|
||||||
|
rf_quaternion rf_quaternion_transform(rf_quaternion q, rf_mat mat);
|
||||||
|
bool rf_check_collision_recs(rf_rec rec1, rf_rec rec2);
|
||||||
|
bool rf_check_collision_circles(rf_vec2 center1, float radius1, rf_vec2 center2, float radius2);
|
||||||
|
bool rf_check_collision_circle_rec(rf_vec2 center, float radius, rf_rec rec);
|
||||||
|
bool rf_check_collision_point_rec(rf_vec2 point, rf_rec rec);
|
||||||
|
bool rf_check_collision_point_circle(rf_vec2 point, rf_vec2 center, float radius);
|
||||||
|
bool rf_check_collision_point_triangle(rf_vec2 point, rf_vec2 p1, rf_vec2 p2, rf_vec2 p3);
|
||||||
|
rf_rec rf_get_collision_rec(rf_rec rec1, rf_rec rec2);
|
||||||
|
bool rf_check_collision_spheres(rf_vec3 center_a, float radius_a, rf_vec3 center_b, float radius_b);
|
||||||
|
bool rf_check_collision_boxes(rf_bounding_box box1, rf_bounding_box box2);
|
||||||
|
bool rf_check_collision_box_sphere(rf_bounding_box box, rf_vec3 center, float radius);
|
||||||
|
bool rf_check_collision_ray_sphere(rf_ray ray, rf_vec3 center, float radius);
|
||||||
|
bool rf_check_collision_ray_sphere_ex(rf_ray ray, rf_vec3 center, float radius, rf_vec3* collision_point);
|
||||||
|
bool rf_check_collision_ray_box(rf_ray ray, rf_bounding_box box);
|
||||||
|
rf_ray_hit_info rf_collision_ray_model(rf_ray ray, struct rf_model model);
|
||||||
|
rf_ray_hit_info rf_collision_ray_triangle(rf_ray ray, rf_vec3 p1, rf_vec3 p2, rf_vec3 p3);
|
||||||
|
rf_ray_hit_info rf_collision_ray_ground(rf_ray ray, float ground_height);
|
||||||
|
int rf_get_size_base64(const unsigned char* input);
|
||||||
|
rf_base64_output rf_decode_base64(const unsigned char* input, rf_allocator allocator);
|
||||||
|
const char* rf_pixel_format_string(rf_pixel_format format);
|
||||||
|
bool rf_is_uncompressed_format(rf_pixel_format format);
|
||||||
|
bool rf_is_compressed_format(rf_pixel_format format);
|
||||||
|
int rf_bits_per_pixel(rf_pixel_format format);
|
||||||
|
int rf_bytes_per_pixel(rf_uncompressed_pixel_format format);
|
||||||
|
int rf_pixel_buffer_size(int width, int height, rf_pixel_format format);
|
||||||
|
bool rf_format_pixels_to_normalized(const void* src, rf_int src_size, rf_uncompressed_pixel_format src_format, rf_vec4* dst, rf_int dst_size);
|
||||||
|
bool rf_format_pixels_to_rgba32(const void* src, rf_int src_size, rf_uncompressed_pixel_format src_format, rf_color* dst, rf_int dst_size);
|
||||||
|
bool rf_format_pixels(const void* src, rf_int src_size, rf_uncompressed_pixel_format src_format, void* dst, rf_int dst_size, rf_uncompressed_pixel_format dst_format);
|
||||||
|
rf_vec4 rf_format_one_pixel_to_normalized(const void* src, rf_uncompressed_pixel_format src_format);
|
||||||
|
rf_color rf_format_one_pixel_to_rgba32(const void* src, rf_uncompressed_pixel_format src_format);
|
||||||
|
void rf_format_one_pixel(const void* src, rf_uncompressed_pixel_format src_format, void* dst, rf_uncompressed_pixel_format dst_format);
|
||||||
|
bool rf_color_match_rgb(rf_color a, rf_color b);
|
||||||
|
bool rf_color_match(rf_color a, rf_color b);
|
||||||
|
int rf_color_to_int(rf_color color);
|
||||||
|
rf_vec4 rf_color_normalize(rf_color color);
|
||||||
|
rf_color rf_color_from_normalized(rf_vec4 normalized);
|
||||||
|
rf_vec3 rf_color_to_hsv(rf_color color);
|
||||||
|
rf_color rf_color_from_hsv(rf_vec3 hsv);
|
||||||
|
rf_color rf_color_from_int(int hex_value);
|
||||||
|
rf_color rf_fade(rf_color color, float alpha);
|
||||||
|
rf_vec3 rf_unproject(rf_vec3 source, rf_mat proj, rf_mat view);
|
||||||
|
rf_ray rf_get_mouse_ray(rf_sizei screen_size, rf_vec2 mouse_position, rf_camera3d camera);
|
||||||
|
rf_mat rf_get_camera_matrix(rf_camera3d camera);
|
||||||
|
rf_mat rf_get_camera_matrix2d(rf_camera2d camera);
|
||||||
|
rf_vec2 rf_get_world_to_screen(rf_sizei screen_size, rf_vec3 position, rf_camera3d camera);
|
||||||
|
rf_vec2 rf_get_world_to_screen2d(rf_vec2 position, rf_camera2d camera);
|
||||||
|
rf_vec2 rf_get_screen_to_world2d(rf_vec2 position, rf_camera2d camera);
|
||||||
|
void rf_set_camera3d_mode(rf_camera3d_state* state, rf_camera3d camera, rf_builtin_camera3d_mode mode);
|
||||||
|
void rf_update_camera3d(rf_camera3d* camera, rf_camera3d_state* state, rf_input_state_for_update_camera input_state);
|
||||||
|
int rf_image_size(rf_image image);
|
||||||
|
int rf_image_size_in_format(rf_image image, rf_pixel_format format);
|
||||||
|
bool rf_image_get_pixels_as_rgba32_to_buffer(rf_image image, rf_color* dst, rf_int dst_size);
|
||||||
|
bool rf_image_get_pixels_as_normalized_to_buffer(rf_image image, rf_vec4* dst, rf_int dst_size);
|
||||||
|
rf_color* rf_image_pixels_to_rgba32(rf_image image, rf_allocator allocator);
|
||||||
|
rf_vec4* rf_image_compute_pixels_to_normalized(rf_image image, rf_allocator allocator);
|
||||||
|
void rf_image_extract_palette_to_buffer(rf_image image, rf_color* palette_dst, rf_int palette_size);
|
||||||
|
rf_palette rf_image_extract_palette(rf_image image, rf_int palette_size, rf_allocator allocator);
|
||||||
|
rf_rec rf_image_alpha_border(rf_image image, float threshold);
|
||||||
|
bool rf_supports_image_file_type(const char* filename);
|
||||||
|
rf_image rf_load_image_from_file_data_to_buffer(const void* src, rf_int src_size, void* dst, rf_int dst_size, rf_desired_channels channels, rf_allocator temp_allocator);
|
||||||
|
rf_image rf_load_image_from_file_data(const void* src, rf_int src_size, rf_allocator allocator, rf_allocator temp_allocator);
|
||||||
|
rf_image rf_load_image_from_hdr_file_data_to_buffer(const void* src, rf_int src_size, void* dst, rf_int dst_size, rf_desired_channels channels, rf_allocator temp_allocator);
|
||||||
|
rf_image rf_load_image_from_hdr_file_data(const void* src, rf_int src_size, rf_allocator allocator, rf_allocator temp_allocator);
|
||||||
|
rf_image rf_load_image_from_format_to_buffer(const void* src, rf_int src_size, int src_width, int src_height, rf_uncompressed_pixel_format src_format, void* dst, rf_int dst_size, rf_uncompressed_pixel_format dst_format);
|
||||||
|
rf_image rf_load_image_from_file(const char* filename, rf_allocator allocator, rf_allocator temp_allocator, rf_io_callbacks io);
|
||||||
|
void rf_unload_image(rf_image image, rf_allocator allocator);
|
||||||
|
int rf_mipmaps_image_size(rf_mipmaps_image image);
|
||||||
|
rf_mipmaps_stats rf_compute_mipmaps_stats(rf_image image, int desired_mipmaps_count);
|
||||||
|
rf_mipmaps_image rf_image_gen_mipmaps_to_buffer(rf_image image, int gen_mipmaps_count, void* dst, rf_int dst_size, rf_allocator temp_allocator);
|
||||||
|
rf_mipmaps_image rf_image_gen_mipmaps(rf_image image, int desired_mipmaps_count, rf_allocator allocator, rf_allocator temp_allocator);
|
||||||
|
void rf_unload_mipmaps_image(rf_mipmaps_image image, rf_allocator allocator);
|
||||||
|
rf_int rf_get_dds_image_size(const void* src, rf_int src_size);
|
||||||
|
rf_mipmaps_image rf_load_dds_image_to_buffer(const void* src, rf_int src_size, void* dst, rf_int dst_size);
|
||||||
|
rf_mipmaps_image rf_load_dds_image(const void* src, rf_int src_size, rf_allocator allocator);
|
||||||
|
rf_mipmaps_image rf_load_dds_image_from_file(const char* file, rf_allocator allocator, rf_allocator temp_allocator, rf_io_callbacks io);
|
||||||
|
rf_int rf_get_pkm_image_size(const void* src, rf_int src_size);
|
||||||
|
rf_image rf_load_pkm_image_to_buffer(const void* src, rf_int src_size, void* dst, rf_int dst_size);
|
||||||
|
rf_image rf_load_pkm_image(const void* src, rf_int src_size, rf_allocator allocator);
|
||||||
|
rf_image rf_load_pkm_image_from_file(const char* file, rf_allocator allocator, rf_allocator temp_allocator, rf_io_callbacks io);
|
||||||
|
rf_int rf_get_ktx_image_size(const void* src, rf_int src_size);
|
||||||
|
rf_mipmaps_image rf_load_ktx_image_to_buffer(const void* src, rf_int src_size, void* dst, rf_int dst_size);
|
||||||
|
rf_mipmaps_image rf_load_ktx_image(const void* src, rf_int src_size, rf_allocator allocator);
|
||||||
|
rf_mipmaps_image rf_load_ktx_image_from_file(const char* file, rf_allocator allocator, rf_allocator temp_allocator, rf_io_callbacks io);
|
||||||
|
rf_gif rf_load_animated_gif(const void* data, rf_int data_size, rf_allocator allocator, rf_allocator temp_allocator);
|
||||||
|
rf_gif rf_load_animated_gif_file(const char* filename, rf_allocator allocator, rf_allocator temp_allocator, rf_io_callbacks io);
|
||||||
|
rf_sizei rf_gif_frame_size(rf_gif gif);
|
||||||
|
rf_image rf_get_frame_from_gif(rf_gif gif, int frame);
|
||||||
|
void rf_unload_gif(rf_gif gif, rf_allocator allocator);
|
||||||
|
rf_vec2 rf_get_seed_for_cellular_image(int seeds_per_row, int tile_size, int i, rf_rand_proc rand);
|
||||||
|
rf_image rf_gen_image_color_to_buffer(int width, int height, rf_color color, rf_color* dst, rf_int dst_size);
|
||||||
|
rf_image rf_gen_image_color(int width, int height, rf_color color, rf_allocator allocator);
|
||||||
|
rf_image rf_gen_image_gradient_v_to_buffer(int width, int height, rf_color top, rf_color bottom, rf_color* dst, rf_int dst_size);
|
||||||
|
rf_image rf_gen_image_gradient_v(int width, int height, rf_color top, rf_color bottom, rf_allocator allocator);
|
||||||
|
rf_image rf_gen_image_gradient_h_to_buffer(int width, int height, rf_color left, rf_color right, rf_color* dst, rf_int dst_size);
|
||||||
|
rf_image rf_gen_image_gradient_h(int width, int height, rf_color left, rf_color right, rf_allocator allocator);
|
||||||
|
rf_image rf_gen_image_gradient_radial_to_buffer(int width, int height, float density, rf_color inner, rf_color outer, rf_color* dst, rf_int dst_size);
|
||||||
|
rf_image rf_gen_image_gradient_radial(int width, int height, float density, rf_color inner, rf_color outer, rf_allocator allocator);
|
||||||
|
rf_image rf_gen_image_checked_to_buffer(int width, int height, int checks_x, int checks_y, rf_color col1, rf_color col2, rf_color* dst, rf_int dst_size);
|
||||||
|
rf_image rf_gen_image_checked(int width, int height, int checks_x, int checks_y, rf_color col1, rf_color col2, rf_allocator allocator);
|
||||||
|
rf_image rf_gen_image_white_noise_to_buffer(int width, int height, float factor, rf_rand_proc rand, rf_color* dst, rf_int dst_size);
|
||||||
|
rf_image rf_gen_image_white_noise(int width, int height, float factor, rf_rand_proc rand, rf_allocator allocator);
|
||||||
|
rf_image rf_gen_image_perlin_noise_to_buffer(int width, int height, int offset_x, int offset_y, float scale, rf_color* dst, rf_int dst_size);
|
||||||
|
rf_image rf_gen_image_perlin_noise(int width, int height, int offset_x, int offset_y, float scale, rf_allocator allocator);
|
||||||
|
rf_image rf_gen_image_cellular_to_buffer(int width, int height, int tile_size, rf_rand_proc rand, rf_color* dst, rf_int dst_size);
|
||||||
|
rf_image rf_gen_image_cellular(int width, int height, int tile_size, rf_rand_proc rand, rf_allocator allocator);
|
||||||
|
rf_image rf_image_copy_to_buffer(rf_image image, void* dst, rf_int dst_size);
|
||||||
|
rf_image rf_image_copy(rf_image image, rf_allocator allocator);
|
||||||
|
rf_image rf_image_crop_to_buffer(rf_image image, rf_rec crop, void* dst, rf_int dst_size, rf_uncompressed_pixel_format dst_format);
|
||||||
|
rf_image rf_image_crop(rf_image image, rf_rec crop, rf_allocator allocator);
|
||||||
|
rf_image rf_image_resize_to_buffer(rf_image image, int new_width, int new_height, void* dst, rf_int dst_size, rf_allocator temp_allocator);
|
||||||
|
rf_image rf_image_resize(rf_image image, int new_width, int new_height, rf_allocator allocator, rf_allocator temp_allocator);
|
||||||
|
rf_image rf_image_resize_nn_to_buffer(rf_image image, int new_width, int new_height, void* dst, rf_int dst_size);
|
||||||
|
rf_image rf_image_resize_nn(rf_image image, int new_width, int new_height, rf_allocator allocator);
|
||||||
|
rf_image rf_image_format_to_buffer(rf_image image, rf_uncompressed_pixel_format dst_format, void* dst, rf_int dst_size);
|
||||||
|
rf_image rf_image_format(rf_image image, rf_uncompressed_pixel_format new_format, rf_allocator allocator);
|
||||||
|
rf_image rf_image_alpha_mask_to_buffer(rf_image image, rf_image alpha_mask, void* dst, rf_int dst_size);
|
||||||
|
rf_image rf_image_alpha_clear(rf_image image, rf_color color, float threshold, rf_allocator allocator, rf_allocator temp_allocator);
|
||||||
|
rf_image rf_image_alpha_premultiply(rf_image image, rf_allocator allocator, rf_allocator temp_allocator);
|
||||||
|
rf_rec rf_image_alpha_crop_rec(rf_image image, float threshold);
|
||||||
|
rf_image rf_image_alpha_crop(rf_image image, float threshold, rf_allocator allocator);
|
||||||
|
rf_image rf_image_dither(rf_image image, int r_bpp, int g_bpp, int b_bpp, int a_bpp, rf_allocator allocator, rf_allocator temp_allocator);
|
||||||
|
rf_image rf_image_flip_vertical_to_buffer(rf_image image, void* dst, rf_int dst_size);
|
||||||
|
rf_image rf_image_flip_vertical(rf_image image, rf_allocator allocator);
|
||||||
|
rf_image rf_image_flip_horizontal_to_buffer(rf_image image, void* dst, rf_int dst_size);
|
||||||
|
rf_image rf_image_flip_horizontal(rf_image image, rf_allocator allocator);
|
||||||
|
rf_image rf_image_rotate_cw_to_buffer(rf_image image, void* dst, rf_int dst_size);
|
||||||
|
rf_image rf_image_rotate_cw(rf_image image);
|
||||||
|
rf_image rf_image_rotate_ccw_to_buffer(rf_image image, void* dst, rf_int dst_size);
|
||||||
|
rf_image rf_image_rotate_ccw(rf_image image);
|
||||||
|
rf_image rf_image_color_tint_to_buffer(rf_image image, rf_color color, void* dst, rf_int dst_size);
|
||||||
|
rf_image rf_image_color_tint(rf_image image, rf_color color);
|
||||||
|
rf_image rf_image_color_invert_to_buffer(rf_image image, void* dst, rf_int dst_size);
|
||||||
|
rf_image rf_image_color_invert(rf_image image);
|
||||||
|
rf_image rf_image_color_grayscale_to_buffer(rf_image image, void* dst, rf_int dst_size);
|
||||||
|
rf_image rf_image_color_grayscale(rf_image image);
|
||||||
|
rf_image rf_image_color_contrast_to_buffer(rf_image image, float contrast, void* dst, rf_int dst_size);
|
||||||
|
rf_image rf_image_color_contrast(rf_image image, int contrast);
|
||||||
|
rf_image rf_image_color_brightness_to_buffer(rf_image image, int brightness, void* dst, rf_int dst_size);
|
||||||
|
rf_image rf_image_color_brightness(rf_image image, int brightness);
|
||||||
|
rf_image rf_image_color_replace_to_buffer(rf_image image, rf_color color, rf_color replace, void* dst, rf_int dst_size);
|
||||||
|
rf_image rf_image_color_replace(rf_image image, rf_color color, rf_color replace);
|
||||||
|
void rf_image_draw(rf_image* dst, rf_image src, rf_rec src_rec, rf_rec dst_rec, rf_color tint, rf_allocator temp_allocator);
|
||||||
|
void rf_image_draw_rectangle(rf_image* dst, rf_rec rec, rf_color color, rf_allocator temp_allocator);
|
||||||
|
void rf_image_draw_rectangle_lines(rf_image* dst, rf_rec rec, int thick, rf_color color, rf_allocator temp_allocator);
|
||||||
|
rf_shader rf_gfx_load_shader(const char* vs_code, const char* fs_code);
|
||||||
|
void rf_gfx_unload_shader(rf_shader shader);
|
||||||
|
int rf_gfx_get_shader_location(rf_shader shader, const char* uniform_name);
|
||||||
|
void rf_gfx_set_shader_value(rf_shader shader, int uniform_loc, const void* value, int uniform_name);
|
||||||
|
void rf_gfx_set_shader_value_v(rf_shader shader, int uniform_loc, const void* value, int uniform_name, int count);
|
||||||
|
void rf_gfx_set_shader_value_matrix(rf_shader shader, int uniform_loc, rf_mat mat);
|
||||||
|
void rf_gfx_set_shader_value_texture(rf_shader shader, int uniform_loc, rf_texture2d texture);
|
||||||
|
rf_mat rf_gfx_get_matrix_projection();
|
||||||
|
rf_mat rf_gfx_get_matrix_modelview();
|
||||||
|
void rf_gfx_set_matrix_projection(rf_mat proj);
|
||||||
|
void rf_gfx_set_matrix_modelview(rf_mat view);
|
||||||
|
void rf_gfx_blend_mode(rf_blend_mode mode);
|
||||||
|
void rf_gfx_matrix_mode(rf_matrix_mode mode);
|
||||||
|
void rf_gfx_push_matrix();
|
||||||
|
void rf_gfx_pop_matrix();
|
||||||
|
void rf_gfx_load_identity();
|
||||||
|
void rf_gfx_translatef(float x, float y, float z);
|
||||||
|
void rf_gfx_rotatef(float angleDeg, float x, float y, float z);
|
||||||
|
void rf_gfx_scalef(float x, float y, float z);
|
||||||
|
void rf_gfx_mult_matrixf(float* matf);
|
||||||
|
void rf_gfx_frustum(double left, double right, double bottom, double top, double znear, double zfar);
|
||||||
|
void rf_gfx_ortho(double left, double right, double bottom, double top, double znear, double zfar);
|
||||||
|
void rf_gfx_viewport(int x, int y, int width, int height);
|
||||||
|
void rf_gfx_begin(rf_drawing_mode mode);
|
||||||
|
void rf_gfx_end();
|
||||||
|
void rf_gfx_vertex2i(int x, int y);
|
||||||
|
void rf_gfx_vertex2f(float x, float y);
|
||||||
|
void rf_gfx_vertex3f(float x, float y, float z);
|
||||||
|
void rf_gfx_tex_coord2f(float x, float y);
|
||||||
|
void rf_gfx_normal3f(float x, float y, float z);
|
||||||
|
void rf_gfx_color4ub(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
|
||||||
|
void rf_gfx_color3f(float x, float y, float z);
|
||||||
|
void rf_gfx_color4f(float x, float y, float z, float w);
|
||||||
|
void rf_gfx_enable_texture(unsigned int id);
|
||||||
|
void rf_gfx_disable_texture();
|
||||||
|
void rf_gfx_set_texture_wrap(rf_texture2d texture, rf_texture_wrap_mode wrap_mode);
|
||||||
|
void rf_gfx_set_texture_filter(rf_texture2d texture, rf_texture_filter_mode filter_mode);
|
||||||
|
void rf_gfx_enable_render_texture(unsigned int id);
|
||||||
|
void rf_gfx_disable_render_texture(void);
|
||||||
|
void rf_gfx_enable_depth_test(void);
|
||||||
|
void rf_gfx_disable_depth_test(void);
|
||||||
|
void rf_gfx_enable_backface_culling(void);
|
||||||
|
void rf_gfx_disable_backface_culling(void);
|
||||||
|
void rf_gfx_enable_scissor_test(void);
|
||||||
|
void rf_gfx_disable_scissor_test(void);
|
||||||
|
void rf_gfx_scissor(int x, int y, int width, int height);
|
||||||
|
void rf_gfx_enable_wire_mode(void);
|
||||||
|
void rf_gfx_disable_wire_mode(void);
|
||||||
|
void rf_gfx_delete_textures(unsigned int id);
|
||||||
|
void rf_gfx_delete_render_textures(rf_render_texture2d target);
|
||||||
|
void rf_gfx_delete_shader(unsigned int id);
|
||||||
|
void rf_gfx_delete_vertex_arrays(unsigned int id);
|
||||||
|
void rf_gfx_delete_buffers(unsigned int id);
|
||||||
|
void rf_gfx_clear_color(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
|
||||||
|
void rf_gfx_clear_screen_buffers(void);
|
||||||
|
void rf_gfx_update_buffer(int buffer_id, void* data, int data_size);
|
||||||
|
unsigned int rf_gfx_load_attrib_buffer(unsigned int vao_id, int shader_loc, void* buffer, int size, bool dynamic);
|
||||||
|
void rf_gfx_init_vertex_buffer(struct rf_vertex_buffer* vertex_buffer);
|
||||||
|
void rf_gfx_close();
|
||||||
|
void rf_gfx_draw();
|
||||||
|
bool rf_gfx_check_buffer_limit(int v_count);
|
||||||
|
void rf_gfx_set_debug_marker(const char* text);
|
||||||
|
unsigned int rf_gfx_load_texture(void* data, int width, int height, rf_pixel_format format, int mipmap_count);
|
||||||
|
unsigned int rf_gfx_load_texture_depth(int width, int height, int bits, bool use_render_buffer);
|
||||||
|
unsigned int rf_gfx_load_texture_cubemap(void* data, int size, rf_pixel_format format);
|
||||||
|
void rf_gfx_update_texture(unsigned int id, int width, int height, rf_pixel_format format, const void* pixels, int pixels_size);
|
||||||
|
rf_gfx_pixel_format rf_gfx_get_internal_texture_formats(rf_pixel_format format);
|
||||||
|
void rf_gfx_unload_texture(unsigned int id);
|
||||||
|
void rf_gfx_generate_mipmaps(rf_texture2d* texture);
|
||||||
|
rf_image rf_gfx_read_texture_pixels_to_buffer(rf_texture2d texture, void* dst, int dst_size);
|
||||||
|
rf_image rf_gfx_read_texture_pixels(rf_texture2d texture, rf_allocator allocator);
|
||||||
|
void rf_gfx_read_screen_pixels(rf_color* dst, int width, int height);
|
||||||
|
rf_render_texture2d rf_gfx_load_render_texture(int width, int height, rf_pixel_format format, int depth_bits, bool use_depth_texture);
|
||||||
|
void rf_gfx_render_texture_attach(rf_render_texture2d target, unsigned int id, int attach_type);
|
||||||
|
bool rf_gfx_render_texture_complete(rf_render_texture2d target);
|
||||||
|
void rf_gfx_load_mesh(struct rf_mesh* mesh, bool dynamic);
|
||||||
|
void rf_gfx_update_mesh(struct rf_mesh mesh, int buffer, int num);
|
||||||
|
void rf_gfx_update_mesh_at(struct rf_mesh mesh, int buffer, int num, int index);
|
||||||
|
void rf_gfx_draw_mesh(struct rf_mesh mesh, struct rf_material material, rf_mat transform);
|
||||||
|
void rf_gfx_unload_mesh(struct rf_mesh mesh);
|
||||||
|
rf_render_batch rf_create_custom_render_batch_from_buffers(rf_vertex_buffer* vertex_buffers, rf_int vertex_buffers_count, rf_draw_call* draw_calls, rf_int draw_calls_count);
|
||||||
|
rf_render_batch rf_create_custom_render_batch(rf_int vertex_buffers_count, rf_int draw_calls_count, rf_int vertex_buffer_elements_count, rf_allocator allocator);
|
||||||
|
rf_render_batch rf_create_default_render_batch(rf_allocator allocator);
|
||||||
|
void rf_set_active_render_batch(rf_render_batch* batch);
|
||||||
|
void rf_unload_render_batch(rf_render_batch batch, rf_allocator allocator);
|
||||||
|
rf_texture2d rf_load_texture_from_file(const char* filename, rf_allocator temp_allocator, rf_io_callbacks io);
|
||||||
|
rf_texture2d rf_load_texture_from_file_data(const void* data, rf_int dst_size, rf_allocator temp_allocator);
|
||||||
|
rf_texture2d rf_load_texture_from_image(rf_image image);
|
||||||
|
rf_texture2d rf_load_texture_from_image_with_mipmaps(rf_mipmaps_image image);
|
||||||
|
rf_texture_cubemap rf_load_texture_cubemap_from_image(rf_image image, rf_cubemap_layout_type layout_type, rf_allocator temp_allocator);
|
||||||
|
rf_render_texture2d rf_load_render_texture(int width, int height);
|
||||||
|
void rf_update_texture(rf_texture2d texture, const void* pixels, rf_int pixels_size);
|
||||||
|
void rf_gen_texture_mipmaps(rf_texture2d* texture);
|
||||||
|
void rf_set_texture_filter(rf_texture2d texture, rf_texture_filter_mode filter_mode);
|
||||||
|
void rf_set_texture_wrap(rf_texture2d texture, rf_texture_wrap_mode wrap_mode);
|
||||||
|
void rf_unload_texture(rf_texture2d texture);
|
||||||
|
void rf_unload_render_texture(rf_render_texture2d target);
|
||||||
|
rf_texture2d rf_gen_texture_cubemap(rf_shader shader, rf_texture2d sky_hdr, rf_int size);
|
||||||
|
rf_texture2d rf_gen_texture_irradiance(rf_shader shader, rf_texture2d cubemap, rf_int size);
|
||||||
|
rf_texture2d rf_gen_texture_prefilter(rf_shader shader, rf_texture2d cubemap, rf_int size);
|
||||||
|
rf_texture2d rf_gen_texture_brdf(rf_shader shader, rf_int size);
|
||||||
|
rf_ttf_font_info rf_parse_ttf_font(const void* ttf_data, rf_int font_size);
|
||||||
|
void rf_compute_ttf_font_glyph_metrics(rf_ttf_font_info* font_info, const int* codepoints, rf_int codepoints_count, rf_glyph_info* dst, rf_int dst_count);
|
||||||
|
int rf_compute_ttf_font_atlas_width(int padding, rf_glyph_info* glyph_metrics, rf_int glyphs_count);
|
||||||
|
rf_image rf_generate_ttf_font_atlas(rf_ttf_font_info* font_info, int atlas_width, int padding, rf_glyph_info* glyphs, rf_int glyphs_count, rf_font_antialias antialias, unsigned short* dst, rf_int dst_count, rf_allocator temp_allocator);
|
||||||
|
rf_font rf_ttf_font_from_atlas(int font_size, rf_image atlas, rf_glyph_info* glyph_metrics, rf_int glyphs_count);
|
||||||
|
rf_font rf_load_ttf_font_from_data(const void* font_file_data, int font_size, rf_font_antialias antialias, const int* chars, rf_int char_count, rf_allocator allocator, rf_allocator temp_allocator);
|
||||||
|
rf_font rf_load_ttf_font_from_file(const char* filename, int font_size, rf_font_antialias antialias, rf_allocator allocator, rf_allocator temp_allocator, rf_io_callbacks io);
|
||||||
|
bool rf_compute_glyph_metrics_from_image(rf_image image, rf_color key, const int* codepoints, rf_glyph_info* dst, rf_int codepoints_and_dst_count);
|
||||||
|
rf_font rf_load_image_font_from_data(rf_image image, rf_glyph_info* glyphs, rf_int glyphs_count);
|
||||||
|
rf_font rf_load_image_font(rf_image image, rf_color key, rf_allocator allocator);
|
||||||
|
rf_font rf_load_image_font_from_file(const char* path, rf_color key, rf_allocator allocator, rf_allocator temp_allocator, rf_io_callbacks io);
|
||||||
|
void rf_unload_font(rf_font font, rf_allocator allocator);
|
||||||
|
rf_glyph_index rf_get_glyph_index(rf_font font, int character);
|
||||||
|
int rf_font_height(rf_font font, float font_size);
|
||||||
|
rf_sizef rf_measure_text(rf_font font, const char* text, float font_size, float extra_spacing);
|
||||||
|
rf_sizef rf_measure_text_rec(rf_font font, const char* text, rf_rec rec, float font_size, float extra_spacing, bool wrap);
|
||||||
|
rf_sizef rf_measure_string(rf_font font, const char* text, int len, float font_size, float extra_spacing);
|
||||||
|
rf_sizef rf_measure_string_rec(rf_font font, const char* text, int text_len, rf_rec rec, float font_size, float extra_spacing, bool wrap);
|
||||||
|
void rf_clear(rf_color color);
|
||||||
|
void rf_begin();
|
||||||
|
void rf_end();
|
||||||
|
void rf_begin_2d(rf_camera2d camera);
|
||||||
|
void rf_end_2d();
|
||||||
|
void rf_begin_3d(rf_camera3d camera);
|
||||||
|
void rf_end_3d();
|
||||||
|
void rf_begin_render_to_texture(rf_render_texture2d target);
|
||||||
|
void rf_end_render_to_texture();
|
||||||
|
void rf_begin_scissor_mode(int x, int y, int width, int height);
|
||||||
|
void rf_end_scissor_mode();
|
||||||
|
void rf_begin_shader(rf_shader shader);
|
||||||
|
void rf_end_shader();
|
||||||
|
void rf_begin_blend_mode(rf_blend_mode mode);
|
||||||
|
void rf_end_blend_mode();
|
||||||
|
void rf_draw_pixel(int pos_x, int pos_y, rf_color color);
|
||||||
|
void rf_draw_pixel_v(rf_vec2 position, rf_color color);
|
||||||
|
void rf_draw_line(int startPosX, int startPosY, int endPosX, int endPosY, rf_color color);
|
||||||
|
void rf_draw_line_v(rf_vec2 startPos, rf_vec2 endPos, rf_color color);
|
||||||
|
void rf_draw_line_ex(rf_vec2 startPos, rf_vec2 endPos, float thick, rf_color color);
|
||||||
|
void rf_draw_line_bezier(rf_vec2 start_pos, rf_vec2 end_pos, float thick, rf_color color);
|
||||||
|
void rf_draw_line_strip(rf_vec2* points, int num_points, rf_color color);
|
||||||
|
void rf_draw_circle(int center_x, int center_y, float radius, rf_color color);
|
||||||
|
void rf_draw_circle_v(rf_vec2 center, float radius, rf_color color);
|
||||||
|
void rf_draw_circle_sector(rf_vec2 center, float radius, int start_angle, int end_angle, int segments, rf_color color);
|
||||||
|
void rf_draw_circle_sector_lines(rf_vec2 center, float radius, int start_angle, int end_angle, int segments, rf_color color);
|
||||||
|
void rf_draw_circle_gradient(int center_x, int center_y, float radius, rf_color color1, rf_color color2);
|
||||||
|
void rf_draw_circle_lines(int center_x, int center_y, float radius, rf_color color);
|
||||||
|
void rf_draw_ring(rf_vec2 center, float inner_radius, float outer_radius, int start_angle, int end_angle, int segments, rf_color color);
|
||||||
|
void rf_draw_ring_lines(rf_vec2 center, float inner_radius, float outer_radius, int start_angle, int end_angle, int segments, rf_color color);
|
||||||
|
void rf_draw_rectangle(int posX, int posY, int width, int height, rf_color color);
|
||||||
|
void rf_draw_rectangle_v(rf_vec2 position, rf_vec2 size, rf_color color);
|
||||||
|
void rf_draw_rectangle_rec(rf_rec rec, rf_color color);
|
||||||
|
void rf_draw_rectangle_pro(rf_rec rec, rf_vec2 origin, float rotation, rf_color color);
|
||||||
|
void rf_draw_rectangle_gradient_v(int pos_x, int pos_y, int width, int height, rf_color color1, rf_color color2);// Draw a vertical-gradient-filled rectangle
|
||||||
|
void rf_draw_rectangle_gradient_h(int pos_x, int pos_y, int width, int height, rf_color color1, rf_color color2);// Draw a horizontal-gradient-filled rectangle
|
||||||
|
void rf_draw_rectangle_gradient(rf_rec rec, rf_color col1, rf_color col2, rf_color col3, rf_color col4);
|
||||||
|
void rf_draw_rectangle_outline(rf_rec rec, int line_thick, rf_color color);
|
||||||
|
void rf_draw_rectangle_rounded(rf_rec rec, float roundness, int segments, rf_color color);
|
||||||
|
void rf_draw_rectangle_rounded_lines(rf_rec rec, float roundness, int segments, int line_thick, rf_color color);
|
||||||
|
void rf_draw_triangle(rf_vec2 v1, rf_vec2 v2, rf_vec2 v3, rf_color color);
|
||||||
|
void rf_draw_triangle_lines(rf_vec2 v1, rf_vec2 v2, rf_vec2 v3, rf_color color);
|
||||||
|
void rf_draw_triangle_fan(rf_vec2* points, int num_points, rf_color color);
|
||||||
|
void rf_draw_triangle_strip(rf_vec2* points, int points_count, rf_color color);
|
||||||
|
void rf_draw_poly(rf_vec2 center, int sides, float radius, float rotation, rf_color color);
|
||||||
|
void rf_draw_texture(rf_texture2d texture, int x, int y, rf_color tint);
|
||||||
|
void rf_draw_texture_ex(rf_texture2d texture, int x, int y, int w, int h, float rotation, rf_color tint);
|
||||||
|
void rf_draw_texture_region(rf_texture2d texture, rf_rec source_rec, rf_rec dest_rec, rf_vec2 origin, float rotation, rf_color tint);
|
||||||
|
void rf_draw_texture_npatch(rf_texture2d texture, rf_npatch_info n_patch_info, rf_rec dest_rec, rf_vec2 origin, float rotation, rf_color tint);
|
||||||
|
void rf_draw_string(const char* string, int string_len, int posX, int posY, int font_size, rf_color color);
|
||||||
|
void rf_draw_string_ex(rf_font font, const char* string, int string_len, rf_vec2 position, float fontSize, float spacing, rf_color tint);
|
||||||
|
void rf_draw_string_wrap(rf_font font, const char* string, int string_len, rf_vec2 position, float font_size, float spacing, rf_color tint, float wrap_width, rf_text_wrap_mode mode);
|
||||||
|
void rf_draw_string_rec(rf_font font, const char* string, int string_len, rf_rec rec, float font_size, float spacing, rf_text_wrap_mode wrap, rf_color tint);
|
||||||
|
void rf_draw_text(const char* text, int posX, int posY, int font_size, rf_color color);
|
||||||
|
void rf_draw_text_ex(rf_font font, const char* text, rf_vec2 position, float fontSize, float spacing, rf_color tint);
|
||||||
|
void rf_draw_text_wrap(rf_font font, const char* text, rf_vec2 position, float font_size, float spacing, rf_color tint, float wrap_width, rf_text_wrap_mode mode);
|
||||||
|
void rf_draw_text_rec(rf_font font, const char* text, rf_rec rec, float font_size, float spacing, rf_text_wrap_mode wrap, rf_color tint);
|
||||||
|
void rf_draw_line3d(rf_vec3 start_pos, rf_vec3 end_pos, rf_color color);
|
||||||
|
void rf_draw_circle3d(rf_vec3 center, float radius, rf_vec3 rotation_axis, float rotation_angle, rf_color color);
|
||||||
|
void rf_draw_cube(rf_vec3 position, float width, float height, float length, rf_color color);
|
||||||
|
void rf_draw_cube_wires(rf_vec3 position, float width, float height, float length, rf_color color);
|
||||||
|
void rf_draw_cube_texture(rf_texture2d texture, rf_vec3 position, float width, float height, float length, rf_color color);
|
||||||
|
void rf_draw_sphere(rf_vec3 center_pos, float radius, rf_color color);
|
||||||
|
void rf_draw_sphere_ex(rf_vec3 center_pos, float radius, int rings, int slices, rf_color color);
|
||||||
|
void rf_draw_sphere_wires(rf_vec3 center_pos, float radius, int rings, int slices, rf_color color);
|
||||||
|
void rf_draw_cylinder(rf_vec3 position, float radius_top, float radius_bottom, float height, int slices, rf_color color);
|
||||||
|
void rf_draw_cylinder_wires(rf_vec3 position, float radius_top, float radius_bottom, float height, int slices, rf_color color);
|
||||||
|
void rf_draw_plane(rf_vec3 center_pos, rf_vec2 size, rf_color color);
|
||||||
|
void rf_draw_ray(rf_ray ray, rf_color color);
|
||||||
|
void rf_draw_grid(int slices, float spacing);
|
||||||
|
void rf_draw_gizmo(rf_vec3 position);
|
||||||
|
void rf_draw_model(rf_model model, rf_vec3 position, float scale, rf_color tint);
|
||||||
|
void rf_draw_model_ex(rf_model model, rf_vec3 position, rf_vec3 rotation_axis, float rotation_angle, rf_vec3 scale, rf_color tint);
|
||||||
|
void rf_draw_model_wires(rf_model model, rf_vec3 position, rf_vec3 rotation_axis, float rotation_angle, rf_vec3 scale, rf_color tint);
|
||||||
|
void rf_draw_bounding_box(rf_bounding_box box, rf_color color);
|
||||||
|
void rf_draw_billboard(rf_camera3d camera, rf_texture2d texture, rf_vec3 center, float size, rf_color tint);
|
||||||
|
void rf_draw_billboard_rec(rf_camera3d camera, rf_texture2d texture, rf_rec source_rec, rf_vec3 center, float size, rf_color tint);
|
||||||
|
rf_bounding_box rf_mesh_bounding_box(rf_mesh mesh);
|
||||||
|
void rf_mesh_compute_tangents(rf_mesh* mesh, rf_allocator allocator, rf_allocator temp_allocator);
|
||||||
|
void rf_mesh_compute_binormals(rf_mesh* mesh);
|
||||||
|
void rf_unload_mesh(rf_mesh mesh, rf_allocator allocator);
|
||||||
|
rf_model rf_load_model(const char* filename, rf_allocator allocator, rf_allocator temp_allocator, rf_io_callbacks io);
|
||||||
|
rf_model rf_load_model_from_obj(const char* filename, rf_allocator allocator, rf_allocator temp_allocator, rf_io_callbacks io);
|
||||||
|
rf_model rf_load_model_from_iqm(const char* filename, rf_allocator allocator, rf_allocator temp_allocator, rf_io_callbacks io);
|
||||||
|
rf_model rf_load_model_from_gltf(const char* filename, rf_allocator allocator, rf_allocator temp_allocator, rf_io_callbacks io);
|
||||||
|
rf_model rf_load_model_from_mesh(rf_mesh mesh, rf_allocator allocator);
|
||||||
|
void rf_unload_model(rf_model model, rf_allocator allocator);
|
||||||
|
rf_materials_array rf_load_materials_from_mtl(const char* filename, rf_allocator allocator, rf_io_callbacks io);
|
||||||
|
void rf_unload_material(rf_material material, rf_allocator allocator);
|
||||||
|
rf_model_animation_array rf_load_model_animations_from_iqm_file(const char* filename, rf_allocator allocator, rf_allocator temp_allocator, rf_io_callbacks io);
|
||||||
|
rf_model_animation_array rf_load_model_animations_from_iqm(const unsigned char* data, int data_size, rf_allocator allocator, rf_allocator temp_allocator);
|
||||||
|
void rf_update_model_animation(rf_model model, rf_model_animation anim, int frame);
|
||||||
|
bool rf_is_model_animation_valid(rf_model model, rf_model_animation anim);
|
||||||
|
void rf_unload_model_animation(rf_model_animation anim, rf_allocator allocator);
|
||||||
|
rf_mesh rf_gen_mesh_cube(float width, float height, float length, rf_allocator allocator, rf_allocator temp_allocator);
|
||||||
|
rf_mesh rf_gen_mesh_poly(int sides, float radius, rf_allocator allocator, rf_allocator temp_allocator);
|
||||||
|
rf_mesh rf_gen_mesh_plane(float width, float length, int res_x, int res_z, rf_allocator allocator, rf_allocator temp_allocator);
|
||||||
|
rf_mesh rf_gen_mesh_sphere(float radius, int rings, int slices, rf_allocator allocator, rf_allocator temp_allocator);
|
||||||
|
rf_mesh rf_gen_mesh_hemi_sphere(float radius, int rings, int slices, rf_allocator allocator, rf_allocator temp_allocator);
|
||||||
|
rf_mesh rf_gen_mesh_cylinder(float radius, float height, int slices, rf_allocator allocator, rf_allocator temp_allocator);
|
||||||
|
rf_mesh rf_gen_mesh_torus(float radius, float size, int rad_seg, int sides, rf_allocator allocator, rf_allocator temp_allocator);
|
||||||
|
rf_mesh rf_gen_mesh_knot(float radius, float size, int rad_seg, int sides, rf_allocator allocator, rf_allocator temp_allocator);
|
||||||
|
rf_mesh rf_gen_mesh_heightmap(rf_image heightmap, rf_vec3 size, rf_allocator allocator, rf_allocator temp_allocator);
|
||||||
|
rf_mesh rf_gen_mesh_cubicmap(rf_image cubicmap, rf_vec3 cube_size, rf_allocator allocator, rf_allocator temp_allocator);
|
||||||
|
void rf_init_context(rf_context* ctx);
|
||||||
|
void rf_init_gfx(int screen_width, int screen_height, rf_gfx_backend_data* gfx_data);
|
||||||
|
rf_material rf_load_default_material(rf_allocator allocator);
|
||||||
|
rf_shader rf_load_default_shader();
|
||||||
|
rf_font rf_get_default_font();
|
||||||
|
rf_shader rf_get_default_shader();
|
||||||
|
rf_texture2d rf_get_default_texture();
|
||||||
|
rf_context* rf_get_context();
|
||||||
|
rf_image rf_get_screen_data(rf_color* dst, rf_int dst_size);
|
||||||
|
void rf_set_global_context_pointer(rf_context* ctx);
|
||||||
|
void rf_set_viewport(int width, int height);
|
||||||
|
void rf_set_shapes_texture(rf_texture2d texture, rf_rec source);
|
||||||
|
rf_material rf_load_default_material_ez();
|
||||||
|
rf_image rf_get_screen_data_ez();
|
||||||
|
rf_base64_output rf_decode_base64_ez(const unsigned char* input);
|
||||||
|
rf_image rf_gfx_read_texture_pixels_ez(rf_texture2d texture);
|
||||||
|
rf_color* rf_image_pixels_to_rgba32_ez(rf_image image);
|
||||||
|
rf_vec4* rf_image_compute_pixels_to_normalized_ez(rf_image image);
|
||||||
|
rf_palette rf_image_extract_palette_ez(rf_image image, int palette_size);
|
||||||
|
rf_image rf_load_image_from_file_data_ez(const void* src, int src_size);
|
||||||
|
rf_image rf_load_image_from_hdr_file_data_ez(const void* src, int src_size);
|
||||||
|
rf_image rf_load_image_from_file_ez(const char* filename);
|
||||||
|
void rf_unload_image_ez(rf_image image);
|
||||||
|
rf_image rf_image_copy_ez(rf_image image);
|
||||||
|
rf_image rf_image_crop_ez(rf_image image, rf_rec crop);
|
||||||
|
rf_image rf_image_resize_ez(rf_image image, int new_width, int new_height);
|
||||||
|
rf_image rf_image_resize_nn_ez(rf_image image, int new_width, int new_height);
|
||||||
|
rf_image rf_image_format_ez(rf_image image, rf_uncompressed_pixel_format new_format);
|
||||||
|
rf_image rf_image_alpha_clear_ez(rf_image image, rf_color color, float threshold);
|
||||||
|
rf_image rf_image_alpha_premultiply_ez(rf_image image);
|
||||||
|
rf_image rf_image_alpha_crop_ez(rf_image image, float threshold);
|
||||||
|
rf_image rf_image_dither_ez(rf_image image, int r_bpp, int g_bpp, int b_bpp, int a_bpp);
|
||||||
|
rf_image rf_image_flip_vertical_ez(rf_image image);
|
||||||
|
rf_image rf_image_flip_horizontal_ez(rf_image image);
|
||||||
|
rf_vec2 rf_get_seed_for_cellular_image_ez(int seeds_per_row, int tile_size, int i);
|
||||||
|
rf_image rf_gen_image_color_ez(int width, int height, rf_color color);
|
||||||
|
rf_image rf_gen_image_gradient_v_ez(int width, int height, rf_color top, rf_color bottom);
|
||||||
|
rf_image rf_gen_image_gradient_h_ez(int width, int height, rf_color left, rf_color right);
|
||||||
|
rf_image rf_gen_image_gradient_radial_ez(int width, int height, float density, rf_color inner, rf_color outer);
|
||||||
|
rf_image rf_gen_image_checked_ez(int width, int height, int checks_x, int checks_y, rf_color col1, rf_color col2);
|
||||||
|
rf_image rf_gen_image_white_noise_ez(int width, int height, float factor);
|
||||||
|
rf_image rf_gen_image_perlin_noise_ez(int width, int height, int offset_x, int offset_y, float scale);
|
||||||
|
rf_image rf_gen_image_cellular_ez(int width, int height, int tile_size);
|
||||||
|
rf_mipmaps_image rf_image_gen_mipmaps_ez(rf_image image, int gen_mipmaps_count);
|
||||||
|
void rf_unload_mipmaps_image_ez(rf_mipmaps_image image);
|
||||||
|
rf_mipmaps_image rf_load_dds_image_ez(const void* src, int src_size);
|
||||||
|
rf_mipmaps_image rf_load_dds_image_from_file_ez(const char* file);
|
||||||
|
rf_image rf_load_pkm_image_ez(const void* src, int src_size);
|
||||||
|
rf_image rf_load_pkm_image_from_file_ez(const char* file);
|
||||||
|
rf_mipmaps_image rf_load_ktx_image_ez(const void* src, int src_size);
|
||||||
|
rf_mipmaps_image rf_load_ktx_image_from_file_ez(const char* file);
|
||||||
|
rf_gif rf_load_animated_gif_ez(const void* data, int data_size);
|
||||||
|
rf_gif rf_load_animated_gif_file_ez(const char* filename);
|
||||||
|
void rf_unload_gif_ez(rf_gif gif);
|
||||||
|
rf_texture2d rf_load_texture_from_file_ez(const char* filename);
|
||||||
|
rf_texture2d rf_load_texture_from_file_data_ez(const void* data, int dst_size);
|
||||||
|
rf_texture_cubemap rf_load_texture_cubemap_from_image_ez(rf_image image, rf_cubemap_layout_type layout_type);
|
||||||
|
rf_font rf_load_ttf_font_from_data_ez(const void* font_file_data, int font_size, rf_font_antialias antialias, const int* chars, int chars_count);
|
||||||
|
rf_font rf_load_ttf_font_from_file_ez(const char* filename, int font_size, rf_font_antialias antialias);
|
||||||
|
rf_font rf_load_image_font_ez(rf_image image, rf_color key);
|
||||||
|
rf_font rf_load_image_font_from_file_ez(const char* path, rf_color key);
|
||||||
|
void rf_unload_font_ez(rf_font font);
|
||||||
|
rf_decoded_string rf_decode_utf8_ez(const char* text, int len);
|
||||||
|
void rf_image_draw_ez(rf_image* dst, rf_image src, rf_rec src_rec, rf_rec dst_rec, rf_color tint);
|
||||||
|
void rf_image_draw_rectangle_ez(rf_image* dst, rf_rec rec, rf_color color);
|
||||||
|
void rf_image_draw_rectangle_lines_ez(rf_image* dst, rf_rec rec, int thick, rf_color color);
|
||||||
|
void rf_mesh_compute_tangents_ez(rf_mesh* mesh);
|
||||||
|
void rf_unload_mesh_ez(rf_mesh mesh);
|
||||||
|
rf_model rf_load_model_ez(const char* filename);
|
||||||
|
rf_model rf_load_model_from_obj_ez(const char* filename);
|
||||||
|
rf_model rf_load_model_from_iqm_ez(const char* filename);
|
||||||
|
rf_model rf_load_model_from_gltf_ez(const char* filename);
|
||||||
|
rf_model rf_load_model_from_mesh_ez(rf_mesh mesh);
|
||||||
|
void rf_unload_model_ez(rf_model model);
|
||||||
|
rf_materials_array rf_load_materials_from_mtl_ez(const char* filename);
|
||||||
|
void rf_unload_material_ez(rf_material material);
|
||||||
|
rf_model_animation_array rf_load_model_animations_from_iqm_file_ez(const char* filename);
|
||||||
|
rf_model_animation_array rf_load_model_animations_from_iqm_ez(const unsigned char* data, int data_size);
|
||||||
|
void rf_unload_model_animation_ez(rf_model_animation anim);
|
||||||
|
rf_mesh rf_gen_mesh_cube_ez(float width, float height, float length);
|
||||||
|
rf_mesh rf_gen_mesh_poly_ez(int sides, float radius);
|
||||||
|
rf_mesh rf_gen_mesh_plane_ez(float width, float length, int res_x, int res_z);
|
||||||
|
rf_mesh rf_gen_mesh_sphere_ez(float radius, int rings, int slices);
|
||||||
|
rf_mesh rf_gen_mesh_hemi_sphere_ez(float radius, int rings, int slices);
|
||||||
|
rf_mesh rf_gen_mesh_cylinder_ez(float radius, float height, int slices);
|
||||||
|
rf_mesh rf_gen_mesh_torus_ez(float radius, float size, int rad_seg, int sides);
|
||||||
|
rf_mesh rf_gen_mesh_knot_ez(float radius, float size, int rad_seg, int sides);
|
||||||
|
rf_mesh rf_gen_mesh_heightmap_ez(rf_image heightmap, rf_vec3 size);
|
||||||
|
rf_mesh rf_gen_mesh_cubicmap_ez(rf_image cubicmap, rf_vec3 cube_size);
|
@ -2,7 +2,6 @@ void GuiEnable(void)
|
|||||||
void GuiDisable(void)
|
void GuiDisable(void)
|
||||||
void GuiLock(void)
|
void GuiLock(void)
|
||||||
void GuiUnlock(void)
|
void GuiUnlock(void)
|
||||||
bool GuiIsLocked(void)
|
|
||||||
void GuiFade(float alpha)
|
void GuiFade(float alpha)
|
||||||
void GuiSetState(int state)
|
void GuiSetState(int state)
|
||||||
int GuiGetState(void)
|
int GuiGetState(void)
|
||||||
@ -10,14 +9,20 @@ void GuiSetFont(Font font)
|
|||||||
Font GuiGetFont(void)
|
Font GuiGetFont(void)
|
||||||
void GuiSetStyle(int control, int property, int value)
|
void GuiSetStyle(int control, int property, int value)
|
||||||
int GuiGetStyle(int control, int property)
|
int GuiGetStyle(int control, int property)
|
||||||
|
void GuiEnableTooltip(void)
|
||||||
|
void GuiDisableTooltip(void)
|
||||||
|
void GuiSetTooltip(const char *tooltip)
|
||||||
|
void GuiClearTooltip(void)
|
||||||
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, const char *text)
|
void GuiPanel(Rectangle bounds)
|
||||||
Rectangle GuiScrollPanel(Rectangle bounds, const char *text, Rectangle content, Vector2 *scroll)
|
Rectangle GuiScrollPanel(Rectangle bounds, 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)
|
||||||
@ -32,23 +37,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)
|
||||||
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 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 textMaxSize, int *secretViewActive)
|
int GuiTextInputBox(Rectangle bounds, const char *title, const char *message, const char *buttons, char *text)
|
||||||
Color GuiColorPicker(Rectangle bounds, const char *text, Color color)
|
Color GuiColorPicker(Rectangle bounds, Color color)
|
||||||
Color GuiColorPanel(Rectangle bounds, const char *text, Color color)
|
Color GuiColorPanel(Rectangle bounds, Color color)
|
||||||
float GuiColorBarAlpha(Rectangle bounds, const char *text, float alpha)
|
float GuiColorBarAlpha(Rectangle bounds, float alpha)
|
||||||
float GuiColorBarHue(Rectangle bounds, const char *text, float value)
|
float GuiColorBarHue(Rectangle bounds, 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, int posX, int posY, int pixelSize, Color color)
|
void GuiDrawIcon(int iconId, Vector2 position, 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)
|
@ -1,98 +0,0 @@
|
|||||||
float Clamp(float value, float min, float max)
|
|
||||||
float Lerp(float start, float end, float amount)
|
|
||||||
float Normalize(float value, float start, float end)
|
|
||||||
float Remap(float value, float inputStart, float inputEnd, float outputStart, float outputEnd)
|
|
||||||
Vector2 Vector2Zero(void)
|
|
||||||
Vector2 Vector2One(void)
|
|
||||||
Vector2 Vector2Add(Vector2 v1, Vector2 v2)
|
|
||||||
Vector2 Vector2AddValue(Vector2 v, float add)
|
|
||||||
Vector2 Vector2Subtract(Vector2 v1, Vector2 v2)
|
|
||||||
Vector2 Vector2SubtractValue(Vector2 v, float sub)
|
|
||||||
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)
|
|
||||||
Vector2 Vector2MoveTowards(Vector2 v, Vector2 target, float maxDistance)
|
|
||||||
Vector3 Vector3Zero(void)
|
|
||||||
Vector3 Vector3One(void)
|
|
||||||
Vector3 Vector3Add(Vector3 v1, Vector3 v2)
|
|
||||||
Vector3 Vector3AddValue(Vector3 v, float add)
|
|
||||||
Vector3 Vector3Subtract(Vector3 v1, Vector3 v2)
|
|
||||||
Vector3 Vector3SubtractValue(Vector3 v, float sub)
|
|
||||||
Vector3 Vector3Scale(Vector3 v, float scalar)
|
|
||||||
Vector3 Vector3Multiply(Vector3 v1, Vector3 v2)
|
|
||||||
Vector3 Vector3CrossProduct(Vector3 v1, Vector3 v2)
|
|
||||||
Vector3 Vector3Perpendicular(Vector3 v)
|
|
||||||
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)
|
|
||||||
Vector3 Vector3Normalize(Vector3 v)
|
|
||||||
void Vector3OrthoNormalize(Vector3 *v1, Vector3 *v2)
|
|
||||||
Vector3 Vector3Transform(Vector3 v, Matrix mat)
|
|
||||||
Vector3 Vector3RotateByQuaternion(Vector3 v, Quaternion q)
|
|
||||||
Vector3 Vector3Lerp(Vector3 v1, Vector3 v2, float amount)
|
|
||||||
Vector3 Vector3Reflect(Vector3 v, Vector3 normal)
|
|
||||||
Vector3 Vector3Min(Vector3 v1, Vector3 v2)
|
|
||||||
Vector3 Vector3Max(Vector3 v1, Vector3 v2)
|
|
||||||
Vector3 Vector3Barycenter(Vector3 p, Vector3 a, Vector3 b, Vector3 c)
|
|
||||||
float3 Vector3ToFloatV(Vector3 v)
|
|
||||||
float MatrixDeterminant(Matrix mat)
|
|
||||||
float MatrixTrace(Matrix mat)
|
|
||||||
Matrix MatrixTranspose(Matrix mat)
|
|
||||||
Matrix MatrixInvert(Matrix mat)
|
|
||||||
Matrix MatrixIdentity(void)
|
|
||||||
Matrix MatrixAdd(Matrix left, Matrix right)
|
|
||||||
Matrix MatrixSubtract(Matrix left, Matrix right)
|
|
||||||
Matrix MatrixMultiply(Matrix left, Matrix right)
|
|
||||||
Matrix MatrixTranslate(float x, float y, float z)
|
|
||||||
Matrix MatrixRotate(Vector3 axis, float angle)
|
|
||||||
Matrix MatrixRotateX(float angle)
|
|
||||||
Matrix MatrixRotateY(float angle)
|
|
||||||
Matrix MatrixRotateZ(float angle)
|
|
||||||
Matrix MatrixRotateXYZ(Vector3 ang)
|
|
||||||
Matrix MatrixRotateZYX(Vector3 ang)
|
|
||||||
Matrix MatrixScale(float x, float y, float z)
|
|
||||||
Matrix MatrixFrustum(double left, double right, double bottom, double top, double near, double far)
|
|
||||||
Matrix MatrixPerspective(double fovy, double aspect, double near, double far)
|
|
||||||
Matrix MatrixOrtho(double left, double right, double bottom, double top, double near, double far)
|
|
||||||
Matrix MatrixLookAt(Vector3 eye, Vector3 target, Vector3 up)
|
|
||||||
float16 MatrixToFloatV(Matrix mat)
|
|
||||||
Quaternion QuaternionAdd(Quaternion q1, Quaternion q2)
|
|
||||||
Quaternion QuaternionAddValue(Quaternion q, float add)
|
|
||||||
Quaternion QuaternionSubtract(Quaternion q1, Quaternion q2)
|
|
||||||
Quaternion QuaternionSubtractValue(Quaternion q, float sub)
|
|
||||||
Quaternion QuaternionIdentity(void)
|
|
||||||
float QuaternionLength(Quaternion q)
|
|
||||||
Quaternion QuaternionNormalize(Quaternion q)
|
|
||||||
Quaternion QuaternionInvert(Quaternion q)
|
|
||||||
Quaternion QuaternionMultiply(Quaternion q1, Quaternion q2)
|
|
||||||
Quaternion QuaternionScale(Quaternion q, float mul)
|
|
||||||
Quaternion QuaternionDivide(Quaternion q1, Quaternion q2)
|
|
||||||
Quaternion QuaternionLerp(Quaternion q1, Quaternion q2, float amount)
|
|
||||||
Quaternion QuaternionNlerp(Quaternion q1, Quaternion q2, float amount)
|
|
||||||
Quaternion QuaternionSlerp(Quaternion q1, Quaternion q2, float amount)
|
|
||||||
Quaternion QuaternionFromVector3ToVector3(Vector3 from, Vector3 to)
|
|
||||||
Quaternion QuaternionFromMatrix(Matrix mat)
|
|
||||||
Matrix QuaternionToMatrix(Quaternion q)
|
|
||||||
Quaternion QuaternionFromAxisAngle(Vector3 axis, float angle)
|
|
||||||
void QuaternionToAxisAngle(Quaternion q, Vector3 *outAxis, float *outAngle)
|
|
||||||
Quaternion QuaternionFromEuler(float pitch, float yaw, float roll)
|
|
||||||
Vector3 QuaternionToEuler(Quaternion q)
|
|
||||||
Quaternion QuaternionTransform(Quaternion q, Matrix mat)
|
|
||||||
Vector3 Vector3Unproject(Vector3 source, Matrix projection, Matrix view)
|
|
146
tools/rlgl.h
146
tools/rlgl.h
@ -1,146 +0,0 @@
|
|||||||
void rlMatrixMode(int mode)
|
|
||||||
void rlPushMatrix(void)
|
|
||||||
void rlPopMatrix(void)
|
|
||||||
void rlLoadIdentity(void)
|
|
||||||
void rlTranslatef(float x, float y, float z)
|
|
||||||
void rlRotatef(float angle, float x, float y, float z)
|
|
||||||
void rlScalef(float x, float y, float z)
|
|
||||||
void rlMultMatrixf(float *matf)
|
|
||||||
void rlFrustum(double left, double right, double bottom, double top, double znear, double zfar)
|
|
||||||
void rlOrtho(double left, double right, double bottom, double top, double znear, double zfar)
|
|
||||||
void rlViewport(int x, int y, int width, int height)
|
|
||||||
void rlBegin(int mode)
|
|
||||||
void rlEnd(void)
|
|
||||||
void rlVertex2i(int x, int y)
|
|
||||||
void rlVertex2f(float x, float y)
|
|
||||||
void rlVertex3f(float x, float y, float z)
|
|
||||||
void rlTexCoord2f(float x, float y)
|
|
||||||
void rlNormal3f(float x, float y, float z)
|
|
||||||
void rlColor4ub(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
|
|
||||||
void rlColor3f(float x, float y, float z)
|
|
||||||
void rlColor4f(float x, float y, float z, float w)
|
|
||||||
bool rlEnableVertexArray(unsigned int vaoId)
|
|
||||||
void rlDisableVertexArray(void)
|
|
||||||
void rlEnableVertexBuffer(unsigned int id)
|
|
||||||
void rlDisableVertexBuffer(void)
|
|
||||||
void rlEnableVertexBufferElement(unsigned int id)
|
|
||||||
void rlDisableVertexBufferElement(void)
|
|
||||||
void rlEnableVertexAttribute(unsigned int index)
|
|
||||||
void rlDisableVertexAttribute(unsigned int index)
|
|
||||||
#if defined(GRAPHICS_API_OPENGL_11)
|
|
||||||
void rlEnableStatePointer(int vertexAttribType, void *buffer)
|
|
||||||
void rlDisableStatePointer(int vertexAttribType)
|
|
||||||
#endif
|
|
||||||
void rlActiveTextureSlot(int slot)
|
|
||||||
void rlEnableTexture(unsigned int id)
|
|
||||||
void rlDisableTexture(void)
|
|
||||||
void rlEnableTextureCubemap(unsigned int id)
|
|
||||||
void rlDisableTextureCubemap(void)
|
|
||||||
void rlTextureParameters(unsigned int id, int param, int value)
|
|
||||||
void rlEnableShader(unsigned int id)
|
|
||||||
void rlDisableShader(void)
|
|
||||||
void rlEnableFramebuffer(unsigned int id)
|
|
||||||
void rlDisableFramebuffer(void)
|
|
||||||
void rlActiveDrawBuffers(int count)
|
|
||||||
void rlEnableColorBlend(void)
|
|
||||||
void rlDisableColorBlend(void)
|
|
||||||
void rlEnableDepthTest(void)
|
|
||||||
void rlDisableDepthTest(void)
|
|
||||||
void rlEnableDepthMask(void)
|
|
||||||
void rlDisableDepthMask(void)
|
|
||||||
void rlEnableBackfaceCulling(void)
|
|
||||||
void rlDisableBackfaceCulling(void)
|
|
||||||
void rlEnableScissorTest(void)
|
|
||||||
void rlDisableScissorTest(void)
|
|
||||||
void rlScissor(int x, int y, int width, int height)
|
|
||||||
void rlEnableWireMode(void)
|
|
||||||
void rlDisableWireMode(void)
|
|
||||||
void rlSetLineWidth(float width)
|
|
||||||
float rlGetLineWidth(void)
|
|
||||||
void rlEnableSmoothLines(void)
|
|
||||||
void rlDisableSmoothLines(void)
|
|
||||||
void rlEnableStereoRender(void)
|
|
||||||
void rlDisableStereoRender(void)
|
|
||||||
bool rlIsStereoRenderEnabled(void)
|
|
||||||
void rlClearColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
|
|
||||||
void rlClearScreenBuffers(void)
|
|
||||||
void rlCheckErrors(void)
|
|
||||||
void rlSetBlendMode(int mode)
|
|
||||||
void rlSetBlendFactors(int glSrcFactor, int glDstFactor, int glEquation)
|
|
||||||
void rlglInit(int width, int height)
|
|
||||||
void rlglClose(void)
|
|
||||||
void rlLoadExtensions(void *loader)
|
|
||||||
int rlGetVersion(void)
|
|
||||||
int rlGetFramebufferWidth(void)
|
|
||||||
int rlGetFramebufferHeight(void)
|
|
||||||
unsigned int rlGetTextureIdDefault(void)
|
|
||||||
unsigned int rlGetShaderIdDefault(void)
|
|
||||||
int *rlGetShaderLocsDefault(void)
|
|
||||||
rlRenderBatch rlLoadRenderBatch(int numBuffers, int bufferElements)
|
|
||||||
void rlUnloadRenderBatch(rlRenderBatch batch)
|
|
||||||
void rlDrawRenderBatch(rlRenderBatch *batch)
|
|
||||||
void rlSetRenderBatchActive(rlRenderBatch *batch)
|
|
||||||
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)
|
|
||||||
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 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 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)
|
|
||||||
unsigned int rlLoadTextureDepth(int width, int height, bool useRenderBuffer)
|
|
||||||
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 rlGetGlTextureFormats(int format, int *glInternalFormat, int *glFormat, int *glType)
|
|
||||||
const char *rlGetPixelFormatName(unsigned int format)
|
|
||||||
void rlUnloadTexture(unsigned int id)
|
|
||||||
void rlGenTextureMipmaps(unsigned int id, int width, int height, int format, int *mipmaps)
|
|
||||||
void *rlReadTexturePixels(unsigned int id, int width, int height, int format)
|
|
||||||
unsigned char *rlReadScreenPixels(int width, int height)
|
|
||||||
unsigned int rlLoadFramebuffer(int width, int height)
|
|
||||||
void rlFramebufferAttach(unsigned int fboId, unsigned int texId, int attachType, int texType, int mipLevel)
|
|
||||||
bool rlFramebufferComplete(unsigned int id)
|
|
||||||
void rlUnloadFramebuffer(unsigned int id)
|
|
||||||
unsigned int rlLoadShaderCode(const char *vsCode, const char *fsCode)
|
|
||||||
unsigned int rlCompileShader(const char *shaderCode, int type)
|
|
||||||
unsigned int rlLoadShaderProgram(unsigned int vShaderId, unsigned int fShaderId)
|
|
||||||
void rlUnloadShaderProgram(unsigned int id)
|
|
||||||
int rlGetLocationUniform(unsigned int shaderId, const char *uniformName)
|
|
||||||
int rlGetLocationAttrib(unsigned int shaderId, const char *attribName)
|
|
||||||
void rlSetUniform(int locIndex, const void *value, int uniformType, int count)
|
|
||||||
void rlSetUniformMatrix(int locIndex, Matrix mat)
|
|
||||||
void rlSetUniformSampler(int locIndex, unsigned int textureId)
|
|
||||||
void rlSetShader(unsigned int id, int *locs)
|
|
||||||
#if defined(GRAPHICS_API_OPENGL_43)
|
|
||||||
unsigned int rlLoadComputeShaderProgram(int shaderId)
|
|
||||||
void rlComputeShaderDispatch(unsigned int groupX, unsigned int groupY, unsigned int groupZ)
|
|
||||||
unsigned int rlLoadShaderBuffer(unsigned long long size, const void *data, int usageHint)
|
|
||||||
void rlUnloadShaderBuffer(unsigned int ssboId)
|
|
||||||
void rlUpdateShaderBufferElements(unsigned int id, const void *data, unsigned long long dataSize, unsigned long long offset)
|
|
||||||
unsigned long long rlGetShaderBufferSize(unsigned int id)
|
|
||||||
void rlReadShaderBufferElements(unsigned int id, void *dest, unsigned long long count, unsigned long long offset)
|
|
||||||
void rlBindShaderBuffer(unsigned int id, unsigned int index)
|
|
||||||
void rlCopyBuffersElements(unsigned int destId, unsigned int srcId, unsigned long long destOffset, unsigned long long srcOffset, unsigned long long count)
|
|
||||||
void rlBindImageTexture(unsigned int id, unsigned int index, unsigned int format, int readonly)
|
|
||||||
#endif
|
|
||||||
Matrix rlGetMatrixModelview(void)
|
|
||||||
Matrix rlGetMatrixProjection(void)
|
|
||||||
Matrix rlGetMatrixTransform(void)
|
|
||||||
Matrix rlGetMatrixProjectionStereo(int eye)
|
|
||||||
Matrix rlGetMatrixViewOffsetStereo(int eye)
|
|
||||||
void rlSetMatrixProjection(Matrix proj)
|
|
||||||
void rlSetMatrixModelview(Matrix view)
|
|
||||||
void rlSetMatrixProjectionStereo(Matrix right, Matrix left)
|
|
||||||
void rlSetMatrixViewOffsetStereo(Matrix right, Matrix left)
|
|
||||||
void rlLoadDrawCube(void)
|
|
||||||
void rlLoadDrawQuad(void)
|
|
Loading…
Reference in New Issue
Block a user