Skip to content

Commit aa26e52

Browse files
committed
fixing compilation issues
1 parent e7cb785 commit aa26e52

File tree

13 files changed

+73
-98
lines changed

13 files changed

+73
-98
lines changed

example/main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ int update(void* param)
2020
mlx_clear_window(mlx->mlx, mlx->win);
2121

2222
if(i >= 250)
23-
mlx_set_font_scale(mlx->mlx, mlx->win, "default", 16.f);
23+
mlx_set_font_scale(mlx->mlx, "default", 16.f);
2424
else
25-
mlx_set_font_scale(mlx->mlx, mlx->win, "default", 6.f);
25+
mlx_set_font_scale(mlx->mlx, "default", 6.f);
2626

2727
mlx_string_put(mlx->mlx, mlx->win, 160, 120, 0xFFFF2066, "this text should be hidden");
2828

2929
mlx_put_image_to_window(mlx->mlx, mlx->win, mlx->logo_png, 100, 100);
3030
mlx_put_image_to_window(mlx->mlx, mlx->win, mlx->logo_bmp, 220, 40);
3131
mlx_put_image_to_window(mlx->mlx, mlx->win, mlx->img, 150, 60);
3232

33-
mlx_set_font(mlx->mlx, mlx->win, "default");
33+
mlx_set_font(mlx->mlx, "default");
3434
mlx_string_put(mlx->mlx, mlx->win, 20, 50, 0xFFFFFFFF, "that's a text");
3535

3636
for(int j = 0, color = 0; j < 400; j++)
@@ -145,7 +145,7 @@ int main(void)
145145

146146
mlx.img = create_image(&mlx);
147147

148-
mlx_set_font_scale(mlx.mlx, mlx.win, "font.ttf", 16.f);
148+
mlx_set_font_scale(mlx.mlx, "font.ttf", 16.f);
149149
mlx_string_put(mlx.mlx, mlx.win, 20, 20, 0xFF0020FF, "that text will disappear");
150150

151151
mlx_loop_hook(mlx.mlx, update, &mlx);

includes/mlx.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/* By: maldavid <contact@kbz8.me> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2022/10/04 16:56:35 by maldavid #+# #+# */
9-
/* Updated: 2024/10/17 17:51:28 by maldavid ### ########.fr */
9+
/* Updated: 2024/10/22 11:56:44 by maldavid ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

@@ -312,7 +312,7 @@ MLX_API int mlx_string_put(void* mlx, void* win, int x, int y, int color, char*
312312
*
313313
* @return (void)
314314
*/
315-
MLX_API void mlx_set_font(void* mlx, void* win, char* filepath);
315+
MLX_API void mlx_set_font(void* mlx, char* filepath);
316316

317317

318318
/**
@@ -325,7 +325,7 @@ MLX_API void mlx_set_font(void* mlx, void* win, char* filepath);
325325
*
326326
* @return (void)
327327
*/
328-
MLX_API void mlx_set_font_scale(void* mlx, void* win, char* filepath, float scale);
328+
MLX_API void mlx_set_font_scale(void* mlx, char* filepath, float scale);
329329

330330

331331
/**

runtime/Includes/Core/Application.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ namespace mlx
4444
inline void LoopHook(int (*f)(void*), void* param);
4545
inline void LoopEnd() noexcept;
4646

47-
inline void LoadFont(Handle win, const std::filesystem::path& filepath, float scale);
47+
inline void LoadFont(const std::filesystem::path& filepath, float scale);
4848

4949
void Run() noexcept;
5050

runtime/Includes/Core/Application.inl

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#pragma once
22
#include <Core/Application.h>
3+
#include <Embedded/DogicaTTF.h>
34

45
#ifndef DISABLE_ALL_SAFETIES
56
#define CHECK_WINDOW_PTR(win) \
@@ -137,11 +138,17 @@ namespace mlx
137138
m_graphics[*static_cast<int*>(win)]->StringPut(x, y, color, str);
138139
}
139140

140-
void Application::LoadFont(Handle win, const std::filesystem::path& filepath, float scale)
141+
void Application::LoadFont(const std::filesystem::path& filepath, float scale)
141142
{
142143
MLX_PROFILE_FUNCTION();
143-
CHECK_WINDOW_PTR(win);
144-
m_graphics[*static_cast<int*>(win)]->LoadFont(filepath, scale);
144+
std::shared_ptr<Font> font;
145+
if(filepath.string() == "default")
146+
font = std::make_shared<Font>("default", dogica_ttf, scale);
147+
else
148+
font = std::make_shared<Font>(filepath, scale);
149+
if(!m_font_registry.IsFontKnown(font))
150+
return;
151+
m_font_registry.RegisterFont(font);
145152
}
146153

147154
void Application::TexturePut(Handle win, Handle img, int x, int y)

runtime/Includes/Core/Graphics.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ namespace mlx
2828
inline void StringPut(int x, int y, std::uint32_t color, std::string str);
2929
inline void TexturePut(NonOwningPtr<class Texture> texture, int x, int y);
3030

31-
inline void LoadFont(const std::filesystem::path& filepath, float scale);
32-
3331
inline void TryEraseSpritesInScene(NonOwningPtr<Texture> texture) noexcept;
3432

3533
[[nodiscard]] MLX_FORCEINLINE bool HasWindow() const noexcept { return m_has_window; }

runtime/Includes/Core/Graphics.inl

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,6 @@ namespace mlx
4646
p_scene->BringToFront(std::move(sprite));
4747
}
4848

49-
void GraphicsSupport::LoadFont(const std::filesystem::path& filepath, float scale)
50-
{
51-
MLX_PROFILE_FUNCTION();
52-
(void)filepath;
53-
(void)scale;
54-
}
55-
5649
void GraphicsSupport::TryEraseSpritesInScene(NonOwningPtr<Texture> texture) noexcept
5750
{
5851
MLX_PROFILE_FUNCTION();

runtime/Includes/Core/SDLManager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace mlx
1616
void InputsFetcher(func::function<void(mlx_event_type, int, int)> functor);
1717

1818
VkSurfaceKHR CreateVulkanSurface(Handle window, VkInstance instance) const noexcept;
19-
std::vector<const char*> GetRequiredVulkanInstanceExtentions() const noexcept;
19+
std::vector<const char*> GetRequiredVulkanInstanceExtentions(Handle window) const noexcept;
2020
Vec2ui GetVulkanDrawableSize(Handle window) const noexcept;
2121
void MoveMouseOnWindow(Handle window, int x, int y) const noexcept;
2222
void GetScreenSizeWindowIsOn(Handle window, int* x, int* y) const noexcept;
Lines changed: 31 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,31 @@
1-
3,2,35,7,0,0,1,0,39,0,0,0,52,0,0,0,0,0,0,0,17,0,2,0,1,0,0,0,11,0,
2-
6,0,29,0,0,0,71,76,83,76,46,115,116,100,46,52,53,48,0,0,0,0,14,0,3,0,0,0,0,0,
3-
1,0,0,0,15,0,7,0,4,0,0,0,31,0,0,0,109,97,105,110,0,0,0,0,15,0,0,0,23,0,
4-
0,0,16,0,3,0,31,0,0,0,7,0,0,0,3,0,3,0,0,0,0,0,100,0,0,0,5,0,4,0,
5-
19,0,0,0,86,101,114,116,79,117,116,0,6,0,4,0,19,0,0,0,0,0,0,0,117,118,0,0,5,0,
6-
4,0,24,0,0,0,70,114,97,103,79,117,116,0,6,0,5,0,24,0,0,0,0,0,0,0,99,111,108,111,
7-
114,0,0,0,5,0,5,0,5,0,0,0,117,95,116,101,120,116,117,114,101,0,0,0,5,0,3,0,15,0,
8-
0,0,117,118,0,0,5,0,4,0,23,0,0,0,99,111,108,111,114,0,0,0,5,0,6,0,30,0,0,0,
9-
76,105,110,101,97,114,84,111,115,82,71,66,0,0,0,0,5,0,4,0,31,0,0,0,109,97,105,110,0,0,
10-
0,0,71,0,4,0,5,0,0,0,33,0,0,0,0,0,0,0,71,0,4,0,5,0,0,0,34,0,0,0,
11-
0,0,0,0,71,0,4,0,15,0,0,0,30,0,0,0,0,0,0,0,71,0,4,0,23,0,0,0,30,0,
12-
0,0,0,0,0,0,72,0,5,0,19,0,0,0,0,0,0,0,35,0,0,0,0,0,0,0,72,0,5,0,
13-
24,0,0,0,0,0,0,0,35,0,0,0,0,0,0,0,22,0,3,0,1,0,0,0,32,0,0,0,25,0,
14-
9,0,2,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,
15-
0,0,0,0,27,0,3,0,3,0,0,0,2,0,0,0,32,0,4,0,4,0,0,0,0,0,0,0,3,0,
16-
0,0,23,0,4,0,6,0,0,0,1,0,0,0,3,0,0,0,32,0,4,0,7,0,0,0,7,0,0,0,
17-
6,0,0,0,33,0,4,0,8,0,0,0,6,0,0,0,7,0,0,0,43,0,4,0,1,0,0,0,9,0,
18-
0,0,46,186,232,62,44,0,6,0,6,0,0,0,10,0,0,0,9,0,0,0,9,0,0,0,9,0,0,0,
19-
19,0,2,0,11,0,0,0,33,0,3,0,12,0,0,0,11,0,0,0,23,0,4,0,13,0,0,0,1,0,
20-
0,0,2,0,0,0,32,0,4,0,14,0,0,0,1,0,0,0,13,0,0,0,21,0,4,0,16,0,0,0,
21-
32,0,0,0,1,0,0,0,43,0,4,0,16,0,0,0,17,0,0,0,0,0,0,0,32,0,4,0,18,0,
22-
0,0,7,0,0,0,13,0,0,0,30,0,3,0,19,0,0,0,13,0,0,0,32,0,4,0,20,0,0,0,
23-
7,0,0,0,19,0,0,0,23,0,4,0,21,0,0,0,1,0,0,0,4,0,0,0,32,0,4,0,22,0,
24-
0,0,3,0,0,0,21,0,0,0,30,0,3,0,24,0,0,0,21,0,0,0,32,0,4,0,25,0,0,0,
25-
7,0,0,0,24,0,0,0,43,0,4,0,16,0,0,0,26,0,0,0,1,0,0,0,43,0,4,0,16,0,
26-
0,0,27,0,0,0,2,0,0,0,43,0,4,0,1,0,0,0,28,0,0,0,0,0,128,63,32,0,4,0,
27-
49,0,0,0,7,0,0,0,21,0,0,0,59,0,4,0,4,0,0,0,5,0,0,0,0,0,0,0,59,0,
28-
4,0,14,0,0,0,15,0,0,0,1,0,0,0,59,0,4,0,22,0,0,0,23,0,0,0,3,0,0,0,
29-
54,0,5,0,6,0,0,0,30,0,0,0,0,0,0,0,8,0,0,0,55,0,3,0,7,0,0,0,32,0,
30-
0,0,248,0,2,0,33,0,0,0,61,0,4,0,6,0,0,0,34,0,0,0,32,0,0,0,12,0,7,0,
31-
6,0,0,0,35,0,0,0,29,0,0,0,26,0,0,0,34,0,0,0,10,0,0,0,254,0,2,0,35,0,
32-
0,0,56,0,1,0,54,0,5,0,11,0,0,0,31,0,0,0,0,0,0,0,12,0,0,0,248,0,2,0,
33-
36,0,0,0,59,0,4,0,25,0,0,0,37,0,0,0,7,0,0,0,59,0,4,0,7,0,0,0,38,0,
34-
0,0,7,0,0,0,59,0,4,0,20,0,0,0,39,0,0,0,7,0,0,0,65,0,5,0,18,0,0,0,
35-
40,0,0,0,39,0,0,0,17,0,0,0,63,0,3,0,40,0,0,0,15,0,0,0,61,0,4,0,3,0,
36-
0,0,41,0,0,0,5,0,0,0,65,0,5,0,18,0,0,0,42,0,0,0,39,0,0,0,17,0,0,0,
37-
61,0,4,0,13,0,0,0,43,0,0,0,42,0,0,0,87,0,5,0,21,0,0,0,44,0,0,0,41,0,
38-
0,0,43,0,0,0,79,0,8,0,6,0,0,0,45,0,0,0,44,0,0,0,44,0,0,0,0,0,0,0,
39-
1,0,0,0,2,0,0,0,62,0,3,0,38,0,0,0,45,0,0,0,57,0,5,0,6,0,0,0,46,0,
40-
0,0,30,0,0,0,38,0,0,0,80,0,5,0,21,0,0,0,47,0,0,0,46,0,0,0,28,0,0,0,
41-
65,0,5,0,49,0,0,0,48,0,0,0,37,0,0,0,17,0,0,0,62,0,3,0,48,0,0,0,47,0,
42-
0,0,61,0,4,0,24,0,0,0,50,0,0,0,37,0,0,0,81,0,5,0,21,0,0,0,51,0,0,0,
43-
50,0,0,0,0,0,0,0,62,0,3,0,23,0,0,0,51,0,0,0,253,0,1,0,56,0,1,0
1+
3,2,35,7,0,0,1,0,39,0,0,0,34,0,0,0,0,0,0,0,17,0,2,0,1,0,0,0,14,0,
2+
3,0,0,0,0,0,1,0,0,0,15,0,7,0,4,0,0,0,21,0,0,0,109,97,105,110,0,0,0,0,
3+
10,0,0,0,18,0,0,0,16,0,3,0,21,0,0,0,7,0,0,0,3,0,3,0,0,0,0,0,100,0,
4+
0,0,5,0,4,0,14,0,0,0,86,101,114,116,79,117,116,0,6,0,4,0,14,0,0,0,0,0,0,0,
5+
117,118,0,0,5,0,4,0,19,0,0,0,70,114,97,103,79,117,116,0,6,0,5,0,19,0,0,0,0,0,
6+
0,0,99,111,108,111,114,0,0,0,5,0,5,0,5,0,0,0,117,95,116,101,120,116,117,114,101,0,0,0,
7+
5,0,3,0,10,0,0,0,117,118,0,0,5,0,4,0,18,0,0,0,99,111,108,111,114,0,0,0,5,0,
8+
4,0,21,0,0,0,109,97,105,110,0,0,0,0,71,0,4,0,5,0,0,0,33,0,0,0,0,0,0,0,
9+
71,0,4,0,5,0,0,0,34,0,0,0,0,0,0,0,71,0,4,0,10,0,0,0,30,0,0,0,0,0,
10+
0,0,71,0,4,0,18,0,0,0,30,0,0,0,0,0,0,0,72,0,5,0,14,0,0,0,0,0,0,0,
11+
35,0,0,0,0,0,0,0,72,0,5,0,19,0,0,0,0,0,0,0,35,0,0,0,0,0,0,0,22,0,
12+
3,0,1,0,0,0,32,0,0,0,25,0,9,0,2,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,
13+
0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,27,0,3,0,3,0,0,0,2,0,0,0,32,0,
14+
4,0,4,0,0,0,0,0,0,0,3,0,0,0,19,0,2,0,6,0,0,0,33,0,3,0,7,0,0,0,
15+
6,0,0,0,23,0,4,0,8,0,0,0,1,0,0,0,2,0,0,0,32,0,4,0,9,0,0,0,1,0,
16+
0,0,8,0,0,0,21,0,4,0,11,0,0,0,32,0,0,0,1,0,0,0,43,0,4,0,11,0,0,0,
17+
12,0,0,0,0,0,0,0,32,0,4,0,13,0,0,0,7,0,0,0,8,0,0,0,30,0,3,0,14,0,
18+
0,0,8,0,0,0,32,0,4,0,15,0,0,0,7,0,0,0,14,0,0,0,23,0,4,0,16,0,0,0,
19+
1,0,0,0,4,0,0,0,32,0,4,0,17,0,0,0,3,0,0,0,16,0,0,0,30,0,3,0,19,0,
20+
0,0,16,0,0,0,32,0,4,0,20,0,0,0,7,0,0,0,19,0,0,0,32,0,4,0,31,0,0,0,
21+
7,0,0,0,16,0,0,0,59,0,4,0,4,0,0,0,5,0,0,0,0,0,0,0,59,0,4,0,9,0,
22+
0,0,10,0,0,0,1,0,0,0,59,0,4,0,17,0,0,0,18,0,0,0,3,0,0,0,54,0,5,0,
23+
6,0,0,0,21,0,0,0,0,0,0,0,7,0,0,0,248,0,2,0,22,0,0,0,59,0,4,0,20,0,
24+
0,0,23,0,0,0,7,0,0,0,59,0,4,0,15,0,0,0,24,0,0,0,7,0,0,0,65,0,5,0,
25+
13,0,0,0,25,0,0,0,24,0,0,0,12,0,0,0,63,0,3,0,25,0,0,0,10,0,0,0,61,0,
26+
4,0,3,0,0,0,26,0,0,0,5,0,0,0,65,0,5,0,13,0,0,0,27,0,0,0,24,0,0,0,
27+
12,0,0,0,61,0,4,0,8,0,0,0,28,0,0,0,27,0,0,0,87,0,5,0,16,0,0,0,29,0,
28+
0,0,26,0,0,0,28,0,0,0,65,0,5,0,31,0,0,0,30,0,0,0,23,0,0,0,12,0,0,0,
29+
62,0,3,0,30,0,0,0,29,0,0,0,61,0,4,0,19,0,0,0,32,0,0,0,23,0,0,0,81,0,
30+
5,0,16,0,0,0,33,0,0,0,32,0,0,0,0,0,0,0,62,0,3,0,18,0,0,0,33,0,0,0,
31+
253,0,1,0,56,0,1,0

runtime/Includes/Graphics/Font.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,21 @@ namespace mlx
1111
Font(const std::filesystem::path& path, float scale) : m_build_data(path), m_name(path.string()), m_scale(scale) {}
1212
Font(const std::string& name, const std::vector<std::uint8_t>& ttf_data, float scale) : m_build_data(ttf_data), m_name(name), m_scale(scale) {}
1313

14+
void BuildFont();
1415
void Destroy();
1516

1617
inline const std::string& GetName() const { return m_name; }
1718
inline float GetScale() const noexcept { return m_scale; }
1819
inline const std::array<stbtt_packedchar, 96>& GetCharData() const { return m_cdata; }
19-
inline const Font& GetFont() const noexcept { return m_atlas; }
20+
inline const Texture& GetTexture() const noexcept { return m_atlas; }
2021
inline bool operator==(const Font& rhs) const { return rhs.m_name == m_name && rhs.m_scale == m_scale; }
2122
inline bool operator!=(const Font& rhs) const { return rhs.m_name != m_name || rhs.m_scale != m_scale; }
2223

2324
inline ~Font() { Destroy(); }
2425

25-
private:
26-
void BuildFont();
27-
2826
private:
2927
std::array<stbtt_packedchar, 96> m_cdata;
30-
Font m_atlas;
28+
Texture m_atlas;
3129
std::variant<std::filesystem::path, std::vector<std::uint8_t>> m_build_data;
3230
std::string m_name;
3331
float m_scale;

runtime/Includes/Platform/Window.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace mlx
2121
inline void SetPosition(int x, int y) { SDLManager::Get().SetWindowPosition(p_window, x, y); }
2222

2323
inline VkSurfaceKHR CreateVulkanSurface(VkInstance instance) const noexcept { return SDLManager::Get().CreateVulkanSurface(p_window, instance); }
24-
inline std::vector<const char*> GetRequiredVulkanInstanceExtentions() const noexcept { return SDLManager::Get().GetRequiredVulkanInstanceExtentions(); }
24+
inline std::vector<const char*> GetRequiredVulkanInstanceExtentions() const noexcept { return SDLManager::Get().GetRequiredVulkanInstanceExtentions(p_window); }
2525
inline Vec2ui GetVulkanDrawableSize() const noexcept { return SDLManager::Get().GetVulkanDrawableSize(p_window); }
2626

2727
void Destroy() noexcept;

runtime/Sources/Core/Bridge.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ extern "C"
225225
return 0;
226226
}
227227

228-
void mlx_set_font(void* mlx, void* win, char* filepath)
228+
void mlx_set_font(void* mlx, char* filepath)
229229
{
230230
MLX_CHECK_APPLICATION_POINTER(mlx);
231231
if (filepath == nullptr)
@@ -240,12 +240,12 @@ extern "C"
240240
return;
241241
}
242242
if(std::strcmp(filepath, "default") == 0)
243-
static_cast<mlx::Application*>(mlx)->LoadFont(win, file, 6.f);
243+
static_cast<mlx::Application*>(mlx)->LoadFont(file, 6.f);
244244
else
245-
static_cast<mlx::Application*>(mlx)->LoadFont(win, file, 16.f);
245+
static_cast<mlx::Application*>(mlx)->LoadFont(file, 16.f);
246246
}
247247

248-
void mlx_set_font_scale(void* mlx, void* win, char* filepath, float scale)
248+
void mlx_set_font_scale(void* mlx, char* filepath, float scale)
249249
{
250250
MLX_CHECK_APPLICATION_POINTER(mlx);
251251
if (filepath == nullptr)
@@ -259,7 +259,7 @@ extern "C"
259259
mlx::Error("TTF loader : not a truetype font file '%'", filepath);
260260
return;
261261
}
262-
static_cast<mlx::Application*>(mlx)->LoadFont(win, file, scale);
262+
static_cast<mlx::Application*>(mlx)->LoadFont(file, scale);
263263
}
264264

265265
int mlx_clear_window(void* mlx, void* win)

runtime/Sources/Core/SDLManager.cpp

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -87,30 +87,15 @@ namespace mlx
8787
return surface;
8888
}
8989

90-
std::vector<const char*> SDLManager::GetRequiredVulkanInstanceExtentions() const noexcept
91-
{
92-
std::vector<const char*> extensions;
90+
std::vector<const char*> SDLManager::GetRequiredVulkanInstanceExtentions(Handle window) const noexcept
91+
{
92+
std::uint32_t count;
93+
if(!SDL_Vulkan_GetInstanceExtensions(static_cast<Internal::WindowInfos*>(window)->window, &count, nullptr))
94+
FatalError("SDL Manager : could not retrieve Vulkan instance extensions");
95+
std::vector<const char*> extensions(count);
96+
if(!SDL_Vulkan_GetInstanceExtensions(static_cast<Internal::WindowInfos*>(window)->window, &count, extensions.data()))
97+
FatalError("SDL Manager : could not retrieve Vulkan instance extensions");
9398
extensions.push_back(VK_KHR_SURFACE_EXTENSION_NAME);
94-
95-
#ifdef VK_USE_PLATFORM_XCB_KHR
96-
extensions.push_back(VK_KHR_XCB_SURFACE_EXTENSION_NAME);
97-
#endif
98-
99-
#ifdef VK_USE_PLATFORM_XLIB_KHR
100-
extensions.push_back(VK_KHR_XLIB_SURFACE_EXTENSION_NAME);
101-
#endif
102-
103-
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
104-
// extensions.push_back(VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME);
105-
#endif
106-
107-
#ifdef VK_USE_PLATFORM_WIN32_KHR
108-
extensions.push_back(VK_KHR_WIN32_SURFACE_EXTENSION_NAME);
109-
#endif
110-
111-
#ifdef VK_USE_PLATFORM_METAL_EXT
112-
extensions.push_back(VK_EXT_METAL_SURFACE_EXTENSION_NAME);
113-
#endif
11499
return extensions;
115100
}
116101

runtime/Sources/Graphics/Font.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
#include <PreCompiled.h>
22

33
#include <Graphics/Font.h>
4+
#include <Core/Memory.h>
5+
6+
#define STB_TRUETYPE_IMPLEMENTATION
7+
#define STB_malloc(x, u) ((void)(u), MemManager::Get().Malloc(x))
8+
#define STB_free(x, u) ((void)(u), MemManager::Get().Free(x))
9+
#include <stb_truetype.h>
410

511
namespace mlx
612
{

0 commit comments

Comments
 (0)