LoadShaderFromMemory fix.
This commit is contained in:
6
API.md
6
API.md
@@ -1172,7 +1172,7 @@ Set window minimum dimensions ( for FLAG_WINDOW_RESIZABLE )
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
> position = RL.GetMonitorPosition( )
|
> position = RL.GetMonitorPosition( int monitor )
|
||||||
|
|
||||||
Get specified monitor position
|
Get specified monitor position
|
||||||
|
|
||||||
@@ -3692,7 +3692,7 @@ Returns src alpha-blended into dst color with tint
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
> Color = RL.GetColor( unsigned int hexValue )
|
> color = RL.GetColor( unsigned int hexValue )
|
||||||
|
|
||||||
Get Color structure from hexadecimal value
|
Get Color structure from hexadecimal value
|
||||||
|
|
||||||
@@ -3701,7 +3701,7 @@ Get Color structure from hexadecimal value
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
> Color = RL.GetPixelColor( Texture2D texture, Vector2 position )
|
> color = RL.GetPixelColor( Texture2D texture, Vector2 position )
|
||||||
|
|
||||||
Get pixel color from source texture
|
Get pixel color from source texture
|
||||||
|
|
||||||
|
|||||||
@@ -605,8 +605,9 @@ function RL.SetWindowMinSize( size ) end
|
|||||||
---Get specified monitor position
|
---Get specified monitor position
|
||||||
---- Failure return nil
|
---- Failure return nil
|
||||||
---- Success return Vector2
|
---- Success return Vector2
|
||||||
|
---@param monitor integer
|
||||||
---@return any position
|
---@return any position
|
||||||
function RL.GetMonitorPosition() end
|
function RL.GetMonitorPosition( monitor ) end
|
||||||
|
|
||||||
---Get specified monitor size
|
---Get specified monitor size
|
||||||
---- Failure return nil
|
---- Failure return nil
|
||||||
@@ -2754,7 +2755,7 @@ function RL.ColorAlphaBlend( dst, src, tint ) end
|
|||||||
---- Failure return false
|
---- Failure return false
|
||||||
---- Success return Color
|
---- Success return Color
|
||||||
---@param int any
|
---@param int any
|
||||||
---@return any Color
|
---@return any color
|
||||||
function RL.GetColor( int ) end
|
function RL.GetColor( int ) end
|
||||||
|
|
||||||
---Get pixel color from source texture
|
---Get pixel color from source texture
|
||||||
@@ -2762,7 +2763,7 @@ function RL.GetColor( int ) end
|
|||||||
---- Success return Color
|
---- Success return Color
|
||||||
---@param texture any
|
---@param texture any
|
||||||
---@param position table
|
---@param position table
|
||||||
---@return any Color
|
---@return any color
|
||||||
function RL.GetPixelColor( texture, position ) end
|
function RL.GetPixelColor( texture, position ) end
|
||||||
|
|
||||||
---Get pixel data size in bytes for certain format
|
---Get pixel data size in bytes for certain format
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ KEY CHANGES:
|
|||||||
- CHANGED: All examples are now changed to use new RL table method.
|
- CHANGED: All examples are now changed to use new RL table method.
|
||||||
- ADDED: doc_parser creates also ReiLua_API.lua that can be used in projects with Lua Language Server.
|
- ADDED: doc_parser creates also ReiLua_API.lua that can be used in projects with Lua Language Server.
|
||||||
- CHANGED: Switched to Raylib vertion 4.5. Removed some functions and added others. Main changes to camera3D.
|
- CHANGED: Switched to Raylib vertion 4.5. Removed some functions and added others. Main changes to camera3D.
|
||||||
|
- REVISED: How Lua argumets are handled. Now uluaGet*Index functions can take stack index(positive only).
|
||||||
|
Also using positive stack indexing.
|
||||||
|
|
||||||
Detailed changes:
|
Detailed changes:
|
||||||
- FIXED: uluaGetRay was looking for integers instead of tables.
|
- FIXED: uluaGetRay was looking for integers instead of tables.
|
||||||
@@ -33,8 +35,7 @@ Detailed changes:
|
|||||||
- CHANGED: DrawLineStrip no longer require pointsCount
|
- CHANGED: DrawLineStrip no longer require pointsCount
|
||||||
- CHANGED: DrawTriangleFan no longer require pointsCount
|
- CHANGED: DrawTriangleFan no longer require pointsCount
|
||||||
- CHANGED: DrawTriangleStrip no longer require pointsCount
|
- CHANGED: DrawTriangleStrip no longer require pointsCount
|
||||||
- REVISED: How argumets are handled. Now uluaGet*Index functions can take stack index(positive only).
|
- FIXED: LoadShaderFromMemory
|
||||||
Also using mostly positive stack indexing.
|
|
||||||
|
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
Release: ReiLua version 0.4.0 Using Raylib 4.2
|
Release: ReiLua version 0.4.0 Using Raylib 4.2
|
||||||
|
|||||||
14
devnotes
14
devnotes
@@ -26,24 +26,10 @@ Backlog {
|
|||||||
* Needs Testing
|
* Needs Testing
|
||||||
* UpdateTexture
|
* UpdateTexture
|
||||||
* UpdateTextureRec
|
* UpdateTextureRec
|
||||||
* GetColor
|
|
||||||
* LoadShader
|
|
||||||
* LoadShaderFromMemory
|
|
||||||
* LoadSoundFromWave
|
* LoadSoundFromWave
|
||||||
* LoadFont
|
* LoadFont
|
||||||
* LoadFontEx
|
* LoadFontEx
|
||||||
* LoadFontFromImage
|
* LoadFontFromImage
|
||||||
* DrawText
|
|
||||||
* DrawQuad3DTexture
|
|
||||||
* GenMeshCustom
|
|
||||||
* UpdateMesh
|
* UpdateMesh
|
||||||
* DrawMeshInstanced
|
|
||||||
* LoadModelAnimations
|
|
||||||
* LoadMaterialDefault
|
|
||||||
* CreateMaterial
|
|
||||||
* LoadModel
|
|
||||||
* LoadModelFromMesh
|
* LoadModelFromMesh
|
||||||
* SetModelMaterial
|
|
||||||
* UpdateModelAnimation
|
|
||||||
* GetRayCollisionMesh
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,11 +82,6 @@ function RL.init()
|
|||||||
RL.SetCamera3DTarget( camera, { 0, 0, 0 } )
|
RL.SetCamera3DTarget( camera, { 0, 0, 0 } )
|
||||||
RL.SetCamera3DUp( camera, { 0, 1, 0 } )
|
RL.SetCamera3DUp( camera, { 0, 1, 0 } )
|
||||||
|
|
||||||
-- for x = 0, 3 do
|
|
||||||
-- for y = 0, 9 do
|
|
||||||
-- table.insert( sprites, { pos = { x + 0.5, y + 0.5 + 1 }, tile = { 1, 1 }, dis = 0, size = 0.8 } )
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
table.insert( sprites, { pos = { 2.5, 2.5 }, tile = { 1, 1 }, dis = 0, size = 0.8 } )
|
table.insert( sprites, { pos = { 2.5, 2.5 }, tile = { 1, 1 }, dis = 0, size = 0.8 } )
|
||||||
table.insert( sprites, { pos = { 1.5, 3.5 }, tile = { 3, 1 }, dis = 0, size = 0.5 } )
|
table.insert( sprites, { pos = { 1.5, 3.5 }, tile = { 3, 1 }, dis = 0, size = 0.5 } )
|
||||||
table.insert( sprites, { pos = { 0.5, 3.5 }, tile = { 3, 0 }, dis = 0, size = 0.7 } )
|
table.insert( sprites, { pos = { 0.5, 3.5 }, tile = { 3, 0 }, dis = 0, size = 0.7 } )
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ function RL.init()
|
|||||||
RL.SetCamera3DPosition( camera, { 0, 8, 16 } )
|
RL.SetCamera3DPosition( camera, { 0, 8, 16 } )
|
||||||
RL.SetCamera3DTarget( camera, { 0, 0, 0 } )
|
RL.SetCamera3DTarget( camera, { 0, 0, 0 } )
|
||||||
RL.SetCamera3DUp( camera, { 0, 1, 0 } )
|
RL.SetCamera3DUp( camera, { 0, 1, 0 } )
|
||||||
RL.SetCameraMode( camera, RL.CAMERA_FREE )
|
|
||||||
|
|
||||||
local ts = PLANE_SIZE
|
local ts = PLANE_SIZE
|
||||||
local meshData = {
|
local meshData = {
|
||||||
@@ -40,12 +39,6 @@ function RL.init()
|
|||||||
}
|
}
|
||||||
mesh = RL.GenMeshCustom( meshData, true )
|
mesh = RL.GenMeshCustom( meshData, true )
|
||||||
|
|
||||||
-- local meshEdit = {
|
|
||||||
-- vertices = { { 0, 1, 0 }, { 0, 0, PLANE_SIZE }, { PLANE_SIZE, 0, PLANE_SIZE },
|
|
||||||
-- { 0, 1, 0 }, { PLANE_SIZE, 0, PLANE_SIZE }, { PLANE_SIZE, 0, 0 } },
|
|
||||||
-- }
|
|
||||||
-- RL.UpdateMesh( mesh, meshEdit )
|
|
||||||
|
|
||||||
tileTexture = RL.LoadTexture( RL.GetBasePath().."../resources/images/tile.png" )
|
tileTexture = RL.LoadTexture( RL.GetBasePath().."../resources/images/tile.png" )
|
||||||
RL.GenTextureMipmaps( tileTexture )
|
RL.GenTextureMipmaps( tileTexture )
|
||||||
RL.SetTextureFilter( tileTexture, RL.TEXTURE_FILTER_TRILINEAR )
|
RL.SetTextureFilter( tileTexture, RL.TEXTURE_FILTER_TRILINEAR )
|
||||||
@@ -85,7 +78,7 @@ end
|
|||||||
|
|
||||||
function RL.draw()
|
function RL.draw()
|
||||||
RL.ClearBackground( { 25, 50, 50 } )
|
RL.ClearBackground( { 25, 50, 50 } )
|
||||||
RL.UpdateCamera3D( camera )
|
RL.UpdateCamera3D( camera, RL.CAMERA_ORBITAL )
|
||||||
|
|
||||||
RL.BeginMode3D( camera )
|
RL.BeginMode3D( camera )
|
||||||
RL.DrawMesh( mesh, material, matrix )
|
RL.DrawMesh( mesh, material, matrix )
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
local camera = -1
|
local camera = -1
|
||||||
local sphereMesh = -1
|
local sphereMesh = -1
|
||||||
local ray = { { 0.5, 0, 4 }, { 0.1, 0, -1 } }
|
local ray = { { 0.5, 0, 4 }, { 0.1, 0, -1 } }
|
||||||
|
local rayCol = {}
|
||||||
|
|
||||||
local function setupWindow()
|
local function setupWindow()
|
||||||
local monitor = 0
|
local monitor = 0
|
||||||
@@ -14,7 +15,7 @@ local function setupWindow()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function ray_collision()
|
function ray_collision()
|
||||||
local rayCol = RL.GetRayCollisionMesh( ray, sphereMesh, RL.MatrixIdentity() )
|
rayCol = RL.GetRayCollisionMesh( ray, sphereMesh, RL.MatrixIdentity() )
|
||||||
|
|
||||||
if rayCol ~= nil and rayCol.hit then
|
if rayCol ~= nil and rayCol.hit then
|
||||||
print( "hit", rayCol.hit )
|
print( "hit", rayCol.hit )
|
||||||
@@ -53,5 +54,7 @@ function RL.draw()
|
|||||||
RL.DrawRay( ray, { 255, 100, 100 } )
|
RL.DrawRay( ray, { 255, 100, 100 } )
|
||||||
|
|
||||||
RL.DrawMesh( sphereMesh, 0, RL.MatrixIdentity() )
|
RL.DrawMesh( sphereMesh, 0, RL.MatrixIdentity() )
|
||||||
|
RL.DrawSphereWires( rayCol.point, 0.05, 4, 8, RL.BLUE )
|
||||||
|
RL.DrawLine3D( rayCol.point, RL.Vector3Add( rayCol.point, rayCol.normal ), RL.GREEN )
|
||||||
RL.EndMode3D()
|
RL.EndMode3D()
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ int lcoreSetWindowMinSize( lua_State *L ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
> position = RL.GetMonitorPosition( )
|
> position = RL.GetMonitorPosition( int monitor )
|
||||||
|
|
||||||
Get specified monitor position
|
Get specified monitor position
|
||||||
|
|
||||||
@@ -1022,18 +1022,17 @@ int lcoreLoadShaderFromMemory( lua_State *L ) {
|
|||||||
lua_pushinteger( L, -1 );
|
lua_pushinteger( L, -1 );
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *vs = NULL;
|
char *vs = NULL;
|
||||||
char *fs = NULL;
|
char *fs = NULL;
|
||||||
|
|
||||||
if ( lua_isstring( L, 1 ) ) {
|
if ( lua_isstring( L, 1 ) ) {
|
||||||
size_t vsLen = lua_rawlen( L, 1 );
|
size_t vsLen = lua_rawlen( L, 1 ) + 1;
|
||||||
|
|
||||||
vs = malloc( vsLen * sizeof( char ) );
|
vs = malloc( vsLen * sizeof( char ) );
|
||||||
strcpy( vs, lua_tostring( L, 1 ) );
|
strcpy( vs, lua_tostring( L, 1 ) );
|
||||||
}
|
}
|
||||||
if ( lua_isstring( L, 2 ) ) {
|
if ( lua_isstring( L, 2 ) ) {
|
||||||
size_t fsLen = lua_rawlen( L, 2 );
|
size_t fsLen = lua_rawlen( L, 2 ) + 1;
|
||||||
|
|
||||||
fs = malloc( fsLen * sizeof( char ) );
|
fs = malloc( fsLen * sizeof( char ) );
|
||||||
strcpy( fs, lua_tostring( L, 2 ) );
|
strcpy( fs, lua_tostring( L, 2 ) );
|
||||||
|
|||||||
@@ -2531,7 +2531,7 @@ int ltexturesColorAlphaBlend( lua_State *L ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
> Color = RL.GetColor( unsigned int hexValue )
|
> color = RL.GetColor( unsigned int hexValue )
|
||||||
|
|
||||||
Get Color structure from hexadecimal value
|
Get Color structure from hexadecimal value
|
||||||
|
|
||||||
@@ -2552,7 +2552,7 @@ int ltexturesGetColor( lua_State *L ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
> Color = RL.GetPixelColor( Texture2D texture, Vector2 position )
|
> color = RL.GetPixelColor( Texture2D texture, Vector2 position )
|
||||||
|
|
||||||
Get pixel color from source texture
|
Get pixel color from source texture
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user