diff options
-rw-r--r-- | indra/llwindow/llwindowsdl.cpp | 35 | ||||
-rw-r--r-- | indra/llwindow/llwindowsdl.h | 1 |
2 files changed, 16 insertions, 20 deletions
diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index e592815f4f..eb689dc48c 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -797,18 +797,20 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B return FALSE; } // SDL_GL_SetSwapInterval(1); - mSurface = SDL_GetWindowSurface( mWindow ); } if( mFullscreen ) { - if (mSurface) + if (mWindow) { mFullscreen = TRUE; + /* mFullscreenWidth = mSurface->w; mFullscreenHeight = mSurface->h; mFullscreenBits = mSurface->format->BitsPerPixel; + */ + SDL_GetWindowSize(mWindow, &mFullscreenWidth, &mFullscreenHeight); mFullscreenRefresh = -1; LL_INFOS() << "Running at " << mFullscreenWidth @@ -1171,18 +1173,14 @@ BOOL LLWindowSDL::getPosition(LLCoordScreen *position) BOOL LLWindowSDL::getSize(LLCoordScreen *size) { - if (mSurface) + if (mWindow) { /* if(hasHIDPI) - { SDL_GL_GetDrawableSize(mWindow, &size->mX, &size->mY); - return (TRUE); - } + else */ - - size->mX = mSurface->w; - size->mY = mSurface->h; + SDL_GetWindowSize(mWindow, &size->mX, &size->mY); return (TRUE); } @@ -1191,16 +1189,12 @@ BOOL LLWindowSDL::getSize(LLCoordScreen *size) BOOL LLWindowSDL::getSize(LLCoordWindow *size) { - if (mSurface) + if (mWindow) { if(hasHIDPI) - { SDL_GL_GetDrawableSize(mWindow, &size->mX, &size->mY); - return (TRUE); - } - - size->mX = mSurface->w; - size->mY = mSurface->h; + else + SDL_GetWindowSize(mWindow, &size->mX, &size->mY); return (TRUE); } @@ -1643,7 +1637,9 @@ BOOL LLWindowSDL::convertCoords(LLCoordGL from, LLCoordWindow *to) return FALSE; to->mX = from.mX; - to->mY = mSurface->h - from.mY - 1; + int h; + SDL_GetWindowSize(mWindow, nullptr, &h); + to->mY = h - from.mY - 1; return TRUE; } @@ -1654,7 +1650,9 @@ BOOL LLWindowSDL::convertCoords(LLCoordWindow from, LLCoordGL* to) return FALSE; to->mX = from.mX; - to->mY = mSurface->h - from.mY - 1; + int h; + SDL_GetWindowSize(mWindow, nullptr, &h); + to->mY = h - from.mY - 1; return TRUE; } @@ -2133,7 +2131,6 @@ void LLWindowSDL::gatherInput() S32 width = llmax(event.window.data1, (S32)mMinWindowWidth); S32 height = llmax(event.window.data2, (S32)mMinWindowHeight); - mSurface = SDL_GetWindowSurface( mWindow ); // *FIX: I'm not sure this is necessary! // <FS:ND> I think is is not diff --git a/indra/llwindow/llwindowsdl.h b/indra/llwindow/llwindowsdl.h index 33dd794501..87a3e15731 100644 --- a/indra/llwindow/llwindowsdl.h +++ b/indra/llwindow/llwindowsdl.h @@ -272,7 +272,6 @@ protected: int mReallyCapturedCount; SDL_Window *mWindow; - SDL_Surface *mSurface; SDL_GLContext mContext; SDL_Cursor *mSDLCursors[UI_CURSOR_COUNT]; |