ソースを参照

Since D3D9/11 graphics systems don't initialize OpenGL, it's arguably incorrect to call SDL_GL_GetDrawableSize. Use SDL_GetWindowSize instead. Correct line endings in Drawable2D.

Lasse Öörni 9 年 前
コミット
181c24e380

+ 5 - 5
Source/Urho3D/Graphics/Direct3D11/D3D11Graphics.cpp

@@ -423,7 +423,7 @@ bool Graphics::SetMode(int width, int height, bool fullscreen, bool borderless,
     if (maximize)
     {
         Maximize();
-        SDL_GL_GetDrawableSize(impl_->window_, &width, &height);
+        SDL_GetWindowSize(impl_->window_, &width, &height);
     }
 
     if (!impl_->device_ || multiSample_ != multiSample)
@@ -612,7 +612,7 @@ bool Graphics::BeginFrame()
     {
         int width, height;
 
-        SDL_GL_GetDrawableSize(impl_->window_, &width, &height);
+        SDL_GetWindowSize(impl_->window_, &width, &height);
         if (width != width_ || height != height_)
             SetMode(width, height);
     }
@@ -1841,7 +1841,7 @@ void Graphics::WindowResized()
 
     int newWidth, newHeight;
 
-    SDL_GL_GetDrawableSize(impl_->window_, &newWidth, &newHeight);
+    SDL_GetWindowSize(impl_->window_, &newWidth, &newHeight);
     if (newWidth == width_ && newHeight == height_)
         return;
 
@@ -2194,7 +2194,7 @@ void Graphics::AdjustWindow(int& newWidth, int& newHeight, bool& newFullscreen,
         if (!newWidth || !newHeight)
         {
             SDL_MaximizeWindow(impl_->window_);
-            SDL_GL_GetDrawableSize(impl_->window_, &newWidth, &newHeight);
+            SDL_GetWindowSize(impl_->window_, &newWidth, &newHeight);
         }
         else
             SDL_SetWindowSize(impl_->window_, newWidth, newHeight);
@@ -2205,7 +2205,7 @@ void Graphics::AdjustWindow(int& newWidth, int& newHeight, bool& newFullscreen,
     else
     {
         // If external window, must ask its dimensions instead of trying to set them
-        SDL_GL_GetDrawableSize(impl_->window_, &newWidth, &newHeight);
+        SDL_GetWindowSize(impl_->window_, &newWidth, &newHeight);
         newFullscreen = false;
     }
 }

+ 5 - 5
Source/Urho3D/Graphics/Direct3D9/D3D9Graphics.cpp

@@ -465,7 +465,7 @@ bool Graphics::SetMode(int width, int height, bool fullscreen, bool borderless,
     if (maximize)
     {
         Maximize();
-        SDL_GL_GetDrawableSize(impl_->window_, &width, &height);
+        SDL_GetWindowSize(impl_->window_, &width, &height);
     }
 
     if (fullscreen)
@@ -735,7 +735,7 @@ bool Graphics::BeginFrame()
     {
         int width, height;
 
-        SDL_GL_GetDrawableSize(impl_->window_, &width, &height);
+        SDL_GetWindowSize(impl_->window_, &width, &height);
         if (width != width_ || height != height_)
             SetMode(width, height);
     }
@@ -2055,7 +2055,7 @@ void Graphics::WindowResized()
 
     int newWidth, newHeight;
 
-    SDL_GL_GetDrawableSize(impl_->window_, &newWidth, &newHeight);
+    SDL_GetWindowSize(impl_->window_, &newWidth, &newHeight);
     if (newWidth == width_ && newHeight == height_)
         return;
 
@@ -2416,7 +2416,7 @@ void Graphics::AdjustWindow(int& newWidth, int& newHeight, bool& newFullscreen,
         if (!newWidth || !newHeight)
         {
             SDL_MaximizeWindow(impl_->window_);
-            SDL_GL_GetDrawableSize(impl_->window_, &newWidth, &newHeight);
+            SDL_GetWindowSize(impl_->window_, &newWidth, &newHeight);
         }
         else
             SDL_SetWindowSize(impl_->window_, newWidth, newHeight);
@@ -2427,7 +2427,7 @@ void Graphics::AdjustWindow(int& newWidth, int& newHeight, bool& newFullscreen,
     else
     {
         // If external window, must ask its dimensions instead of trying to set them
-        SDL_GL_GetDrawableSize(impl_->window_, &newWidth, &newHeight);
+        SDL_GetWindowSize(impl_->window_, &newWidth, &newHeight);
         newFullscreen = false;
     }
 }

+ 1 - 1
Source/Urho3D/Urho2D/Drawable2D.cpp

@@ -129,4 +129,4 @@ void Drawable2D::OnMarkedDirty(Node* node)
     sourceBatchesDirty_ = true;
 }
 
-}
+}