UI shader file names
Minor window handling code cleanup
This commit is contained in:
parent
be3d9275ce
commit
52511a76db
1 changed files with 15 additions and 14 deletions
|
|
@ -236,8 +236,8 @@ void VulkanExampleBase::prepare()
|
||||||
ui.device = vulkanDevice;
|
ui.device = vulkanDevice;
|
||||||
ui.queue = queue;
|
ui.queue = queue;
|
||||||
ui.shaders = {
|
ui.shaders = {
|
||||||
loadShader(getShadersPath() + "base/ui.vert.spv", VK_SHADER_STAGE_VERTEX_BIT),
|
loadShader(getShadersPath() + "base/uioverlay.vert.spv", VK_SHADER_STAGE_VERTEX_BIT),
|
||||||
loadShader(getShadersPath() + "base/ui.frag.spv", VK_SHADER_STAGE_FRAGMENT_BIT),
|
loadShader(getShadersPath() + "base/uioverlay.frag.spv", VK_SHADER_STAGE_FRAGMENT_BIT),
|
||||||
};
|
};
|
||||||
ui.prepareResources();
|
ui.prepareResources();
|
||||||
ui.preparePipeline(pipelineCache, renderPass, swapChain.colorFormat, depthFormat);
|
ui.preparePipeline(pipelineCache, renderPass, swapChain.colorFormat, depthFormat);
|
||||||
|
|
@ -1226,11 +1226,12 @@ HWND VulkanExampleBase::setupWindow(HINSTANCE hinstance, WNDPROC wndproc)
|
||||||
dwStyle = WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS | WS_CLIPCHILDREN;
|
dwStyle = WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS | WS_CLIPCHILDREN;
|
||||||
}
|
}
|
||||||
|
|
||||||
RECT windowRect;
|
RECT windowRect = {
|
||||||
windowRect.left = 0L;
|
0L,
|
||||||
windowRect.top = 0L;
|
0L,
|
||||||
windowRect.right = settings.fullscreen ? (long)screenWidth : (long)width;
|
settings.fullscreen ? (long)screenWidth : (long)width,
|
||||||
windowRect.bottom = settings.fullscreen ? (long)screenHeight : (long)height;
|
settings.fullscreen ? (long)screenHeight : (long)height
|
||||||
|
};
|
||||||
|
|
||||||
AdjustWindowRectEx(&windowRect, dwStyle, FALSE, dwExStyle);
|
AdjustWindowRectEx(&windowRect, dwStyle, FALSE, dwExStyle);
|
||||||
|
|
||||||
|
|
@ -1248,6 +1249,13 @@ HWND VulkanExampleBase::setupWindow(HINSTANCE hinstance, WNDPROC wndproc)
|
||||||
hinstance,
|
hinstance,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
if (!window)
|
||||||
|
{
|
||||||
|
std::cerr << "Could not create window!\n";
|
||||||
|
fflush(stdout);
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
if (!settings.fullscreen)
|
if (!settings.fullscreen)
|
||||||
{
|
{
|
||||||
// Center on screen
|
// Center on screen
|
||||||
|
|
@ -1256,13 +1264,6 @@ HWND VulkanExampleBase::setupWindow(HINSTANCE hinstance, WNDPROC wndproc)
|
||||||
SetWindowPos(window, 0, x, y, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
|
SetWindowPos(window, 0, x, y, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!window)
|
|
||||||
{
|
|
||||||
printf("Could not create window!\n");
|
|
||||||
fflush(stdout);
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
ShowWindow(window, SW_SHOW);
|
ShowWindow(window, SW_SHOW);
|
||||||
SetForegroundWindow(window);
|
SetForegroundWindow(window);
|
||||||
SetFocus(window);
|
SetFocus(window);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue