Implement window transparency.

This commit is contained in:
Apprentice-Alchemist
2022-08-04 22:00:49 +02:00
parent 88b4fdf888
commit 1c8c6c1a5e
9 changed files with 96 additions and 1 deletions

View File

@@ -1082,6 +1082,17 @@ namespace lime {
}
float SDLWindow::GetOpacity() {
float opacity = 1.0;
if(SDL_GetWindowOpacity(sdlWindow, &opacity) != 0) {
return 1.0;
}
return opacity;
}
void SDLWindow::SetOpacity(float opacity) {
SDL_SetWindowOpacity(sdlWindow, opacity);
}
Window* CreateWindow (Application* application, int width, int height, int flags, const char* title) {

View File

@@ -54,7 +54,8 @@ namespace lime {
virtual void SetTextInputRect (Rectangle *rect);
virtual const char* SetTitle (const char* title);
virtual void WarpMouse (int x, int y);
virtual float GetOpacity();
virtual void SetOpacity(float opacity);
SDL_Renderer* sdlRenderer;
SDL_Texture* sdlTexture;
SDL_Window* sdlWindow;