mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-04-26 16:46:28 +00:00
parent
c4001c727a
commit
30ea57c644
@ -83,6 +83,8 @@ struct AppState
|
|||||||
uint64_t renderTime;
|
uint64_t renderTime;
|
||||||
uint64_t frameCount;
|
uint64_t frameCount;
|
||||||
uint64_t renderCount;
|
uint64_t renderCount;
|
||||||
|
|
||||||
|
KeybindHandle kbFS;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct RenderOpts
|
typedef struct RenderOpts
|
||||||
@ -1000,6 +1002,22 @@ static bool try_renderer(const int index, const LG_RendererParams lgrParams, Uin
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void toggle_fullscreen(SDL_Scancode key, void * opaque)
|
||||||
|
{
|
||||||
|
SDL_SetWindowFullscreen(state.window, params.fullscreen ? 0 : SDL_WINDOW_FULLSCREEN_DESKTOP);
|
||||||
|
params.fullscreen = !params.fullscreen;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void register_key_binds()
|
||||||
|
{
|
||||||
|
state.kbFS = app_register_keybind(SDL_SCANCODE_F, toggle_fullscreen, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void release_key_binds()
|
||||||
|
{
|
||||||
|
app_release_keybind(&state.kbFS);
|
||||||
|
}
|
||||||
|
|
||||||
int run()
|
int run()
|
||||||
{
|
{
|
||||||
DEBUG_INFO("Looking Glass (" BUILD_VERSION ")");
|
DEBUG_INFO("Looking Glass (" BUILD_VERSION ")");
|
||||||
@ -1117,6 +1135,8 @@ int run()
|
|||||||
// ensure renderer viewport is aware of the current window size
|
// ensure renderer viewport is aware of the current window size
|
||||||
updatePositionInfo();
|
updatePositionInfo();
|
||||||
|
|
||||||
|
register_key_binds();
|
||||||
|
|
||||||
// set the compositor hint to bypass for low latency
|
// set the compositor hint to bypass for low latency
|
||||||
SDL_SysWMinfo wminfo;
|
SDL_SysWMinfo wminfo;
|
||||||
SDL_VERSION(&wminfo.version);
|
SDL_VERSION(&wminfo.version);
|
||||||
@ -1942,7 +1962,9 @@ int main(int argc, char * argv[])
|
|||||||
SDL_SetHint(SDL_HINT_GRAB_KEYBOARD, "1");
|
SDL_SetHint(SDL_HINT_GRAB_KEYBOARD, "1");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
register_key_binds();
|
||||||
const int ret = run();
|
const int ret = run();
|
||||||
|
release_key_binds();
|
||||||
|
|
||||||
free(params.shmFile);
|
free(params.shmFile);
|
||||||
free(params.spiceHost);
|
free(params.spiceHost);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user