Sort functions and standardize formatting.
The new version no longer checks the return code of `SDL_GetWindowOpacity`, for consistency with the other getters. In theory this should be fine, because the only documented error condition is if the window is invalid, at which point none of the getters matter. If the platform doesn't support transparency, "opacity will be reported as 1.0f without error."
This commit is contained in:
@@ -496,9 +496,6 @@ namespace lime {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const char* SDLWindow::GetContextType () {
|
||||
|
||||
if (context) {
|
||||
@@ -592,6 +589,17 @@ namespace lime {
|
||||
}
|
||||
|
||||
|
||||
float SDLWindow::GetOpacity () {
|
||||
|
||||
float opacity = 1.0f;
|
||||
|
||||
SDL_GetWindowOpacity (sdlWindow, &opacity);
|
||||
|
||||
return opacity;
|
||||
|
||||
}
|
||||
|
||||
|
||||
double SDLWindow::GetScale () {
|
||||
|
||||
if (sdlRenderer) {
|
||||
@@ -1010,6 +1018,13 @@ namespace lime {
|
||||
}
|
||||
|
||||
|
||||
void SDLWindow::SetOpacity (float opacity) {
|
||||
|
||||
SDL_SetWindowOpacity (sdlWindow, opacity);
|
||||
|
||||
}
|
||||
|
||||
|
||||
bool SDLWindow::SetResizable (bool resizable) {
|
||||
|
||||
#ifndef EMSCRIPTEN
|
||||
@@ -1082,17 +1097,6 @@ 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) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user