This commit is contained in:
basinbaby 2021-01-10 19:38:57 +00:00 committed by GitHub
commit 35e50b4c0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -378,6 +378,13 @@ static int f_fuzzy_match(lua_State *L) {
return 1;
}
static int f_set_window_opacity(lua_State *L) {
double n = luaL_checknumber(L, 1);
int r = SDL_SetWindowOpacity(window, n);
lua_pushboolean(L, r > -1);
return 1;
}
static const luaL_Reg lib[] = {
{ "poll_event", f_poll_event },
@ -397,6 +404,7 @@ static const luaL_Reg lib[] = {
{ "sleep", f_sleep },
{ "exec", f_exec },
{ "fuzzy_match", f_fuzzy_match },
{ "set_window_opacity", f_set_window_opacity },
{ NULL, NULL }
};