Texture now can be either Texture or RenderTexture. No need to change texture source anymore.

This commit is contained in:
jussi
2023-05-01 18:23:36 +03:00
parent 8b6337446d
commit acc56fc7c2
18 changed files with 160 additions and 251 deletions

View File

@@ -1247,11 +1247,12 @@ int lcoreSetShaderValueTexture( lua_State *L ) {
int locIndex = lua_tointeger( L, 2 );
size_t textureId = lua_tointeger( L, 3 );
if ( !validShader( shaderId ) || !validTexture( textureId ) ) {
if ( !validShader( shaderId ) || !validTexture( textureId, TEXTURE_TYPE_ALL ) ) {
lua_pushboolean( L, false );
return 1;
}
SetShaderValueTexture( *state->shaders[ shaderId ], locIndex, *state->textures[ textureId ] );
// SetShaderValueTexture( *state->shaders[ shaderId ], locIndex, *state->textures[ textureId ] );
SetShaderValueTexture( *state->shaders[ shaderId ], locIndex, *texturesGetSourceTexture( textureId ) );
lua_pushboolean( L, true );
return 1;