Skip to content

Commit

Permalink
small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikolsi committed Feb 19, 2022
1 parent f63e217 commit ca2e804
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
4 changes: 3 additions & 1 deletion mirage/mirage_sdl/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down
22 changes: 13 additions & 9 deletions playground/vulkan_glfw/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@

#include <vku/vku.hpp> // Vulkan learning module + <vulkan/vulkan.hpp>

#include <mirage/context.hpp> // Mirage Rendering context interface
#include <mirage_glfw/context.hpp> // GLFW Rendering context -> Mirage Rendering context.
#include <mirage/context.hpp> // Mirage Rendering context interface
// #include <mirage/engine.hpp> // Mirage Rendering engine
#include <mirage_glfw/context.hpp> // GLFW Rendering context -> Mirage Rendering context

#include <GLFW/glfw3.h>

Expand Down Expand Up @@ -42,15 +43,18 @@ int main(int argc, char **argv)
// rendering context
std::shared_ptr<Mirage::IContext> 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
Expand Down

0 comments on commit ca2e804

Please sign in to comment.