This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool BSteamRemotePlayActive() | |
{ | |
uint32 unSessionCount = SteamRemotePlay()->GetSessionCount(); | |
for ( uint32 iIndex = 0; iIndex < unSessionCount; iIndex++ ) | |
{ | |
RemotePlaySessionID_t unSessionID = SteamRemotePlay()->GetSessionID( iIndex ); | |
if ( !unSessionID ) | |
{ | |
continue; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float scale = 1.0f; | |
SDL_DisplayID display = SDL_GetDisplayForWindow(window); | |
const SDL_DisplayMode *mode = SDL_GetDesktopDisplayMode(display); | |
if (mode) { | |
scale = mode->display_scale; | |
} | |
SDL_Log("Window content scale: %d%%\n", (int)(scale * 100.0f)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while (SDL_PollEvent(&event) > 0) { | |
if (event.type == SDL_EVENT_MOUSE_MOTION) { | |
static float dx_frac, dy_frac; | |
float dx, dy; | |
/* Accumulate new motion with previous sub-pixel motion */ | |
dx = event.motion.xrel + dx_frac; | |
dy = event.motion.yrel + dy_frac; | |
/* Split the integral and fractional motion, dx and dy will contain whole pixel deltas */ |