fixing compilation issues

This commit is contained in:
Kbz-8
2024-10-22 12:09:49 +02:00
parent e7cb78557f
commit aa26e528c4
13 changed files with 72 additions and 97 deletions

View File

@@ -44,7 +44,7 @@ namespace mlx
inline void LoopHook(int (*f)(void*), void* param);
inline void LoopEnd() noexcept;
inline void LoadFont(Handle win, const std::filesystem::path& filepath, float scale);
inline void LoadFont(const std::filesystem::path& filepath, float scale);
void Run() noexcept;

View File

@@ -1,5 +1,6 @@
#pragma once
#include <Core/Application.h>
#include <Embedded/DogicaTTF.h>
#ifndef DISABLE_ALL_SAFETIES
#define CHECK_WINDOW_PTR(win) \
@@ -137,11 +138,17 @@ namespace mlx
m_graphics[*static_cast<int*>(win)]->StringPut(x, y, color, str);
}
void Application::LoadFont(Handle win, const std::filesystem::path& filepath, float scale)
void Application::LoadFont(const std::filesystem::path& filepath, float scale)
{
MLX_PROFILE_FUNCTION();
CHECK_WINDOW_PTR(win);
m_graphics[*static_cast<int*>(win)]->LoadFont(filepath, scale);
std::shared_ptr<Font> font;
if(filepath.string() == "default")
font = std::make_shared<Font>("default", dogica_ttf, scale);
else
font = std::make_shared<Font>(filepath, scale);
if(!m_font_registry.IsFontKnown(font))
return;
m_font_registry.RegisterFont(font);
}
void Application::TexturePut(Handle win, Handle img, int x, int y)

View File

@@ -28,8 +28,6 @@ namespace mlx
inline void StringPut(int x, int y, std::uint32_t color, std::string str);
inline void TexturePut(NonOwningPtr<class Texture> texture, int x, int y);
inline void LoadFont(const std::filesystem::path& filepath, float scale);
inline void TryEraseSpritesInScene(NonOwningPtr<Texture> texture) noexcept;
[[nodiscard]] MLX_FORCEINLINE bool HasWindow() const noexcept { return m_has_window; }

View File

@@ -46,13 +46,6 @@ namespace mlx
p_scene->BringToFront(std::move(sprite));
}
void GraphicsSupport::LoadFont(const std::filesystem::path& filepath, float scale)
{
MLX_PROFILE_FUNCTION();
(void)filepath;
(void)scale;
}
void GraphicsSupport::TryEraseSpritesInScene(NonOwningPtr<Texture> texture) noexcept
{
MLX_PROFILE_FUNCTION();

View File

@@ -16,7 +16,7 @@ namespace mlx
void InputsFetcher(func::function<void(mlx_event_type, int, int)> functor);
VkSurfaceKHR CreateVulkanSurface(Handle window, VkInstance instance) const noexcept;
std::vector<const char*> GetRequiredVulkanInstanceExtentions() const noexcept;
std::vector<const char*> GetRequiredVulkanInstanceExtentions(Handle window) const noexcept;
Vec2ui GetVulkanDrawableSize(Handle window) const noexcept;
void MoveMouseOnWindow(Handle window, int x, int y) const noexcept;
void GetScreenSizeWindowIsOn(Handle window, int* x, int* y) const noexcept;