summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-07-06 19:02:14 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-07-06 19:02:14 +0000
commit3f941c5e9ca46792a2044bd7126e7f32d0ca4d30 (patch)
tree5e3023c5463eac6163ae632dcd29cbb67b8295c1
parentUpdated test app (diff)
downloadDiligentEngine-3f941c5e9ca46792a2044bd7126e7f32d0ca4d30.tar.gz
DiligentEngine-3f941c5e9ca46792a2044bd7126e7f32d0ca4d30.zip
Updated Asteroids demo to handle minimized window in Vulkan; updated BlendTexturesPS_GL.glsl
m---------DiligentCore0
m---------DiligentSamples0
-rw-r--r--Projects/Asteroids/src/WinWrapper.cpp22
-rw-r--r--Tests/TestApp/assets/Shaders/RTTest/BlendTexturesPS_GL.glsl6
4 files changed, 20 insertions, 8 deletions
diff --git a/DiligentCore b/DiligentCore
-Subproject a029082a02e3e1046b7929f3e5ad75a5df930ba
+Subproject b3311e60b7dc6ee1581469e2d3ac8854cdcb5ba
diff --git a/DiligentSamples b/DiligentSamples
-Subproject 018b3197f076b4aa5e76ce9fa84a8347b70d737
+Subproject 50da5b0e798543b0617cec8c9777045eb11f00c
diff --git a/Projects/Asteroids/src/WinWrapper.cpp b/Projects/Asteroids/src/WinWrapper.cpp
index 036b205..6b0ecfe 100644
--- a/Projects/Asteroids/src/WinWrapper.cpp
+++ b/Projects/Asteroids/src/WinWrapper.cpp
@@ -142,28 +142,28 @@ LRESULT CALLBACK WindowProc(
UINT ww = LOWORD(lParam);
UINT wh = HIWORD(lParam);
- // Ignore resizing to minimized
- if (ww == 0 || wh == 0) return 0;
-
gSettings.windowWidth = (int)ww;
gSettings.windowHeight = (int)wh;
gSettings.renderWidth = (UINT)(double(gSettings.windowWidth) * gSettings.renderScale);
gSettings.renderHeight = (UINT)(double(gSettings.windowHeight) * gSettings.renderScale);
// Update camera projection
- float aspect = (float)gSettings.renderWidth / (float)gSettings.renderHeight;
- gCamera.Projection(XM_PIDIV2 * 0.8f * 3 / 2, aspect);
+ if(gSettings.renderWidth !=0 && gSettings.renderHeight !=0)
+ {
+ float aspect = (float)gSettings.renderWidth / (float)gSettings.renderHeight;
+ gCamera.Projection(XM_PIDIV2 * 0.8f * 3 / 2, aspect);
+ }
// Resize currently active swap chain
switch (gSettings.mode)
{
case Settings::RenderMode::NativeD3D11:
- if(gWorkloadD3D11)
+ if(gWorkloadD3D11 && gSettings.renderWidth !=0 && gSettings.renderHeight !=0)
gWorkloadD3D11->ResizeSwapChain(gDXGIFactory, hWnd, gSettings.renderWidth, gSettings.renderHeight);
break;
case Settings::RenderMode::NativeD3D12:
- if(gWorkloadD3D12)
+ if(gWorkloadD3D12 && gSettings.renderWidth !=0 && gSettings.renderHeight !=0)
gWorkloadD3D12->ResizeSwapChain(gDXGIFactory, hWnd, gSettings.renderWidth, gSettings.renderHeight);
break;
@@ -284,6 +284,14 @@ LRESULT CALLBACK WindowProc(
}
return 0;
}
+
+ case WM_GETMINMAXINFO:
+ {
+ LPMINMAXINFO lpMMI = (LPMINMAXINFO)lParam;
+ lpMMI->ptMinTrackSize.x = 320;
+ lpMMI->ptMinTrackSize.y = 240;
+ return 0;
+ }
default:
return DefWindowProc(hWnd, message, wParam, lParam);
diff --git a/Tests/TestApp/assets/Shaders/RTTest/BlendTexturesPS_GL.glsl b/Tests/TestApp/assets/Shaders/RTTest/BlendTexturesPS_GL.glsl
index 2139000..726dfee 100644
--- a/Tests/TestApp/assets/Shaders/RTTest/BlendTexturesPS_GL.glsl
+++ b/Tests/TestApp/assets/Shaders/RTTest/BlendTexturesPS_GL.glsl
@@ -9,7 +9,11 @@ layout(location = 0) out vec4 out_Color;
void main()
{
- vec2 UV = vec2( ex_UV.x, 1.0 - ex_UV.y );
+ vec2 UV = vec2( ex_UV.x, ex_UV.y );
+#ifndef TARGET_API_VULKAN
+ UV.y = 1.0 - UV.y;
+#endif
+
vec4 Col0 = texture(g_tex2DTest0, UV);
vec4 Col1 = texture(g_tex2DTest1, UV);
vec4 Col2 = texture(g_tex2DTest2, UV);