From ca2e804bbc96c3428561c407b21c6325a596cbad Mon Sep 17 00:00:00 2001 From: Nikolai Arsenov Date: Sat, 16 Oct 2021 20:02:04 +0200 Subject: [PATCH] small cleanup --- mirage/mirage_sdl/context.cpp | 4 +++- playground/vulkan_glfw/main.cpp | 22 +++++++++++++--------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/mirage/mirage_sdl/context.cpp b/mirage/mirage_sdl/context.cpp index 4e941c3..3f58457 100644 --- a/mirage/mirage_sdl/context.cpp +++ b/mirage/mirage_sdl/context.cpp @@ -13,7 +13,9 @@ namespace Mirage SDL_SysWMinfo info; /* initialize System information object */ SDL_VERSION(&info.version); /* read SDL version */ - if (SDL_GetWindowWMInfo(window.get(), &info)) + auto raw_window = window.get(); + + if (SDL_GetWindowWMInfo(raw_window, &info)) { printf("SDL rendering context initialized\n"); } diff --git a/playground/vulkan_glfw/main.cpp b/playground/vulkan_glfw/main.cpp index 8eb5ee6..1ac0abf 100644 --- a/playground/vulkan_glfw/main.cpp +++ b/playground/vulkan_glfw/main.cpp @@ -3,8 +3,9 @@ #include // Vulkan learning module + -#include // Mirage Rendering context interface -#include // GLFW Rendering context -> Mirage Rendering context. +#include // Mirage Rendering context interface +// #include // Mirage Rendering engine +#include // GLFW Rendering context -> Mirage Rendering context #include @@ -42,15 +43,18 @@ int main(int argc, char **argv) // rendering context std::shared_ptr context = Mirage::GLFW::Context::create(window); - // // rendering engine - // auto engine = Mirage::Engine(context); + // rendering engine + // auto engine = Mirage::Engine::create(context); - glfwSetKeyCallback(window.get(), [](GLFWwindow *window, int key, int scancode, int action, int mods) { - if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) + glfwSetKeyCallback( + window.get(), + [](GLFWwindow *window, int key, int scancode, int action, int mods) { - glfwSetWindowShouldClose(window, GLFW_TRUE); - } - }); + if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) + { + glfwSetWindowShouldClose(window, GLFW_TRUE); + } + }); // ---- vulkan ---- // vk::Application