Early work on raylib 4.0, updated all submodules
This commit is contained in:
parent
353b431aef
commit
8815751ac9
@ -4,10 +4,8 @@ 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
|
||||
|
||||
|
@ -9,11 +9,11 @@ while not rl.WindowShouldClose() do
|
||||
ball_position.x = rl.GetMouseX()
|
||||
ball_position.y = rl.GetMouseY()
|
||||
|
||||
if rl.IsMouseButtonPressed(rl.MOUSE_LEFT_BUTTON) then
|
||||
if rl.IsMouseButtonPressed(rl.MOUSE_BUTTON_LEFT) then
|
||||
ball_color = rl.MAROON
|
||||
elseif rl.IsMouseButtonPressed(rl.MOUSE_MIDDLE_BUTTON) then
|
||||
elseif rl.IsMouseButtonPressed(rl.MOUSE_BUTTON_MIDDLE) then
|
||||
ball_color = rl.LIME
|
||||
elseif rl.IsMouseButtonPressed(rl.MOUSE_RIGHT_BUTTON) then
|
||||
elseif rl.IsMouseButtonPressed(rl.MOUSE_BUTTON_RIGHT) then
|
||||
ball_color = rl.DARKBLUE
|
||||
end
|
||||
|
||||
|
@ -14,7 +14,7 @@ local exit_window = false
|
||||
while not exit_window and not rl.WindowShouldClose() do
|
||||
mouse_pos = rl.GetMousePosition()
|
||||
|
||||
if rl.IsMouseButtonPressed(rl.MOUSE_LEFT_BUTTON) then
|
||||
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)
|
||||
@ -24,7 +24,7 @@ while not exit_window and not rl.WindowShouldClose() do
|
||||
if drag_window then
|
||||
window_pos = window_pos + mouse_pos - pan_offset
|
||||
|
||||
if rl.IsMouseButtonReleased(rl.MOUSE_LEFT_BUTTON) then
|
||||
if rl.IsMouseButtonReleased(rl.MOUSE_BUTTON_RIGHT) then
|
||||
drag_window = false
|
||||
end
|
||||
|
||||
|
@ -20,13 +20,10 @@ local menu = lynx.menu ({
|
||||
})
|
||||
|
||||
rl.SetConfigFlags(rl.FLAG_VSYNC_HINT)
|
||||
--rl.SetTargetFPS(60)
|
||||
|
||||
rl.InitWindow(800, 450, "raylib [lua] example - lynx menu")
|
||||
|
||||
while not rl.WindowShouldClose() do
|
||||
rl.BeginDrawing()
|
||||
|
||||
rl.ClearBackground(rl.BLACK)
|
||||
local pos = rl.GetMousePosition()
|
||||
menu:input_mouse(pos.x, pos.y, 0)
|
||||
|
@ -37,9 +37,9 @@ while not rl.WindowShouldClose() do
|
||||
needsReset = true
|
||||
end
|
||||
|
||||
if rl.IsMouseButtonPressed(rl.MOUSE_LEFT_BUTTON) then
|
||||
if rl.IsMouseButtonPressed(rl.MOUSE_BUTTON_LEFT) then
|
||||
rl.CreatePhysicsBodyPolygon(rl.GetMousePosition(), rl.GetRandomValue(20, 80), rl.GetRandomValue(3, 8), 10);
|
||||
elseif rl.IsMouseButtonPressed(rl.MOUSE_RIGHT_BUTTON) then
|
||||
elseif rl.IsMouseButtonPressed(rl.MOUSE_BUTTON_RIGHT) then
|
||||
rl.CreatePhysicsBodyCircle(rl.GetMousePosition(), rl.GetRandomValue(10, 45), 10)
|
||||
end
|
||||
|
||||
|
2
luajit
2
luajit
@ -1 +1 @@
|
||||
Subproject commit 75ee3a6159f1831fa57992df3caf5a2c303c281a
|
||||
Subproject commit e4b4d9451402be704d5b47a359f640a29db4977f
|
2
raygui
2
raygui
@ -1 +1 @@
|
||||
Subproject commit d77bd5f3ef3c973811c5ef3f387e983628611e99
|
||||
Subproject commit e81fd89b6dcc97bf1cee7878e8c6cfcbca2583a7
|
2
raylib
2
raylib
@ -1 +1 @@
|
||||
Subproject commit 4c1af4cc90913559e629c85470308b9e1a68f9a3
|
||||
Subproject commit 9882796df04218403fda23e2adbab8f347f88270
|
467
src/raylib.lua
467
src/raylib.lua
@ -104,21 +104,21 @@ ffi.cdef [[
|
||||
int layout;
|
||||
} NPatchInfo;
|
||||
|
||||
typedef struct CharInfo {
|
||||
typedef struct GlyphInfo {
|
||||
int value;
|
||||
int offsetX;
|
||||
int offsetY;
|
||||
int advanceX;
|
||||
Image image;
|
||||
} CharInfo;
|
||||
} GlyphInfo;
|
||||
|
||||
typedef struct Font {
|
||||
int baseSize;
|
||||
int charsCount;
|
||||
int charsPadding;
|
||||
int glyphCount;
|
||||
int glyphPadding;
|
||||
Texture2D texture;
|
||||
Rectangle *recs;
|
||||
CharInfo *chars;
|
||||
GlyphInfo *glyphs;
|
||||
} Font;
|
||||
|
||||
typedef Font SpriteFont;
|
||||
@ -210,12 +210,12 @@ ffi.cdef [[
|
||||
Vector3 direction;
|
||||
} Ray;
|
||||
|
||||
typedef struct RayHitInfo {
|
||||
typedef struct RayCollision {
|
||||
bool hit;
|
||||
float distance;
|
||||
Vector3 position;
|
||||
Vector3 point;
|
||||
Vector3 normal;
|
||||
} RayHitInfo;
|
||||
} RayCollision;
|
||||
|
||||
typedef struct BoundingBox {
|
||||
Vector3 min;
|
||||
@ -223,7 +223,7 @@ ffi.cdef [[
|
||||
} BoundingBox;
|
||||
|
||||
typedef struct Wave {
|
||||
unsigned int sampleCount;
|
||||
unsigned int frameCount;
|
||||
unsigned int sampleRate;
|
||||
unsigned int sampleSize;
|
||||
unsigned int channels;
|
||||
@ -241,12 +241,12 @@ ffi.cdef [[
|
||||
|
||||
typedef struct Sound {
|
||||
AudioStream stream;
|
||||
unsigned int sampleCount;
|
||||
unsigned int frameCount;
|
||||
} Sound;
|
||||
|
||||
typedef struct Music {
|
||||
AudioStream stream;
|
||||
unsigned int sampleCount;
|
||||
unsigned int frameCount;
|
||||
bool looping;
|
||||
|
||||
int ctxType;
|
||||
@ -350,6 +350,10 @@ ffi.cdef [[
|
||||
KEY_X = 88,
|
||||
KEY_Y = 89,
|
||||
KEY_Z = 90,
|
||||
KEY_LEFT_BRACKET = 91,
|
||||
KEY_BACKSLASH = 92,
|
||||
KEY_RIGHT_BRACKET = 93,
|
||||
KEY_GRAVE = 96,
|
||||
KEY_SPACE = 32,
|
||||
KEY_ESCAPE = 256,
|
||||
KEY_ENTER = 257,
|
||||
@ -391,10 +395,6 @@ ffi.cdef [[
|
||||
KEY_RIGHT_ALT = 346,
|
||||
KEY_RIGHT_SUPER = 347,
|
||||
KEY_KB_MENU = 348,
|
||||
KEY_LEFT_BRACKET= 91,
|
||||
KEY_BACKSLASH = 92,
|
||||
KEY_RIGHT_BRACKET = 93,
|
||||
KEY_GRAVE = 96,
|
||||
KEY_KP_0 = 320,
|
||||
KEY_KP_1 = 321,
|
||||
KEY_KP_2 = 322,
|
||||
@ -420,9 +420,13 @@ ffi.cdef [[
|
||||
} KeyboardKey;
|
||||
|
||||
typedef enum {
|
||||
MOUSE_LEFT_BUTTON = 0,
|
||||
MOUSE_RIGHT_BUTTON = 1,
|
||||
MOUSE_MIDDLE_BUTTON = 2
|
||||
MOUSE_BUTTON_LEFT = 0,
|
||||
MOUSE_BUTTON_RIGHT = 1,
|
||||
MOUSE_BUTTON_MIDDLE = 2,
|
||||
MOUSE_BUTTON_SIDE = 3,
|
||||
MOUSE_BUTTON_EXTRA = 4,
|
||||
MOUSE_BUTTON_FORWARD = 5,
|
||||
MOUSE_BUTTON_BACK = 6
|
||||
} MouseButton;
|
||||
|
||||
typedef enum {
|
||||
@ -472,16 +476,16 @@ ffi.cdef [[
|
||||
|
||||
typedef enum {
|
||||
MATERIAL_MAP_ALBEDO = 0,
|
||||
MATERIAL_MAP_METALNESS = 1,
|
||||
MATERIAL_MAP_NORMAL = 2,
|
||||
MATERIAL_MAP_ROUGHNESS = 3,
|
||||
MATERIAL_MAP_METALNESS,
|
||||
MATERIAL_MAP_NORMAL,
|
||||
MATERIAL_MAP_ROUGHNESS,
|
||||
MATERIAL_MAP_OCCLUSION,
|
||||
MATERIAL_MAP_EMISSION,
|
||||
MATERIAL_MAP_HEIGHT,
|
||||
MATERIAL_MAP_BRDG,
|
||||
MATERIAL_MAP_CUBEMAP,
|
||||
MATERIAL_MAP_IRRADIANCE,
|
||||
MATERIAL_MAP_PREFILTER
|
||||
MATERIAL_MAP_PREFILTER,
|
||||
MATERIAL_MAP_BRDF,
|
||||
} MaterialMapIndex;
|
||||
|
||||
typedef enum {
|
||||
@ -492,10 +496,10 @@ ffi.cdef [[
|
||||
SHADER_LOC_VERTEX_TANGENT,
|
||||
SHADER_LOC_VERTEX_COLOR,
|
||||
SHADER_LOC_MATRIX_MVP,
|
||||
SHADER_LOC_MATRIX_MODEL,
|
||||
SHADER_LOC_MATRIX_NORMAL,
|
||||
SHADER_LOC_MATRIX_VIEW,
|
||||
SHADER_LOC_MATRIX_PROJECTION,
|
||||
SHADER_LOC_MATRIX_MODEL,
|
||||
SHADER_LOC_MATRIX_NORMAL,
|
||||
SHADER_LOC_VECTOR_VIEW,
|
||||
SHADER_LOC_COLOR_DIFFUSE,
|
||||
SHADER_LOC_COLOR_SPECULAR,
|
||||
@ -525,6 +529,13 @@ ffi.cdef [[
|
||||
SHADER_UNIFORM_SAMPLER2D
|
||||
} ShaderUniformDataType;
|
||||
|
||||
typedef enum {
|
||||
SHADER_ATTRIB_FLOAT = 0,
|
||||
SHADER_ATTRIB_VEC2,
|
||||
SHADER_ATTRIB_VEC3,
|
||||
SHADER_ATTRIB_VEC4
|
||||
} ShaderAttributeDataType;
|
||||
|
||||
typedef enum {
|
||||
PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1,
|
||||
PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA,
|
||||
@ -601,7 +612,7 @@ ffi.cdef [[
|
||||
GESTURE_SWIPE_DOWN = 128,
|
||||
GESTURE_PINCH_IN = 256,
|
||||
GESTURE_PINCH_OUT = 512
|
||||
} Gestures;
|
||||
} Gesture;
|
||||
|
||||
typedef enum {
|
||||
CAMERA_CUSTOM = 0,
|
||||
@ -633,6 +644,107 @@ ffi.cdef [[
|
||||
|
||||
-- rlgl cdef
|
||||
ffi.cdef [[
|
||||
typedef enum {
|
||||
RL_LOG_ALL = 0,
|
||||
RL_LOG_TRACE,
|
||||
RL_LOG_DEBUG,
|
||||
RL_LOG_INFO,
|
||||
RL_LOG_WARNING,
|
||||
RL_LOG_ERROR,
|
||||
RL_LOG_FATAL,
|
||||
RL_LOG_NONE
|
||||
} rlTraceLogLevel;
|
||||
|
||||
typedef enum {
|
||||
RL_PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1,
|
||||
RL_PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA,
|
||||
RL_PIXELFORMAT_UNCOMPRESSED_R5G6B5,
|
||||
RL_PIXELFORMAT_UNCOMPRESSED_R8G8B8,
|
||||
RL_PIXELFORMAT_UNCOMPRESSED_R5G5B5A1,
|
||||
RL_PIXELFORMAT_UNCOMPRESSED_R4G4B4A4,
|
||||
RL_PIXELFORMAT_UNCOMPRESSED_R8G8B8A8,
|
||||
RL_PIXELFORMAT_UNCOMPRESSED_R32,
|
||||
RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32,
|
||||
RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32A32,
|
||||
RL_PIXELFORMAT_COMPRESSED_DXT1_RGB,
|
||||
RL_PIXELFORMAT_COMPRESSED_DXT1_RGBA,
|
||||
RL_PIXELFORMAT_COMPRESSED_DXT3_RGBA,
|
||||
RL_PIXELFORMAT_COMPRESSED_DXT5_RGBA,
|
||||
RL_PIXELFORMAT_COMPRESSED_ETC1_RGB,
|
||||
RL_PIXELFORMAT_COMPRESSED_ETC2_RGB,
|
||||
RL_PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA,
|
||||
RL_PIXELFORMAT_COMPRESSED_PVRT_RGB,
|
||||
RL_PIXELFORMAT_COMPRESSED_PVRT_RGBA,
|
||||
RL_PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA,
|
||||
RL_PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA
|
||||
} rlPixelFormat;
|
||||
|
||||
typedef enum {
|
||||
RL_TEXTURE_FILTER_POINT = 0,
|
||||
RL_TEXTURE_FILTER_BILINEAR,
|
||||
RL_TEXTURE_FILTER_TRILINEAR,
|
||||
RL_TEXTURE_FILTER_ANISOTROPIC_4X,
|
||||
RL_TEXTURE_FILTER_ANISOTROPIC_8X,
|
||||
RL_TEXTURE_FILTER_ANISOTROPIC_16X,
|
||||
} rlTextureFilter;
|
||||
|
||||
typedef enum {
|
||||
RL_BLEND_ALPHA = 0,
|
||||
RL_BLEND_ADDITIVE,
|
||||
RL_BLEND_MULTIPLIED,
|
||||
RL_BLEND_ADD_COLORS,
|
||||
RL_BLEND_SUBTRACT_COLORS,
|
||||
RL_BLEND_CUSTOM
|
||||
} rlBlendMode;
|
||||
|
||||
typedef enum {
|
||||
RL_SHADER_LOC_VERTEX_POSITION = 0,
|
||||
RL_SHADER_LOC_VERTEX_TEXCOORD01,
|
||||
RL_SHADER_LOC_VERTEX_TEXCOORD02,
|
||||
RL_SHADER_LOC_VERTEX_NORMAL,
|
||||
RL_SHADER_LOC_VERTEX_TANGENT,
|
||||
RL_SHADER_LOC_VERTEX_COLOR,
|
||||
RL_SHADER_LOC_MATRIX_MVP,
|
||||
RL_SHADER_LOC_MATRIX_VIEW,
|
||||
RL_SHADER_LOC_MATRIX_PROJECTION,
|
||||
RL_SHADER_LOC_MATRIX_MODEL,
|
||||
RL_SHADER_LOC_MATRIX_NORMAL,
|
||||
RL_SHADER_LOC_VECTOR_VIEW,
|
||||
RL_SHADER_LOC_COLOR_DIFFUSE,
|
||||
RL_SHADER_LOC_COLOR_SPECULAR,
|
||||
RL_SHADER_LOC_COLOR_AMBIENT,
|
||||
RL_SHADER_LOC_MAP_ALBEDO,
|
||||
RL_SHADER_LOC_MAP_METALNESS,
|
||||
RL_SHADER_LOC_MAP_NORMAL,
|
||||
RL_SHADER_LOC_MAP_ROUGHNESS,
|
||||
RL_SHADER_LOC_MAP_OCCLUSION,
|
||||
RL_SHADER_LOC_MAP_EMISSION,
|
||||
RL_SHADER_LOC_MAP_HEIGHT,
|
||||
RL_SHADER_LOC_MAP_CUBEMAP,
|
||||
RL_SHADER_LOC_MAP_IRRADIANCE,
|
||||
RL_SHADER_LOC_MAP_PREFILTER,
|
||||
RL_SHADER_LOC_MAP_BRDF
|
||||
} rlShaderLocationIndex;
|
||||
|
||||
typedef enum {
|
||||
RL_SHADER_UNIFORM_FLOAT = 0,
|
||||
RL_SHADER_UNIFORM_VEC2,
|
||||
RL_SHADER_UNIFORM_VEC3,
|
||||
RL_SHADER_UNIFORM_VEC4,
|
||||
RL_SHADER_UNIFORM_INT,
|
||||
RL_SHADER_UNIFORM_IVEC2,
|
||||
RL_SHADER_UNIFORM_IVEC3,
|
||||
RL_SHADER_UNIFORM_IVEC4,
|
||||
RL_SHADER_UNIFORM_SAMPLER2D
|
||||
} rlShaderUniformDataType;
|
||||
|
||||
typedef enum {
|
||||
RL_SHADER_ATTRIB_FLOAT = 0,
|
||||
RL_SHADER_ATTRIB_VEC2,
|
||||
RL_SHADER_ATTRIB_VEC3,
|
||||
RL_SHADER_ATTRIB_VEC4
|
||||
} rlShaderAttributeDataType;
|
||||
|
||||
typedef enum {
|
||||
RL_ATTACHMENT_COLOR_CHANNEL0 = 0,
|
||||
RL_ATTACHMENT_COLOR_CHANNEL1,
|
||||
@ -644,7 +756,7 @@ ffi.cdef [[
|
||||
RL_ATTACHMENT_COLOR_CHANNEL7,
|
||||
RL_ATTACHMENT_DEPTH = 100,
|
||||
RL_ATTACHMENT_STENCIL = 200,
|
||||
} FramebufferAttachType;
|
||||
} rlFramebufferAttachType;
|
||||
|
||||
typedef enum {
|
||||
RL_ATTACHMENT_CUBEMAP_POSITIVE_X = 0,
|
||||
@ -655,11 +767,11 @@ ffi.cdef [[
|
||||
RL_ATTACHMENT_CUBEMAP_NEGATIVE_Z,
|
||||
RL_ATTACHMENT_TEXTURE2D = 100,
|
||||
RL_ATTACHMENT_RENDERBUFFER = 200,
|
||||
} FramebufferTexType;
|
||||
} rlFramebufferAttachTextureType;
|
||||
|
||||
/* NOTE: Assumes non-ES OpenGL. */
|
||||
typedef struct VertexBuffer {
|
||||
int elementsCount;
|
||||
typedef struct rlVertexBuffer {
|
||||
int elementCount;
|
||||
|
||||
int vCounter;
|
||||
int tcCounter;
|
||||
@ -672,9 +784,9 @@ ffi.cdef [[
|
||||
|
||||
unsigned int vaoId;
|
||||
unsigned int vboId[4];
|
||||
} VertexBuffer;
|
||||
} rlVertexBuffer;
|
||||
|
||||
typedef struct DrawCall {
|
||||
typedef struct rlDrawCall {
|
||||
int mode;
|
||||
int vertexCount;
|
||||
int vertexAlignment;
|
||||
@ -684,24 +796,17 @@ ffi.cdef [[
|
||||
|
||||
//Matrix projection;
|
||||
//Matrix modelview;
|
||||
} DrawCall;
|
||||
} rlDrawCall;
|
||||
|
||||
typedef struct RenderBatch {
|
||||
int buffersCount;
|
||||
typedef struct rlRenderBatch {
|
||||
int bufferCount;
|
||||
int currentBuffer;
|
||||
VertexBuffer *vertexBuffer;
|
||||
rlVertexBuffer *vertexBuffer;
|
||||
|
||||
DrawCall *draws;
|
||||
int drawsCounter;
|
||||
rlDrawCall *draws;
|
||||
int drawCounter;
|
||||
float currentDepth;
|
||||
} RenderBatch;
|
||||
|
||||
typedef enum {
|
||||
SHADER_ATTRIB_FLOAT = 0,
|
||||
SHADER_ATTRIB_VEC2,
|
||||
SHADER_ATTRIB_VEC3,
|
||||
SHADER_ATTRIB_VEC4
|
||||
} ShaderAttributeDataType;
|
||||
} rlRenderBatch;
|
||||
]]
|
||||
|
||||
-- Physac cdef
|
||||
@ -768,13 +873,18 @@ ffi.cdef [[
|
||||
|
||||
-- gestures cdef
|
||||
ffi.cdef [[
|
||||
typedef enum { TOUCH_UP, TOUCH_DOWN, TOUCH_MOVE } TouchAction;
|
||||
typedef enum {
|
||||
TOUCH_ACTION_UP = 0,
|
||||
TOUCH_ACTION_DOWN,
|
||||
TOUCH_ACTION_MOVE,
|
||||
TOUCH_ACTION_CANCEL
|
||||
} TouchAction;
|
||||
|
||||
typedef struct {
|
||||
int touchAction;
|
||||
int pointCount;
|
||||
int pointerId[4];
|
||||
Vector2 position[4];
|
||||
int pointerId[8]; // CONST
|
||||
Vector2 position[8]; // CONST
|
||||
} GestureEvent;
|
||||
]]
|
||||
|
||||
@ -918,6 +1028,265 @@ ffi.cdef [[
|
||||
int index;
|
||||
int select;
|
||||
} GuiTextBoxState;
|
||||
|
||||
typedef enum {
|
||||
RICON_NONE = 0,
|
||||
RICON_FOLDER_FILE_OPEN = 1,
|
||||
RICON_FILE_SAVE_CLASSIC = 2,
|
||||
RICON_FOLDER_OPEN = 3,
|
||||
RICON_FOLDER_SAVE = 4,
|
||||
RICON_FILE_OPEN = 5,
|
||||
RICON_FILE_SAVE = 6,
|
||||
RICON_FILE_EXPORT = 7,
|
||||
RICON_FILE_NEW = 8,
|
||||
RICON_FILE_DELETE = 9,
|
||||
RICON_FILETYPE_TEXT = 10,
|
||||
RICON_FILETYPE_AUDIO = 11,
|
||||
RICON_FILETYPE_IMAGE = 12,
|
||||
RICON_FILETYPE_PLAY = 13,
|
||||
RICON_FILETYPE_VIDEO = 14,
|
||||
RICON_FILETYPE_INFO = 15,
|
||||
RICON_FILE_COPY = 16,
|
||||
RICON_FILE_CUT = 17,
|
||||
RICON_FILE_PASTE = 18,
|
||||
RICON_CURSOR_HAND = 19,
|
||||
RICON_CURSOR_POINTER = 20,
|
||||
RICON_CURSOR_CLASSIC = 21,
|
||||
RICON_PENCIL = 22,
|
||||
RICON_PENCIL_BIG = 23,
|
||||
RICON_BRUSH_CLASSIC = 24,
|
||||
RICON_BRUSH_PAINTER = 25,
|
||||
RICON_WATER_DROP = 26,
|
||||
RICON_COLOR_PICKER = 27,
|
||||
RICON_RUBBER = 28,
|
||||
RICON_COLOR_BUCKET = 29,
|
||||
RICON_TEXT_T = 30,
|
||||
RICON_TEXT_A = 31,
|
||||
RICON_SCALE = 32,
|
||||
RICON_RESIZE = 33,
|
||||
RICON_FILTER_POINT = 34,
|
||||
RICON_FILTER_BILINEAR = 35,
|
||||
RICON_CROP = 36,
|
||||
RICON_CROP_ALPHA = 37,
|
||||
RICON_SQUARE_TOGGLE = 38,
|
||||
RICON_SYMMETRY = 39,
|
||||
RICON_SYMMETRY_HORIZONTAL = 40,
|
||||
RICON_SYMMETRY_VERTICAL = 41,
|
||||
RICON_LENS = 42,
|
||||
RICON_LENS_BIG = 43,
|
||||
RICON_EYE_ON = 44,
|
||||
RICON_EYE_OFF = 45,
|
||||
RICON_FILTER_TOP = 46,
|
||||
RICON_FILTER = 47,
|
||||
RICON_TARGET_POINT = 48,
|
||||
RICON_TARGET_SMALL = 49,
|
||||
RICON_TARGET_BIG = 50,
|
||||
RICON_TARGET_MOVE = 51,
|
||||
RICON_CURSOR_MOVE = 52,
|
||||
RICON_CURSOR_SCALE = 53,
|
||||
RICON_CURSOR_SCALE_RIGHT = 54,
|
||||
RICON_CURSOR_SCALE_LEFT = 55,
|
||||
RICON_UNDO = 56,
|
||||
RICON_REDO = 57,
|
||||
RICON_REREDO = 58,
|
||||
RICON_MUTATE = 59,
|
||||
RICON_ROTATE = 60,
|
||||
RICON_REPEAT = 61,
|
||||
RICON_SHUFFLE = 62,
|
||||
RICON_EMPTYBOX = 63,
|
||||
RICON_TARGET = 64,
|
||||
RICON_TARGET_SMALL_FILL = 65,
|
||||
RICON_TARGET_BIG_FILL = 66,
|
||||
RICON_TARGET_MOVE_FILL = 67,
|
||||
RICON_CURSOR_MOVE_FILL = 68,
|
||||
RICON_CURSOR_SCALE_FILL = 69,
|
||||
RICON_CURSOR_SCALE_RIGHT_FILL = 70,
|
||||
RICON_CURSOR_SCALE_LEFT_FILL = 71,
|
||||
RICON_UNDO_FILL = 72,
|
||||
RICON_REDO_FILL = 73,
|
||||
RICON_REREDO_FILL = 74,
|
||||
RICON_MUTATE_FILL = 75,
|
||||
RICON_ROTATE_FILL = 76,
|
||||
RICON_REPEAT_FILL = 77,
|
||||
RICON_SHUFFLE_FILL = 78,
|
||||
RICON_EMPTYBOX_SMALL = 79,
|
||||
RICON_BOX = 80,
|
||||
RICON_BOX_TOP = 81,
|
||||
RICON_BOX_TOP_RIGHT = 82,
|
||||
RICON_BOX_RIGHT = 83,
|
||||
RICON_BOX_BOTTOM_RIGHT = 84,
|
||||
RICON_BOX_BOTTOM = 85,
|
||||
RICON_BOX_BOTTOM_LEFT = 86,
|
||||
RICON_BOX_LEFT = 87,
|
||||
RICON_BOX_TOP_LEFT = 88,
|
||||
RICON_BOX_CENTER = 89,
|
||||
RICON_BOX_CIRCLE_MASK = 90,
|
||||
RICON_POT = 91,
|
||||
RICON_ALPHA_MULTIPLY = 92,
|
||||
RICON_ALPHA_CLEAR = 93,
|
||||
RICON_DITHERING = 94,
|
||||
RICON_MIPMAPS = 95,
|
||||
RICON_BOX_GRID = 96,
|
||||
RICON_GRID = 97,
|
||||
RICON_BOX_CORNERS_SMALL = 98,
|
||||
RICON_BOX_CORNERS_BIG = 99,
|
||||
RICON_FOUR_BOXES = 100,
|
||||
RICON_GRID_FILL = 101,
|
||||
RICON_BOX_MULTISIZE = 102,
|
||||
RICON_ZOOM_SMALL = 103,
|
||||
RICON_ZOOM_MEDIUM = 104,
|
||||
RICON_ZOOM_BIG = 105,
|
||||
RICON_ZOOM_ALL = 106,
|
||||
RICON_ZOOM_CENTER = 107,
|
||||
RICON_BOX_DOTS_SMALL = 108,
|
||||
RICON_BOX_DOTS_BIG = 109,
|
||||
RICON_BOX_CONCENTRIC = 110,
|
||||
RICON_BOX_GRID_BIG = 111,
|
||||
RICON_OK_TICK = 112,
|
||||
RICON_CROSS = 113,
|
||||
RICON_ARROW_LEFT = 114,
|
||||
RICON_ARROW_RIGHT = 115,
|
||||
RICON_ARROW_BOTTOM = 116,
|
||||
RICON_ARROW_TOP = 117,
|
||||
RICON_ARROW_LEFT_FILL = 118,
|
||||
RICON_ARROW_RIGHT_FILL = 119,
|
||||
RICON_ARROW_BOTTOM_FILL = 120,
|
||||
RICON_ARROW_TOP_FILL = 121,
|
||||
RICON_AUDIO = 122,
|
||||
RICON_FX = 123,
|
||||
RICON_WAVE = 124,
|
||||
RICON_WAVE_SINUS = 125,
|
||||
RICON_WAVE_SQUARE = 126,
|
||||
RICON_WAVE_TRIANGULAR = 127,
|
||||
RICON_CROSS_SMALL = 128,
|
||||
RICON_PLAYER_PREVIOUS = 129,
|
||||
RICON_PLAYER_PLAY_BACK = 130,
|
||||
RICON_PLAYER_PLAY = 131,
|
||||
RICON_PLAYER_PAUSE = 132,
|
||||
RICON_PLAYER_STOP = 133,
|
||||
RICON_PLAYER_NEXT = 134,
|
||||
RICON_PLAYER_RECORD = 135,
|
||||
RICON_MAGNET = 136,
|
||||
RICON_LOCK_CLOSE = 137,
|
||||
RICON_LOCK_OPEN = 138,
|
||||
RICON_CLOCK = 139,
|
||||
RICON_TOOLS = 140,
|
||||
RICON_GEAR = 141,
|
||||
RICON_GEAR_BIG = 142,
|
||||
RICON_BIN = 143,
|
||||
RICON_HAND_POINTER = 144,
|
||||
RICON_LASER = 145,
|
||||
RICON_COIN = 146,
|
||||
RICON_EXPLOSION = 147,
|
||||
RICON_1UP = 148,
|
||||
RICON_PLAYER = 149,
|
||||
RICON_PLAYER_JUMP = 150,
|
||||
RICON_KEY = 151,
|
||||
RICON_DEMON = 152,
|
||||
RICON_TEXT_POPUP = 153,
|
||||
RICON_GEAR_EX = 154,
|
||||
RICON_CRACK = 155,
|
||||
RICON_CRACK_POINTS = 156,
|
||||
RICON_STAR = 157,
|
||||
RICON_DOOR = 158,
|
||||
RICON_EXIT = 159,
|
||||
RICON_MODE_2D = 160,
|
||||
RICON_MODE_3D = 161,
|
||||
RICON_CUBE = 162,
|
||||
RICON_CUBE_FACE_TOP = 163,
|
||||
RICON_CUBE_FACE_LEFT = 164,
|
||||
RICON_CUBE_FACE_FRONT = 165,
|
||||
RICON_CUBE_FACE_BOTTOM = 166,
|
||||
RICON_CUBE_FACE_RIGHT = 167,
|
||||
RICON_CUBE_FACE_BACK = 168,
|
||||
RICON_CAMERA = 169,
|
||||
RICON_SPECIAL = 170,
|
||||
RICON_LINK_NET = 171,
|
||||
RICON_LINK_BOXES = 172,
|
||||
RICON_LINK_MULTI = 173,
|
||||
RICON_LINK = 174,
|
||||
RICON_LINK_BROKE = 175,
|
||||
RICON_TEXT_NOTES = 176,
|
||||
RICON_NOTEBOOK = 177,
|
||||
RICON_SUITCASE = 178,
|
||||
RICON_SUITCASE_ZIP = 179,
|
||||
RICON_MAILBOX = 180,
|
||||
RICON_MONITOR = 181,
|
||||
RICON_PRINTER = 182,
|
||||
RICON_PHOTO_CAMERA = 183,
|
||||
RICON_PHOTO_CAMERA_FLASH = 184,
|
||||
RICON_HOUSE = 185,
|
||||
RICON_HEART = 186,
|
||||
RICON_CORNER = 187,
|
||||
RICON_VERTICAL_BARS = 188,
|
||||
RICON_VERTICAL_BARS_FILL = 189,
|
||||
RICON_LIFE_BARS = 190,
|
||||
RICON_INFO = 191,
|
||||
RICON_CROSSLINE = 192,
|
||||
RICON_HELP = 193,
|
||||
RICON_FILETYPE_ALPHA = 194,
|
||||
RICON_FILETYPE_HOME = 195,
|
||||
RICON_LAYERS_VISIBLE = 196,
|
||||
RICON_LAYERS = 197,
|
||||
RICON_WINDOW = 198,
|
||||
RICON_HIDPI = 199,
|
||||
RICON_200 = 200,
|
||||
RICON_201 = 201,
|
||||
RICON_202 = 202,
|
||||
RICON_203 = 203,
|
||||
RICON_204 = 204,
|
||||
RICON_205 = 205,
|
||||
RICON_206 = 206,
|
||||
RICON_207 = 207,
|
||||
RICON_208 = 208,
|
||||
RICON_209 = 209,
|
||||
RICON_210 = 210,
|
||||
RICON_211 = 211,
|
||||
RICON_212 = 212,
|
||||
RICON_213 = 213,
|
||||
RICON_214 = 214,
|
||||
RICON_215 = 215,
|
||||
RICON_216 = 216,
|
||||
RICON_217 = 217,
|
||||
RICON_218 = 218,
|
||||
RICON_219 = 219,
|
||||
RICON_220 = 220,
|
||||
RICON_221 = 221,
|
||||
RICON_222 = 222,
|
||||
RICON_223 = 223,
|
||||
RICON_224 = 224,
|
||||
RICON_225 = 225,
|
||||
RICON_226 = 226,
|
||||
RICON_227 = 227,
|
||||
RICON_228 = 228,
|
||||
RICON_229 = 229,
|
||||
RICON_230 = 230,
|
||||
RICON_231 = 231,
|
||||
RICON_232 = 232,
|
||||
RICON_233 = 233,
|
||||
RICON_234 = 234,
|
||||
RICON_235 = 235,
|
||||
RICON_236 = 236,
|
||||
RICON_237 = 237,
|
||||
RICON_238 = 238,
|
||||
RICON_239 = 239,
|
||||
RICON_240 = 240,
|
||||
RICON_241 = 241,
|
||||
RICON_242 = 242,
|
||||
RICON_243 = 243,
|
||||
RICON_244 = 244,
|
||||
RICON_245 = 245,
|
||||
RICON_246 = 246,
|
||||
RICON_247 = 247,
|
||||
RICON_248 = 248,
|
||||
RICON_249 = 249,
|
||||
RICON_250 = 250,
|
||||
RICON_251 = 251,
|
||||
RICON_252 = 252,
|
||||
RICON_253 = 253,
|
||||
RICON_254 = 254,
|
||||
RICON_255 = 255,
|
||||
} guiIconName;
|
||||
]]
|
||||
|
||||
-- Load bind entry
|
||||
|
12
src/raylua.c
12
src/raylua.c
@ -24,16 +24,16 @@
|
||||
#include <rlgl.h>
|
||||
|
||||
#include <raymath.h>
|
||||
#include <easings.h>
|
||||
#include <gestures.h>
|
||||
#include <extras/easings.h>
|
||||
#include <rgestures.h>
|
||||
|
||||
#define RAYGUI_SUPPORT_ICONS
|
||||
#define RAYGUI_SUPPORT_RICONS
|
||||
#define RAYGUI_IMPLEMENTATION
|
||||
#define RAYGUI_STATIC
|
||||
#include <raygui.h>
|
||||
|
||||
#define PHYSAC_IMPLEMENTATION
|
||||
#include <physac.h>
|
||||
#include <extras/physac.h>
|
||||
|
||||
#include "autogen/bind.c"
|
||||
#include "autogen/boot.c"
|
||||
@ -65,6 +65,10 @@ void raylua_boot(lua_State *L, lua_CFunction loadfile, lua_CFunction listfiles,
|
||||
lua_pushboolean(L, repl);
|
||||
lua_settable(L, -3);
|
||||
|
||||
lua_pushstring(L, "raylib_version");
|
||||
lua_pushstring(L, RAYLIB_VERSION);
|
||||
lua_settable(L, -3);
|
||||
|
||||
lua_setglobal(L, "raylua");
|
||||
|
||||
if (luaL_dostring(L, raylua_boot_lua)) {
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
local load = loadstring
|
||||
|
||||
raylua.version = "v3.7a"
|
||||
raylua.version = "v4.0-dev"
|
||||
|
||||
function raylua.repl()
|
||||
print("> raylua " .. raylua.version .. " <")
|
||||
|
127
tools/api.h
127
tools/api.h
@ -37,6 +37,9 @@ 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)
|
||||
@ -83,6 +86,7 @@ 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, ...)
|
||||
@ -95,7 +99,7 @@ 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(unsigned char *text)
|
||||
void UnloadFileText(char *text)
|
||||
bool SaveFileText(const char *fileName, char *text)
|
||||
bool FileExists(const char *fileName)
|
||||
bool DirectoryExists(const char *dirPath)
|
||||
@ -143,6 +147,7 @@ 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)
|
||||
@ -151,10 +156,11 @@ 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)
|
||||
int GetTouchPointsCount(void)
|
||||
float GetGestureHoldDuration(void)
|
||||
Vector2 GetGestureDragVector(void)
|
||||
float GetGestureDragAngle(void)
|
||||
@ -174,7 +180,7 @@ 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 DrawLineStrip(Vector2 *points, int pointsCount, 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)
|
||||
@ -193,15 +199,16 @@ void DrawRectangleGradientV(int posX, int posY, int width, int height, Color col
|
||||
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, int lineThick, 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, int lineThick, 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 pointsCount, Color color)
|
||||
void DrawTriangleStrip(Vector2 *points, int pointsCount, 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)
|
||||
@ -214,6 +221,8 @@ 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)
|
||||
@ -252,7 +261,7 @@ 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 *colorsCount)
|
||||
Color *LoadImagePalette(Image image, int maxPaletteSize, int *colorCount)
|
||||
void UnloadImageColors(Color *colors)
|
||||
void UnloadImagePalette(Color *colors)
|
||||
Rectangle GetImageAlphaBorder(Image image, float threshold)
|
||||
@ -278,8 +287,6 @@ void UnloadTexture(Texture2D texture)
|
||||
void UnloadRenderTexture(RenderTexture2D target)
|
||||
void UpdateTexture(Texture2D texture, const void *pixels)
|
||||
void UpdateTextureRec(Texture2D texture, Rectangle rec, const void *pixels)
|
||||
Image GetTextureData(Texture2D texture)
|
||||
Image GetScreenData(void)
|
||||
void GenTextureMipmaps(Texture2D *texture)
|
||||
void SetTextureFilter(Texture2D texture, int filter)
|
||||
void SetTextureWrap(Texture2D texture, int wrap)
|
||||
@ -291,7 +298,7 @@ void DrawTextureQuad(Texture2D texture, Vector2 tiling, Vector2 offset, Rectangl
|
||||
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 pointsCount, 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)
|
||||
@ -306,22 +313,29 @@ 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 charsCount)
|
||||
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 charsCount)
|
||||
CharInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int charsCount, int type)
|
||||
Image GenImageFontAtlas(const CharInfo *chars, Rectangle **recs, int charsCount, int fontSize, int padding, int packMethod)
|
||||
void UnloadFontData(CharInfo *chars, int charsCount)
|
||||
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)
|
||||
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 DrawTextRec(Font font, const char *text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint)
|
||||
void DrawTextRecEx(Font font, const char *text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint, int selectStart, int selectLength, Color selectTint, Color selectBackTint)
|
||||
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)
|
||||
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(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)
|
||||
@ -337,21 +351,17 @@ const char *TextToUpper(const char *text)
|
||||
const char *TextToLower(const char *text)
|
||||
const char *TextToPascal(const char *text)
|
||||
int TextToInteger(const char *text)
|
||||
char *TextToUtf8(int *codepoints, int length)
|
||||
int *GetCodepoints(const char *text, int *count)
|
||||
int GetCodepointsCount(const char *text)
|
||||
int GetNextCodepoint(const char *text, int *bytesProcessed)
|
||||
const char *CodepointToUtf8(int codepoint, int *byteLength)
|
||||
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 pointsCount, 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)
|
||||
@ -364,52 +374,54 @@ 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, void *data, int dataSize, int offset)
|
||||
void UnloadMesh(Mesh mesh)
|
||||
void DrawMesh(Mesh mesh, Material material, Matrix transform)
|
||||
void DrawMeshInstanced(Mesh mesh, Material material, Matrix *transforms, int instances)
|
||||
void UnloadMesh(Mesh mesh)
|
||||
bool ExportMesh(Mesh mesh, const char *fileName)
|
||||
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, int *animsCount)
|
||||
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)
|
||||
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)
|
||||
BoundingBox MeshBoundingBox(Mesh mesh)
|
||||
void MeshTangents(Mesh *mesh)
|
||||
void MeshBinormals(Mesh *mesh)
|
||||
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 center, float size, Color tint)
|
||||
void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle source, Vector3 center, float size, Color tint)
|
||||
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)
|
||||
bool CheckCollisionRaySphere(Ray ray, Vector3 center, float radius)
|
||||
bool CheckCollisionRaySphereEx(Ray ray, Vector3 center, float radius, Vector3 *collisionPoint)
|
||||
bool CheckCollisionRayBox(Ray ray, BoundingBox box)
|
||||
RayHitInfo GetCollisionRayMesh(Ray ray, Mesh mesh, Matrix transform)
|
||||
RayHitInfo GetCollisionRayModel(Ray ray, Model model)
|
||||
RayHitInfo GetCollisionRayTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3)
|
||||
RayHitInfo GetCollisionRayGround(Ray ray, float groundHeight)
|
||||
RayCollision GetRayCollisionSphere(Ray ray, Vector3 center, float radius)
|
||||
RayCollision GetRayCollisionBox(Ray ray, BoundingBox box)
|
||||
RayCollision GetRayCollisionModel(Ray ray, Model model)
|
||||
RayCollision GetRayCollisionMesh(Ray ray, Mesh mesh, Matrix transform)
|
||||
RayCollision GetRayCollisionTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3)
|
||||
RayCollision GetRayCollisionQuad(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4)
|
||||
void InitAudioDevice(void)
|
||||
void CloseAudioDevice(void)
|
||||
bool IsAudioDeviceReady(void)
|
||||
@ -418,7 +430,7 @@ 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 samplesCount)
|
||||
void UpdateSound(Sound sound, const void *data, int sampleCount)
|
||||
void UnloadWave(Wave wave)
|
||||
void UnloadSound(Sound sound)
|
||||
bool ExportWave(Wave wave, const char *fileName)
|
||||
@ -442,18 +454,19 @@ Music LoadMusicStream(const char *fileName)
|
||||
Music LoadMusicStreamFromMemory(const char *fileType, unsigned char* data, int dataSize)
|
||||
void UnloadMusicStream(Music music)
|
||||
void PlayMusicStream(Music music)
|
||||
bool IsMusicPlaying(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 SetMusicPitch(Music music, float pitch)
|
||||
float GetMusicTimeLength(Music music)
|
||||
float GetMusicTimePlayed(Music music)
|
||||
AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels)
|
||||
void UpdateAudioStream(AudioStream stream, const void *data, int samplesCount)
|
||||
void CloseAudioStream(AudioStream stream)
|
||||
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)
|
||||
|
@ -8,10 +8,10 @@ local keywords = {
|
||||
local structs = {
|
||||
"Vector2", "Vector3", "Vector4", "Quaternion",
|
||||
"Matrix", "Color", "Rectangle", "Image", "Texture", "Texture2D",
|
||||
"RenderTexture", "NPatchInfo", "CharInfo", "Font",
|
||||
"RenderTexture", "NPatchInfo", "GlyphInfo", "Font",
|
||||
"Camera", "Camera2D", "Mesh", "Shader", "MaterialMap",
|
||||
"Material", "Model", "Transform", "BoneInfo", "ModelAnimation",
|
||||
"Ray", "RayHitInfo", "BoundingBox", "Wave", "Sound", "Music",
|
||||
"Ray", "RayCollision", "BoundingBox", "Wave", "Sound", "Music",
|
||||
"AudioStream", "VrDeviceInfo", "Camera3D", "RenderTexture2D",
|
||||
"TextureCubemap", "TraceLogCallback", "PhysicsBody",
|
||||
"GestureEvent", "GuiStyle", "GuiTextBoxState",
|
||||
@ -19,6 +19,14 @@ local structs = {
|
||||
"ShaderAttributeDataType", "MaterialMapIndex", "VrStereoConfig"
|
||||
}
|
||||
|
||||
local rl_structs = {
|
||||
"rlTraceLogLevel", "rlPixelFormat", "rlTextureFilter",
|
||||
"rlBlendMode", "rlShaderLocationIndex", "rlShaderUniformDataType",
|
||||
"rlShaderAttributeDataType", "rlFramebufferAttachType",
|
||||
"rlFramebufferAttachTextureType", "rlVertexBuffer", "rlDrawCall",
|
||||
"rlRenderBatch"
|
||||
}
|
||||
|
||||
local functions = {}
|
||||
local proto = {}
|
||||
|
||||
@ -26,7 +34,7 @@ local counter = 0
|
||||
|
||||
local custom_support = {
|
||||
["rlgl"] = function (line)
|
||||
return line:gsub("[%s*]+(rl%w+)", function (part)
|
||||
return line:gsub("([%s*]+)(rl%w+)", function (pre, part)
|
||||
functions[#functions + 1] = part
|
||||
counter = counter + 1
|
||||
|
||||
@ -61,6 +69,12 @@ for _,modname in ipairs(modules) do
|
||||
end
|
||||
end
|
||||
|
||||
for i,s in ipairs(rl_structs) do
|
||||
if part == s then
|
||||
return before .. part
|
||||
end
|
||||
end
|
||||
|
||||
return before
|
||||
end)
|
||||
|
||||
|
@ -2,6 +2,7 @@ void GuiEnable(void)
|
||||
void GuiDisable(void)
|
||||
void GuiLock(void)
|
||||
void GuiUnlock(void)
|
||||
bool GuiIsLocked(void)
|
||||
void GuiFade(float alpha)
|
||||
void GuiSetState(int state)
|
||||
int GuiGetState(void)
|
||||
|
@ -36,6 +36,7 @@ float Vector3Length(const Vector3 v)
|
||||
float Vector3LengthSqr(const Vector3 v)
|
||||
float Vector3DotProduct(Vector3 v1, Vector3 v2)
|
||||
float Vector3Distance(Vector3 v1, Vector3 v2)
|
||||
Vector2 Vector3Angle(Vector3 v1, Vector3 v2)
|
||||
Vector3 Vector3Negate(Vector3 v)
|
||||
Vector3 Vector3Divide(Vector3 v1, Vector3 v2)
|
||||
Vector3 Vector3Normalize(Vector3 v)
|
||||
|
27
tools/rlgl.h
27
tools/rlgl.h
@ -3,7 +3,7 @@ void rlPushMatrix(void)
|
||||
void rlPopMatrix(void)
|
||||
void rlLoadIdentity(void)
|
||||
void rlTranslatef(float x, float y, float z)
|
||||
void rlRotatef(float angleDeg, 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)
|
||||
@ -37,6 +37,9 @@ 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)
|
||||
@ -66,19 +69,20 @@ void rlLoadExtensions(void *loader)
|
||||
int rlGetVersion(void)
|
||||
int rlGetFramebufferWidth(void)
|
||||
int rlGetFramebufferHeight(void)
|
||||
Shader rlGetShaderDefault(void)
|
||||
Texture2D rlGetTextureDefault(void)
|
||||
RenderBatch rlLoadRenderBatch(int numBuffers, int bufferElements)
|
||||
void rlUnloadRenderBatch(RenderBatch batch)
|
||||
void rlDrawRenderBatch(RenderBatch *batch)
|
||||
void rlSetRenderBatchActive(RenderBatch *batch)
|
||||
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(void *buffer, int size, bool dynamic)
|
||||
unsigned int rlLoadVertexBufferElement(void *buffer, int size, bool dynamic)
|
||||
void rlUpdateVertexBuffer(int bufferId, void *data, int dataSize, int offset)
|
||||
void rlUpdateVertexBuffer(unsigned int bufferId, void *data, int dataSize, int offset)
|
||||
void rlUnloadVertexArray(unsigned int vaoId)
|
||||
void rlUnloadVertexBuffer(unsigned int vboId)
|
||||
void rlSetVertexAttribute(unsigned int index, int compSize, int type, bool normalized, int stride, void *pointer)
|
||||
@ -93,9 +97,10 @@ unsigned int rlLoadTextureDepth(int width, int height, bool useRenderBuffer)
|
||||
unsigned int rlLoadTextureCubemap(void *data, int size, int format)
|
||||
void rlUpdateTexture(unsigned int id, int offsetX, int offsetY, int width, int height, int format, const void *data)
|
||||
void rlGetGlTextureFormats(int format, unsigned int *glInternalFormat, unsigned int *glFormat, unsigned int *glType)
|
||||
const char *rlGetPixelFormatName(unsigned int format)
|
||||
void rlUnloadTexture(unsigned int id)
|
||||
void rlGenerateMipmaps(Texture2D *texture)
|
||||
void *rlReadTexturePixels(Texture2D texture)
|
||||
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)
|
||||
@ -110,7 +115,7 @@ 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(Shader shader)
|
||||
void rlSetShader(unsigned int id, int *locs)
|
||||
Matrix rlGetMatrixModelview(void)
|
||||
Matrix rlGetMatrixProjection(void)
|
||||
Matrix rlGetMatrixTransform(void)
|
||||
|
Loading…
Reference in New Issue
Block a user