From 5af4c82c1b1ec9e2b874bd1b8d87e10da062d6cb Mon Sep 17 00:00:00 2001 From: Kbz-8 Date: Mon, 22 Apr 2024 17:35:41 +0200 Subject: [PATCH] fixing multiple window issue --- src/core/application.cpp | 3 ++- src/core/graphics.cpp | 4 ++-- src/platform/inputs.h | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/core/application.cpp b/src/core/application.cpp index c0160c0..d000908 100644 --- a/src/core/application.cpp +++ b/src/core/application.cpp @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/10/04 22:10:52 by maldavid #+# #+# */ -/* Updated: 2024/04/21 18:13:29 by maldavid ### ########.fr */ +/* Updated: 2024/04/22 17:35:15 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -40,6 +40,7 @@ namespace mlx::core void Application::run() noexcept { + _in->run(); while(_in->isRunning()) { if(!_fps.update()) diff --git a/src/core/graphics.cpp b/src/core/graphics.cpp index 063a363..0ecf4be 100644 --- a/src/core/graphics.cpp +++ b/src/core/graphics.cpp @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/04/02 15:13:55 by maldavid #+# #+# */ -/* Updated: 2024/01/11 04:38:53 by maldavid ### ########.fr */ +/* Updated: 2024/04/22 17:34:27 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -52,7 +52,7 @@ namespace mlx _proj = glm::ortho(0, _width, 0, _height); _renderer->getUniformBuffer()->setData(sizeof(_proj), &_proj); - static std::array sets = { + std::array sets = { _renderer->getVertDescriptorSet().get(), VK_NULL_HANDLE }; diff --git a/src/platform/inputs.h b/src/platform/inputs.h index 6a575bb..c014f56 100644 --- a/src/platform/inputs.h +++ b/src/platform/inputs.h @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/10/05 16:27:35 by maldavid #+# #+# */ -/* Updated: 2024/02/25 07:51:55 by maldavid ### ########.fr */ +/* Updated: 2024/04/22 17:35:23 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -45,6 +45,7 @@ namespace mlx inline int getYRel() const noexcept { return _yRel; } inline bool isRunning() const noexcept { return !_end; } + inline constexpr void run() noexcept { _end = false; } inline constexpr void finish() noexcept { _end = true; } inline void addWindow(std::shared_ptr window)