Added SDL_SetWindowOpacity() and SDL_GetWindowOpacity().
This is currently implemented for X11, Cocoa, Windows, and DirectFB. This patch is based on work in Unreal Engine 4's fork of SDL, compliments of Epic Games.
This commit is contained in:
1 parent
5696e88e6b
commit
3bdaf4c611
19 files changed
+174
No files matched your search
@@ -1368,6 +1368,24 @@ SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done)
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SDLK_o:
|
||||
if (withControl) {
|
||||
/* Ctrl-O (or Ctrl-Shift-O) changes window opacity. */
|
||||
SDL_Window *window = SDL_GetWindowFromID(event->key.windowID);
|
||||
if (window) {
|
||||
float opacity;
|
||||
if (SDL_GetWindowOpacity(window, &opacity) == 0) {
|
||||
if (withShift) {
|
||||
opacity += 0.20f;
|
||||
} else {
|
||||
opacity -= 0.20f;
|
||||
}
|
||||
SDL_SetWindowOpacity(window, opacity);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case SDLK_c:
|
||||
if (withControl) {
|
||||
/* Ctrl-C copy awesome text! */
|
||||
|
||||
Reference in new issue
Block a user