More RLGL Initialization functions.
This commit is contained in:
52
API.md
52
API.md
@@ -6674,6 +6674,58 @@ Get current OpenGL version
|
||||
|
||||
---
|
||||
|
||||
> version = RL.rlSetFramebufferWidth( int width )
|
||||
|
||||
Set current framebuffer width
|
||||
|
||||
---
|
||||
|
||||
> width = RL.rlGetFramebufferWidth()
|
||||
|
||||
Get default framebuffer width
|
||||
|
||||
- Success return int
|
||||
|
||||
---
|
||||
|
||||
> version = RL.rlSetFramebufferHeight( int height )
|
||||
|
||||
Set current framebuffer height
|
||||
|
||||
---
|
||||
|
||||
> height = RL.rlGetFramebufferHeight()
|
||||
|
||||
Get default framebuffer height
|
||||
|
||||
- Success return int
|
||||
|
||||
---
|
||||
|
||||
> id = RL.rlGetTextureIdDefault()
|
||||
|
||||
Get default texture id
|
||||
|
||||
- Success return int
|
||||
|
||||
---
|
||||
|
||||
> id = RL.rlGetShaderIdDefault()
|
||||
|
||||
Get default shader id
|
||||
|
||||
- Success return int
|
||||
|
||||
---
|
||||
|
||||
> locations = RL.rlGetShaderLocsDefault()
|
||||
|
||||
Get default shader locations
|
||||
|
||||
- Success return int{}
|
||||
|
||||
---
|
||||
|
||||
## RLGL - Render batch management
|
||||
|
||||
---
|
||||
|
||||
@@ -5330,6 +5330,41 @@ function RL.rlSetBlendFactorsSeparate( glSrcRGB, glDstRGB, glSrcAlpha, glDstAlp
|
||||
---@return any version
|
||||
function RL.rlGetVersion() end
|
||||
|
||||
---Set current framebuffer width
|
||||
---@param width integer
|
||||
---@return any version
|
||||
function RL.rlSetFramebufferWidth( width ) end
|
||||
|
||||
---Get default framebuffer width
|
||||
---- Success return int
|
||||
---@return any width
|
||||
function RL.rlGetFramebufferWidth() end
|
||||
|
||||
---Set current framebuffer height
|
||||
---@param height integer
|
||||
---@return any version
|
||||
function RL.rlSetFramebufferHeight( height ) end
|
||||
|
||||
---Get default framebuffer height
|
||||
---- Success return int
|
||||
---@return any height
|
||||
function RL.rlGetFramebufferHeight() end
|
||||
|
||||
---Get default texture id
|
||||
---- Success return int
|
||||
---@return any id
|
||||
function RL.rlGetTextureIdDefault() end
|
||||
|
||||
---Get default shader id
|
||||
---- Success return int
|
||||
---@return any id
|
||||
function RL.rlGetShaderIdDefault() end
|
||||
|
||||
---Get default shader locations
|
||||
---- Success return int{}
|
||||
---@return any locations
|
||||
function RL.rlGetShaderLocsDefault() end
|
||||
|
||||
-- RLGL - Render batch management
|
||||
|
||||
---Update and draw internal render batch
|
||||
|
||||
@@ -11,6 +11,7 @@ KEY CHANGES:
|
||||
Can be checked with IsGCUnloadEnabled
|
||||
- ADDED: Shaders management functions.
|
||||
- ADDED: Compute shader management and Buffer management.
|
||||
- ADDED: More RLGL Initialization functions.
|
||||
|
||||
DETAILED CHANGES:
|
||||
- CHANGED: GenImageColor now takes Vector2 as size.
|
||||
|
||||
@@ -76,6 +76,13 @@ int lrlglSetBlendFactors( lua_State *L );
|
||||
int lrlglSetBlendFactorsSeparate( lua_State *L );
|
||||
/* Initialization functions */
|
||||
int lrlglGetVersion( lua_State *L );
|
||||
int lrlglSetFramebufferWidth( lua_State *L );
|
||||
int lrlglGetFramebufferWidth( lua_State *L );
|
||||
int lrlglSetFramebufferHeight( lua_State *L );
|
||||
int lrlglGetFramebufferHeight( lua_State *L );
|
||||
int lrlglGetTextureIdDefault( lua_State *L );
|
||||
int lrlglGetShaderIdDefault( lua_State *L );
|
||||
int lrlglGetShaderLocsDefault( lua_State *L );
|
||||
/* Render batch management */
|
||||
int lrlglDrawRenderBatchActive( lua_State *L );
|
||||
int lrlglCheckRenderBatchLimit( lua_State *L );
|
||||
|
||||
@@ -2257,6 +2257,13 @@ void luaRegister() {
|
||||
assingGlobalFunction( "rlSetBlendFactorsSeparate", lrlglSetBlendFactorsSeparate );
|
||||
/* Initialization functions. */
|
||||
assingGlobalFunction( "rlGetVersion", lrlglGetVersion );
|
||||
assingGlobalFunction( "rlSetFramebufferWidth", lrlglSetFramebufferWidth );
|
||||
assingGlobalFunction( "rlGetFramebufferWidth", lrlglGetFramebufferWidth );
|
||||
assingGlobalFunction( "rlSetFramebufferHeight", lrlglSetFramebufferHeight );
|
||||
assingGlobalFunction( "rlGetFramebufferHeight", lrlglGetFramebufferHeight );
|
||||
assingGlobalFunction( "rlGetTextureIdDefault", lrlglGetTextureIdDefault );
|
||||
assingGlobalFunction( "rlGetShaderIdDefault", lrlglGetShaderIdDefault );
|
||||
assingGlobalFunction( "rlGetShaderLocsDefault", lrlglGetShaderLocsDefault );
|
||||
/* Render batch management. */
|
||||
assingGlobalFunction( "rlDrawRenderBatchActive", lrlglDrawRenderBatchActive );
|
||||
assingGlobalFunction( "rlCheckRenderBatchLimit", lrlglCheckRenderBatchLimit );
|
||||
|
||||
98
src/rlgl.c
98
src/rlgl.c
@@ -864,6 +864,104 @@ int lrlglGetVersion( lua_State *L ) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
> version = RL.rlSetFramebufferWidth( int width )
|
||||
|
||||
Set current framebuffer width
|
||||
*/
|
||||
int lrlglSetFramebufferWidth( lua_State *L ) {
|
||||
int width = luaL_checkinteger( L, 1 );
|
||||
|
||||
rlSetFramebufferWidth( width );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
> width = RL.rlGetFramebufferWidth()
|
||||
|
||||
Get default framebuffer width
|
||||
|
||||
- Success return int
|
||||
*/
|
||||
int lrlglGetFramebufferWidth( lua_State *L ) {
|
||||
lua_pushinteger( L, rlGetFramebufferWidth() );
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
> version = RL.rlSetFramebufferHeight( int height )
|
||||
|
||||
Set current framebuffer height
|
||||
*/
|
||||
int lrlglSetFramebufferHeight( lua_State *L ) {
|
||||
int height = luaL_checkinteger( L, 1 );
|
||||
|
||||
rlSetFramebufferWidth( height );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
> height = RL.rlGetFramebufferHeight()
|
||||
|
||||
Get default framebuffer height
|
||||
|
||||
- Success return int
|
||||
*/
|
||||
int lrlglGetFramebufferHeight( lua_State *L ) {
|
||||
lua_pushinteger( L, rlGetFramebufferHeight() );
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
> id = RL.rlGetTextureIdDefault()
|
||||
|
||||
Get default texture id
|
||||
|
||||
- Success return int
|
||||
*/
|
||||
int lrlglGetTextureIdDefault( lua_State *L ) {
|
||||
lua_pushinteger( L, rlGetTextureIdDefault() );
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
> id = RL.rlGetShaderIdDefault()
|
||||
|
||||
Get default shader id
|
||||
|
||||
- Success return int
|
||||
*/
|
||||
int lrlglGetShaderIdDefault( lua_State *L ) {
|
||||
lua_pushinteger( L, rlGetShaderIdDefault() );
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
> locations = RL.rlGetShaderLocsDefault()
|
||||
|
||||
Get default shader locations
|
||||
|
||||
- Success return int{}
|
||||
*/
|
||||
int lrlglGetShaderLocsDefault( lua_State *L ) {
|
||||
int *locs = rlGetShaderLocsDefault();
|
||||
|
||||
lua_createtable( L, RL_MAX_SHADER_LOCATIONS, 0 );
|
||||
|
||||
for ( int i = 0; i < RL_MAX_SHADER_LOCATIONS; i++ ) {
|
||||
lua_pushinteger( L, locs[i] );
|
||||
lua_rawseti( L, -2, i + 1 );
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
## RLGL - Render batch management
|
||||
*/
|
||||
|
||||
@@ -41,6 +41,7 @@ bool stateInit( int argn, const char **argc, const char *exePath ) {
|
||||
|
||||
for ( int i = 0; i < RL_MAX_SHADER_LOCATIONS; i++ ) {
|
||||
state->RLGLcurrentShaderLocs[i] = defaultShaderLocs[i];
|
||||
printf( "defaultShaderLocs[%d] %d\n", i, defaultShaderLocs[i] );
|
||||
}
|
||||
|
||||
return state->run;
|
||||
|
||||
Reference in New Issue
Block a user