Skip to content

Commit

Permalink
update to take window name as arg
Browse files Browse the repository at this point in the history
  • Loading branch information
tadgem committed Jul 4, 2024
1 parent 2ffc289 commit 769698a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion backends/sdl/include/VulkanAPI_SDL.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace lvk {
virtual void CreateWindowLVK(uint32_t width, uint32_t height) override
{
SDL_Init(SDL_INIT_VIDEO | SDL_INIT_EVENTS);
SDL_Window* window = SDL_CreateWindow("SDL Vulkan Example", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, width, height, SDL_WINDOW_VULKAN | SDL_WINDOW_RESIZABLE);
SDL_Window* window = SDL_CreateWindow(p_AppName.c_str(), SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, width, height, SDL_WINDOW_VULKAN | SDL_WINDOW_RESIZABLE);
m_SdlHandle = new VulkanAPIWindowHandle_SDL(window);
m_WindowHandle = m_SdlHandle;
}
Expand Down
3 changes: 2 additions & 1 deletion lvk/include/lvk/VulkanAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ namespace lvk
void CreateVmaAllocator();
void GetMaxUsableSampleCount();
public:
void Start(uint32_t width, uint32_t height, bool enableSwapchainMsaa = false);
void Start(const String& appName, uint32_t width, uint32_t height, bool enableSwapchainMsaa = false);
void Quit();
inline int GetFrameIndex() { return p_CurrentFrameIndex; }
VkExtent2D GetMaxFramebufferExtent();
Expand Down Expand Up @@ -387,6 +387,7 @@ namespace lvk
uint64_t p_LastFrameTime;
int p_CurrentFrameIndex;
VkExtent2D p_MaxFramebufferExtent;
String p_AppName;
};

class Mesh
Expand Down
4 changes: 3 additions & 1 deletion lvk/src/lvk/VulkanAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1852,8 +1852,10 @@ void lvk::VulkanAPI::CreateRenderPass(VkRenderPass& renderPass, Vector<VkAttachm

#include "windows.h"
#include <dwmapi.h>
void lvk::VulkanAPI::Start(uint32_t width, uint32_t height, bool enableSwapchainMsaa)
void lvk::VulkanAPI::Start(const String& appName, uint32_t width, uint32_t height, bool enableSwapchainMsaa)
{
p_AppName = appName;

SetProcessDPIAware();

CreateWindowLVK(width, height);
Expand Down

0 comments on commit 769698a

Please sign in to comment.