Merge remote-tracking branch 'basinbaby/set-window-opacity'

Implement the suggestion and close #125.

Initial suggestion and implementation from

https://github.com/rxi/lite/pull/17
This commit is contained in:
Francesco Abbate
2021-03-23 07:15:18 +01:00
2 changed files with 12 additions and 0 deletions
+8
View File
@@ -454,6 +454,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 },
@@ -477,6 +484,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 }
};