fixing compilation issues

This commit is contained in:
2024-10-22 12:09:49 +02:00
parent 92743b0b03
commit a86f26f0f3
13 changed files with 72 additions and 97 deletions

View File

@@ -225,7 +225,7 @@ extern "C"
return 0;
}
void mlx_set_font(void* mlx, void* win, char* filepath)
void mlx_set_font(void* mlx, char* filepath)
{
MLX_CHECK_APPLICATION_POINTER(mlx);
if (filepath == nullptr)
@@ -240,12 +240,12 @@ extern "C"
return;
}
if(std::strcmp(filepath, "default") == 0)
static_cast<mlx::Application*>(mlx)->LoadFont(win, file, 6.f);
static_cast<mlx::Application*>(mlx)->LoadFont(file, 6.f);
else
static_cast<mlx::Application*>(mlx)->LoadFont(win, file, 16.f);
static_cast<mlx::Application*>(mlx)->LoadFont(file, 16.f);
}
void mlx_set_font_scale(void* mlx, void* win, char* filepath, float scale)
void mlx_set_font_scale(void* mlx, char* filepath, float scale)
{
MLX_CHECK_APPLICATION_POINTER(mlx);
if (filepath == nullptr)
@@ -259,7 +259,7 @@ extern "C"
mlx::Error("TTF loader : not a truetype font file '%'", filepath);
return;
}
static_cast<mlx::Application*>(mlx)->LoadFont(win, file, scale);
static_cast<mlx::Application*>(mlx)->LoadFont(file, scale);
}
int mlx_clear_window(void* mlx, void* win)

View File

@@ -87,30 +87,15 @@ namespace mlx
return surface;
}
std::vector<const char*> SDLManager::GetRequiredVulkanInstanceExtentions() const noexcept
std::vector<const char*> SDLManager::GetRequiredVulkanInstanceExtentions(Handle window) const noexcept
{
std::vector<const char*> extensions;
std::uint32_t count;
if(!SDL_Vulkan_GetInstanceExtensions(static_cast<Internal::WindowInfos*>(window)->window, &count, nullptr))
FatalError("SDL Manager : could not retrieve Vulkan instance extensions");
std::vector<const char*> extensions(count);
if(!SDL_Vulkan_GetInstanceExtensions(static_cast<Internal::WindowInfos*>(window)->window, &count, extensions.data()))
FatalError("SDL Manager : could not retrieve Vulkan instance extensions");
extensions.push_back(VK_KHR_SURFACE_EXTENSION_NAME);
#ifdef VK_USE_PLATFORM_XCB_KHR
extensions.push_back(VK_KHR_XCB_SURFACE_EXTENSION_NAME);
#endif
#ifdef VK_USE_PLATFORM_XLIB_KHR
extensions.push_back(VK_KHR_XLIB_SURFACE_EXTENSION_NAME);
#endif
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
// extensions.push_back(VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME);
#endif
#ifdef VK_USE_PLATFORM_WIN32_KHR
extensions.push_back(VK_KHR_WIN32_SURFACE_EXTENSION_NAME);
#endif
#ifdef VK_USE_PLATFORM_METAL_EXT
extensions.push_back(VK_EXT_METAL_SURFACE_EXTENSION_NAME);
#endif
return extensions;
}