diff --git a/example/42_logo.bmp b/example/42_logo.bmp new file mode 100644 index 0000000..299dacc Binary files /dev/null and b/example/42_logo.bmp differ diff --git a/example/42_logo.jpg b/example/42_logo.jpg new file mode 100644 index 0000000..c40c51b Binary files /dev/null and b/example/42_logo.jpg differ diff --git a/example/build.sh b/example/build.sh index 4405e9d..b332c18 100755 --- a/example/build.sh +++ b/example/build.sh @@ -7,6 +7,6 @@ fi if [ $(uname -s) = 'Darwin' ]; then clang main.c ../libmlx.dylib -L /opt/homebrew/lib -lSDL2 -g; else - clang main.c ../libmlx.so -lSDL2 -g; + clang main.c ../libmlx.so -lSDL2 -g -Wall -Wextra -Werror; fi diff --git a/example/main.c b/example/main.c index de17d3c..ee817bb 100644 --- a/example/main.c +++ b/example/main.c @@ -6,118 +6,160 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/10/04 17:55:21 by maldavid #+# #+# */ -/* Updated: 2024/01/11 15:03:14 by maldavid ### ########.fr */ +/* Updated: 2024/01/18 09:58:15 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ #include -#include #include "../includes/mlx.h" -typedef struct s_mlx +typedef struct { - void *mlx; - void *win; - void *logo; - void *img; -} t_mlx; + void* mlx; + void* win; + void* logo_png; + void* logo_jpg; + void* logo_bmp; + void* img; +} mlx_t; -int update(void *param) +int update(void* param) { - static int i = 0; - int j; - int k; - t_mlx *mlx; + static int i = 0; + mlx_t* mlx = (mlx_t*)param; - mlx = (t_mlx *)param; + mlx_set_font_scale(mlx->mlx, mlx->win, "default", 6.f); mlx_string_put(mlx->mlx, mlx->win, 160, 120, 0xFFFF2066, "this text should be hidden"); - mlx_put_image_to_window(mlx->mlx, mlx->win, mlx->logo, 100, 100); + + mlx_put_image_to_window(mlx->mlx, mlx->win, mlx->logo_png, 100, 100); + mlx_put_image_to_window(mlx->mlx, mlx->win, mlx->logo_jpg, 210, 150); + mlx_put_image_to_window(mlx->mlx, mlx->win, mlx->logo_bmp, 220, 40); mlx_put_image_to_window(mlx->mlx, mlx->win, mlx->img, 150, 60); - if (i == 0) - mlx_set_font_scale(mlx->mlx, mlx->win, "font.ttf", 16.f); + mlx_string_put(mlx->mlx, mlx->win, 20, 50, 0xFFFFFFFF, "that's a text"); - j = 0; - k = 0; - while (j++ < 400) + + int color = 0; + for(int j = 0; j < 400; j++) { - mlx_pixel_put(mlx->mlx, mlx->win, j, j, 0xFFFF0000 + k); + mlx_pixel_put(mlx->mlx, mlx->win, j, j, 0xFFFF0000 + color); mlx_pixel_put(mlx->mlx, mlx->win, 399 - j, j, 0xFF0000FF); - k += (k < 255); + color += (color < 255); } - if (++i == 5000) + + if(++i == 5000) mlx_clear_window(mlx->mlx, mlx->win); - if (i == 7000) + if(i == 7000) mlx_set_font_scale(mlx->mlx, mlx->win, "default", 16.f); - return (0); + + return 0; } -void *create_image(t_mlx *mlx) +void* create_image(mlx_t* mlx) { - unsigned char pixel[4]; - int i[3]; - void *img; - - memset(i, 0, sizeof(int) * 3); - img = mlx_new_image(mlx->mlx, 100, 100); - while (i[0] < (100 * 100) * 4) + unsigned char pixel[4]; + void* img = mlx_new_image(mlx->mlx, 100, 100); + for(int i = 0, j = 0, k = 0; i < (100 * 100) * 4; i += 4, j++) { - if (i[0] < 10000 || i[0] > 20000) + if(j >= 100) { - pixel[0] = i[0]; - pixel[1] = i[1]; - pixel[2] = i[2]; - pixel[3] = 0x99; - mlx_set_image_pixel(mlx->mlx, img, i[1], i[2], *((int *)pixel)); + j = 0; + k++; } - i[0] += 4; - i[1]++; - if (i[1] >= 100) + if(i < 10000 || i > 20000) { - i[1] = 0; - i[2]++; + pixel[0] = i; + pixel[1] = j; + pixel[2] = k; + pixel[3] = 0x99; + mlx_set_image_pixel(mlx->mlx, img, j, k, *((int *)pixel)); } } - return (img); + return img; } -int key_hook(int key, void *param) +int key_hook(int key, void* param) { - if (key == 41) - mlx_loop_end(((t_mlx *)param)->mlx); - return (0); + int x; + int y; + mlx_t* mlx = (mlx_t*)param; + + mlx_mouse_get_pos(mlx->mlx, &x, &y); + switch(key) + { + case 41 : // ESCAPE + mlx_loop_end(mlx->mlx); + break; + case 22 : // (S)how + mlx_mouse_show(); + break; + case 11 : // (H)ide + mlx_mouse_hide(); + break; + case 6 : // (C)lear + mlx_clear_window(mlx->mlx, mlx->win); + break; + case 79 : // RIGHT KEY + mlx_mouse_move(mlx->mlx, mlx->win, x + 10, y); + break; + case 80 : // LEFT KEY + mlx_mouse_move(mlx->mlx, mlx->win, x - 10, y); + break; + case 81 : // UP KEY + mlx_mouse_move(mlx->mlx, mlx->win, x, y + 10); + break; + case 82 : // DOWN KEY + mlx_mouse_move(mlx->mlx, mlx->win, x, y - 10); + break; + + default : break; + } + return 0; } -int window_hook(int event, void *param) +int window_hook(int event, void* param) { - if (event == 0) - mlx_loop_end(((t_mlx *)param)->mlx); - return (0); + if(event == 0) + mlx_loop_end(((mlx_t*)param)->mlx); + return 0; } -int main(int argc, char **argv) +int main(void) { - t_mlx mlx; - void *img; - int w; - int h; + mlx_t mlx; + int w; + int h; + int dummy; - (void)argc; - (void)argv; mlx.mlx = mlx_init(); mlx.win = mlx_new_window(mlx.mlx, 400, 400, "My window"); + mlx_on_event(mlx.mlx, mlx.win, MLX_KEYDOWN, key_hook, &mlx); mlx_on_event(mlx.mlx, mlx.win, MLX_WINDOW_EVENT, window_hook, &mlx); - mlx.logo = mlx_png_file_to_image(mlx.mlx, "42_logo.png", &w, &h); + + mlx.logo_png = mlx_png_file_to_image(mlx.mlx, "42_logo.png", &dummy, &dummy); + mlx.logo_bmp = mlx_bmp_file_to_image(mlx.mlx, "42_logo.bmp", &dummy, &dummy); + mlx.logo_jpg = mlx_jpg_file_to_image(mlx.mlx, "42_logo.jpg", &dummy, &dummy); + mlx_pixel_put(mlx.mlx, mlx.win, 200, 10, 0xFFFF00FF); - mlx_put_image_to_window(mlx.mlx, mlx.win, mlx.logo, 10, 190); + mlx_put_image_to_window(mlx.mlx, mlx.win, mlx.logo_png, 10, 190); + mlx.img = create_image(&mlx); - mlx_string_put(mlx.mlx, mlx.win, 20, 20, 0xFF0020FF, \ - "that text will disappear"); + + mlx_set_font_scale(mlx.mlx, mlx.win, "font.ttf", 16.f); + mlx_string_put(mlx.mlx, mlx.win, 20, 20, 0xFF0020FF, "that text will disappear"); + mlx_loop_hook(mlx.mlx, update, &mlx); mlx_loop(mlx.mlx); - mlx_destroy_image(mlx.mlx, mlx.logo); + + mlx_get_screens_size(mlx.mlx, mlx.win, &w, &h); + printf("screen size : %dx%d\n", w, h); + + mlx_destroy_image(mlx.mlx, mlx.logo_png); + mlx_destroy_image(mlx.mlx, mlx.logo_jpg); + mlx_destroy_image(mlx.mlx, mlx.logo_bmp); mlx_destroy_image(mlx.mlx, mlx.img); mlx_destroy_window(mlx.mlx, mlx.win); mlx_destroy_display(mlx.mlx); - return (0); + + return 0; } diff --git a/includes/mlx.h b/includes/mlx.h index 6c5c733..809058a 100644 --- a/includes/mlx.h +++ b/includes/mlx.h @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/10/04 16:56:35 by maldavid #+# #+# */ -/* Updated: 2024/01/05 19:53:13 by maldavid ### ########.fr */ +/* Updated: 2024/01/18 09:55:36 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -349,15 +349,16 @@ MLX_API int mlx_destroy_display(void* mlx); /** - * @brief Get screen size + * @brief Get the size of the screen the given window is on * * @param mlx Internal MLX application + * @param win Internal window * @param w Get width size * @param h Get height size * * @return (int) Always return 0, made this to copy the behaviour of the original MLX */ -MLX_API int mlx_get_screens_size(void* mlx, int* w, int* h); +MLX_API int mlx_get_screens_size(void* mlx, void* win, int* w, int* h); #ifdef __cplusplus } diff --git a/scripts/fetch_dependencies.sh b/scripts/fetch_dependencies.sh old mode 100644 new mode 100755 diff --git a/src/core/application.cpp b/src/core/application.cpp index 514df83..cd33ee8 100644 --- a/src/core/application.cpp +++ b/src/core/application.cpp @@ -6,12 +6,13 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/10/04 22:10:52 by maldavid #+# #+# */ -/* Updated: 2024/01/11 05:08:42 by maldavid ### ########.fr */ +/* Updated: 2024/01/18 09:44:26 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ #include "application.h" #include +#include #include #include #include @@ -84,6 +85,7 @@ namespace mlx::core Application::~Application() { TextLibrary::get().clearLibrary(); + FontLibrary::get().clearLibrary(); if(__drop_sdl_responsability) return; SDL_QuitSubSystem(SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_EVENTS); diff --git a/src/core/application.h b/src/core/application.h index 6b4ee97..fee2c33 100644 --- a/src/core/application.h +++ b/src/core/application.h @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/10/04 21:49:46 by maldavid #+# #+# */ -/* Updated: 2024/01/10 19:57:12 by maldavid ### ########.fr */ +/* Updated: 2024/01/18 09:56:04 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -39,7 +39,7 @@ namespace mlx::core inline void onEvent(void* win, int event, int (*funct_ptr)(int, void*), void* param) noexcept; - inline void getScreenSize(int* w, int* h) noexcept; + inline void getScreenSize(void* win, int* w, int* h) noexcept; inline void* newGraphicsSuport(std::size_t w, std::size_t h, const char* title); inline void clearGraphicsSupport(void* win); diff --git a/src/core/application.inl b/src/core/application.inl index c942efb..9b27349 100644 --- a/src/core/application.inl +++ b/src/core/application.inl @@ -42,7 +42,6 @@ namespace mlx::core } SDL_WarpMouseInWindow(_graphics[*static_cast(win)]->getWindow()->getNativeWindow(), x, y); SDL_PumpEvents(); - SDL_FlushEvent(SDL_MOUSEMOTION); } void Application::onEvent(void* win, int event, int (*funct_ptr)(int, void*), void* param) noexcept @@ -56,10 +55,11 @@ namespace mlx::core _in->onEvent(_graphics[*static_cast(win)]->getWindow()->getID(), event, funct_ptr, param); } - void Application::getScreenSize(int* w, int* h) noexcept + void Application::getScreenSize(void* win, int* w, int* h) noexcept { + CHECK_WINDOW_PTR(win); SDL_DisplayMode DM; - SDL_GetDesktopDisplayMode(0, &DM); + SDL_GetDesktopDisplayMode(SDL_GetWindowDisplayIndex(_graphics[*static_cast(win)]->getWindow()->getNativeWindow()), &DM); *w = DM.w; *h = DM.h; } diff --git a/src/core/bridge.cpp b/src/core/bridge.cpp index f2d947b..5e7b962 100644 --- a/src/core/bridge.cpp +++ b/src/core/bridge.cpp @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/10/04 17:35:20 by maldavid #+# #+# */ -/* Updated: 2024/01/10 19:54:51 by maldavid ### ########.fr */ +/* Updated: 2024/01/18 09:55:53 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -47,6 +47,11 @@ extern "C" void* mlx_new_window(void* mlx, int w, int h, const char* title) { MLX_CHECK_APPLICATION_POINTER(mlx); + if(w <= 0 || h <= 0) + { + mlx::core::error::report(e_kind::fatal_error, "invalid window size (%d x %d)", w, h); + return NULL; // not nullptr for the C compatibility + } return static_cast(mlx)->newGraphicsSuport(w, h, title); } @@ -73,12 +78,14 @@ extern "C" int mlx_mouse_show() { - return SDL_ShowCursor(SDL_ENABLE); + SDL_ShowCursor(SDL_ENABLE); + return 0; } int mlx_mouse_hide() { - return SDL_ShowCursor(SDL_DISABLE); + SDL_ShowCursor(SDL_DISABLE); + return 0; } int mlx_mouse_move(void* mlx, void* win, int x, int y) @@ -105,6 +112,8 @@ extern "C" void* mlx_new_image(void* mlx, int width, int height) { MLX_CHECK_APPLICATION_POINTER(mlx); + if (width <= 0 || height <= 0) + mlx::core::error::report(e_kind::fatal_error, "invalid image size (%d x %d)", width, height); return static_cast(mlx)->newTexture(width, height); } @@ -142,6 +151,8 @@ extern "C" void* mlx_png_file_to_image(void* mlx, char* filename, int* width, int* height) { MLX_CHECK_APPLICATION_POINTER(mlx); + if (filename == nullptr) + mlx::core::error::report(e_kind::fatal_error, "PNG loader : filename is NULL"); std::filesystem::path file(filename); if(file.extension() != ".png") { @@ -154,6 +165,8 @@ extern "C" void* mlx_jpg_file_to_image(void* mlx, char* filename, int* width, int* height) { MLX_CHECK_APPLICATION_POINTER(mlx); + if (filename == nullptr) + mlx::core::error::report(e_kind::fatal_error, "JPG loader : filename is NULL"); std::filesystem::path file(filename); if(file.extension() != ".jpg" && file.extension() != ".jpeg") { @@ -166,6 +179,8 @@ extern "C" void* mlx_bmp_file_to_image(void* mlx, char* filename, int* width, int* height) { MLX_CHECK_APPLICATION_POINTER(mlx); + if (filename == nullptr) + mlx::core::error::report(e_kind::fatal_error, "BMP loader : filename is NULL"); std::filesystem::path file(filename); if(file.extension() != ".bmp" && file.extension() != ".dib") { @@ -202,6 +217,11 @@ extern "C" void mlx_set_font(void* mlx, void* win, char* filepath) { MLX_CHECK_APPLICATION_POINTER(mlx); + if (filepath == nullptr) + { + mlx::core::error::report(e_kind::error, "Font loader : filepath is NULL"); + return; + } std::filesystem::path file(filepath); if(std::strcmp(filepath, "default") != 0 && file.extension() != ".ttf" && file.extension() != ".tte") { @@ -214,6 +234,11 @@ extern "C" void mlx_set_font_scale(void* mlx, void* win, char* filepath, float scale) { MLX_CHECK_APPLICATION_POINTER(mlx); + if (filepath == nullptr) + { + mlx::core::error::report(e_kind::error, "Font loader : filepath is NULL"); + return; + } std::filesystem::path file(filepath); if(std::strcmp(filepath, "default") != 0 && file.extension() != ".ttf" && file.extension() != ".tte") { @@ -246,10 +271,10 @@ extern "C" return 0; } - int mlx_get_screens_size(void* mlx, int* w, int* h) + int mlx_get_screens_size(void* mlx, void* win, int* w, int* h) { MLX_CHECK_APPLICATION_POINTER(mlx); - static_cast(mlx)->getScreenSize(w, h); + static_cast(mlx)->getScreenSize(win, w, h); return 0; } } diff --git a/src/platform/inputs.cpp b/src/platform/inputs.cpp index 412732a..738fa1b 100644 --- a/src/platform/inputs.cpp +++ b/src/platform/inputs.cpp @@ -6,13 +6,12 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/10/05 16:30:19 by maldavid #+# #+# */ -/* Updated: 2024/01/10 18:31:13 by maldavid ### ########.fr */ +/* Updated: 2024/01/16 07:59:15 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ #include "inputs.h" #include -#include #include namespace mlx @@ -35,7 +34,7 @@ namespace mlx } uint32_t id = _event.window.windowID; - if(!_events_hooks.count(id)) + if(_events_hooks.find(id) == _events_hooks.end()) continue; auto& hooks = _events_hooks[id]; diff --git a/src/platform/inputs.h b/src/platform/inputs.h index fb663fc..e550009 100644 --- a/src/platform/inputs.h +++ b/src/platform/inputs.h @@ -6,15 +6,14 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/10/05 16:27:35 by maldavid #+# #+# */ -/* Updated: 2023/12/11 19:47:20 by vavaas ### ########.fr */ +/* Updated: 2024/01/16 07:59:08 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ #include #include -#include #include -#include +#include #include #include @@ -26,7 +25,7 @@ namespace mlx { struct Hook { - std::function hook; + func::function hook; void* param = nullptr; }; diff --git a/src/platform/window.cpp b/src/platform/window.cpp index aee77aa..44827ac 100644 --- a/src/platform/window.cpp +++ b/src/platform/window.cpp @@ -6,14 +6,13 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/10/04 17:36:44 by maldavid #+# #+# */ -/* Updated: 2023/12/27 16:57:28 by maldavid ### ########.fr */ +/* Updated: 2024/01/16 07:59:21 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ #include #include #include -#include namespace mlx { diff --git a/src/renderer/core/memory.cpp b/src/renderer/core/memory.cpp index 1e3ede0..ccb8ed0 100644 --- a/src/renderer/core/memory.cpp +++ b/src/renderer/core/memory.cpp @@ -6,7 +6,7 @@ /* By: kbz_8 +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/10/20 22:02:37 by kbz_8 #+# #+# */ -/* Updated: 2024/01/10 21:54:35 by maldavid ### ########.fr */ +/* Updated: 2024/01/18 10:11:02 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -98,7 +98,7 @@ namespace mlx vmaSetAllocationName(_allocator, allocation, name); } #ifdef DEBUG - core::error::report(e_kind::message, "Graphics Allocator : created new buffer"); + core::error::report(e_kind::message, "Graphics Allocator : created new buffer '%s'", name); #endif _active_buffers_allocations++; return allocation; @@ -128,7 +128,7 @@ namespace mlx vmaSetAllocationName(_allocator, allocation, name); } #ifdef DEBUG - core::error::report(e_kind::message, "Graphics Allocator : created new image"); + core::error::report(e_kind::message, "Graphics Allocator : created new image '%s'", name); #endif _active_images_allocations++; return allocation; diff --git a/src/renderer/descriptors/vk_descriptor_pool.cpp b/src/renderer/descriptors/vk_descriptor_pool.cpp index 188403f..03df39e 100644 --- a/src/renderer/descriptors/vk_descriptor_pool.cpp +++ b/src/renderer/descriptors/vk_descriptor_pool.cpp @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/01/23 18:34:23 by maldavid #+# #+# */ -/* Updated: 2024/01/03 13:13:54 by maldavid ### ########.fr */ +/* Updated: 2024/01/18 10:19:55 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -22,6 +22,7 @@ namespace mlx poolInfo.poolSizeCount = n; poolInfo.pPoolSizes = size; poolInfo.maxSets = 8192; + poolInfo.flags = VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT; VkResult res = vkCreateDescriptorPool(Render_Core::get().getDevice().get(), &poolInfo, nullptr, &_pool); if(res != VK_SUCCESS) diff --git a/src/renderer/descriptors/vk_descriptor_pool.h b/src/renderer/descriptors/vk_descriptor_pool.h index 82cf9c4..2c624ef 100644 --- a/src/renderer/descriptors/vk_descriptor_pool.h +++ b/src/renderer/descriptors/vk_descriptor_pool.h @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/01/23 18:32:43 by maldavid #+# #+# */ -/* Updated: 2024/01/03 15:27:45 by maldavid ### ########.fr */ +/* Updated: 2024/01/18 10:22:20 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -28,6 +28,8 @@ namespace mlx inline VkDescriptorPool& operator()() noexcept { return _pool; } inline VkDescriptorPool& get() noexcept { return _pool; } + inline bool isInit() const noexcept { return _pool != VK_NULL_HANDLE; } + private: VkDescriptorPool _pool = VK_NULL_HANDLE; }; diff --git a/src/renderer/descriptors/vk_descriptor_set.cpp b/src/renderer/descriptors/vk_descriptor_set.cpp index 423db02..8af5877 100644 --- a/src/renderer/descriptors/vk_descriptor_set.cpp +++ b/src/renderer/descriptors/vk_descriptor_set.cpp @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/01/23 18:40:44 by maldavid #+# #+# */ -/* Updated: 2024/01/10 18:28:34 by maldavid ### ########.fr */ +/* Updated: 2024/01/18 10:22:10 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -106,8 +106,24 @@ namespace mlx { return _desc_set[_renderer->getActiveImageIndex()]; } + VkDescriptorSet& DescriptorSet::get() noexcept { return _desc_set[_renderer->getActiveImageIndex()]; } + + void DescriptorSet::destroy() noexcept + { + MLX_PROFILE_FUNCTION(); + if(_pool->isInit()) + vkFreeDescriptorSets(Render_Core::get().getDevice().get(), _pool->get(), _desc_set.size(), _desc_set.data()); + for(auto& set : _desc_set) + { + if(set != VK_NULL_HANDLE) + set = VK_NULL_HANDLE; + } + #ifdef DEBUG + core::error::report(e_kind::message, "Vulkan : destroyed descriptor set"); + #endif + } } diff --git a/src/renderer/descriptors/vk_descriptor_set.h b/src/renderer/descriptors/vk_descriptor_set.h index d555d5c..5f2191e 100644 --- a/src/renderer/descriptors/vk_descriptor_set.h +++ b/src/renderer/descriptors/vk_descriptor_set.h @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/01/23 18:39:36 by maldavid #+# #+# */ -/* Updated: 2024/01/03 15:27:50 by maldavid ### ########.fr */ +/* Updated: 2024/01/18 10:13:25 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -35,6 +35,8 @@ namespace mlx VkDescriptorSet& operator()() noexcept; VkDescriptorSet& get() noexcept; + void destroy() noexcept; + private: std::array _desc_set; class DescriptorPool* _pool = nullptr; diff --git a/src/renderer/images/texture.cpp b/src/renderer/images/texture.cpp index 2206f64..16d693f 100644 --- a/src/renderer/images/texture.cpp +++ b/src/renderer/images/texture.cpp @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/03/31 18:03:35 by maldavid #+# #+# */ -/* Updated: 2024/01/11 01:20:29 by maldavid ### ########.fr */ +/* Updated: 2024/01/18 10:18:22 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -155,6 +155,7 @@ namespace mlx { MLX_PROFILE_FUNCTION(); Image::destroy(); + _set.destroy(); if(_buf_map.has_value()) _buf_map->destroy(); _vbo.destroy(); diff --git a/src/renderer/images/texture_atlas.cpp b/src/renderer/images/texture_atlas.cpp index b6eb61b..c03d712 100644 --- a/src/renderer/images/texture_atlas.cpp +++ b/src/renderer/images/texture_atlas.cpp @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/04/07 16:40:09 by maldavid #+# #+# */ -/* Updated: 2023/12/31 00:52:01 by maldavid ### ########.fr */ +/* Updated: 2024/01/18 10:18:08 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -51,5 +51,6 @@ namespace mlx void TextureAtlas::destroy() noexcept { Image::destroy(); + _set.destroy(); } } diff --git a/src/renderer/images/texture_atlas.h b/src/renderer/images/texture_atlas.h index 5fd4da9..bc465d7 100644 --- a/src/renderer/images/texture_atlas.h +++ b/src/renderer/images/texture_atlas.h @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/04/07 16:36:33 by maldavid #+# #+# */ -/* Updated: 2024/01/08 21:42:31 by maldavid ### ########.fr */ +/* Updated: 2024/01/18 02:47:30 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -30,7 +30,8 @@ namespace mlx void destroy() noexcept override; inline void setDescriptor(DescriptorSet&& set) noexcept { _set = set; } - inline VkDescriptorSet getSet() noexcept { return _set.isInit() ? _set.get() : VK_NULL_HANDLE; } + inline VkDescriptorSet getVkSet() noexcept { return _set.isInit() ? _set.get() : VK_NULL_HANDLE; } + inline DescriptorSet getSet() noexcept { return _set; } inline void updateSet(int binding) noexcept { _set.writeDescriptor(binding, *this); _has_been_updated = true; } inline bool hasBeenUpdated() const noexcept { return _has_been_updated; } inline constexpr void resetUpdate() noexcept { _has_been_updated = false; } diff --git a/src/renderer/images/vk_image.cpp b/src/renderer/images/vk_image.cpp index 3cf0592..412387e 100644 --- a/src/renderer/images/vk_image.cpp +++ b/src/renderer/images/vk_image.cpp @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/01/25 11:59:07 by maldavid #+# #+# */ -/* Updated: 2024/01/07 01:17:54 by maldavid ### ########.fr */ +/* Updated: 2024/01/18 09:47:26 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -252,16 +252,16 @@ namespace mlx void Image::destroy() noexcept { // not creating destroyer in `create` as some image may be copied (and so `this` will be invalid) - CmdResource::setDestroyer([this]() - { + //CmdResource::setDestroyer([this]() + //{ destroySampler(); destroyImageView(); if(_image != VK_NULL_HANDLE) Render_Core::get().getAllocator().destroyImage(_allocation, _image); _image = VK_NULL_HANDLE; - }); - CmdResource::requireDestroy(); + //}); + //CmdResource::requireDestroy(); } uint32_t formatSize(VkFormat format) diff --git a/src/renderer/pipeline/pipeline.cpp b/src/renderer/pipeline/pipeline.cpp index b8ca2b6..06ebfd3 100644 --- a/src/renderer/pipeline/pipeline.cpp +++ b/src/renderer/pipeline/pipeline.cpp @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/12/18 21:27:38 by maldavid #+# #+# */ -/* Updated: 2024/01/10 21:53:38 by maldavid ### ########.fr */ +/* Updated: 2024/01/16 07:45:15 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -49,7 +49,7 @@ namespace mlx gl_Position = uProj.mat * vec4(pos.x, pos.y, 0.0, 1.0); } */ - const std::vector vertex_shader = { + const std::vector vertex_shader = { // precompiled vertex shader 0x07230203,0x00010000,0x0008000b,0x0000003b,0x00000000,0x00020011,0x00000001,0x0006000b, 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, 0x000a000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000b,0x0000000f,0x00000015, @@ -124,7 +124,7 @@ namespace mlx fColor = process_color; } */ - const std::vector fragment_shader = { + const std::vector fragment_shader = { // pre compiled fragment shader 0x07230203,0x00010000,0x0008000b,0x0000002c,0x00000000,0x00020011,0x00000001,0x0006000b, 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, 0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x0000000d,0x0000002a,0x00030010, diff --git a/src/renderer/renderer.cpp b/src/renderer/renderer.cpp index 6cb8578..2e3b1c1 100644 --- a/src/renderer/renderer.cpp +++ b/src/renderer/renderer.cpp @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/12/18 17:25:16 by maldavid #+# #+# */ -/* Updated: 2024/01/10 14:18:35 by maldavid ### ########.fr */ +/* Updated: 2024/01/16 08:02:57 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -82,7 +82,7 @@ namespace mlx if(result == VK_ERROR_OUT_OF_DATE_KHR) { - _swapchain.recreate(); + recreateRenderData(); return false; } else if(result != VK_SUCCESS && result != VK_SUBOPTIMAL_KHR) @@ -145,7 +145,7 @@ namespace mlx if(result == VK_ERROR_OUT_OF_DATE_KHR || result == VK_SUBOPTIMAL_KHR || _framebufferResized) { _framebufferResized = false; - _swapchain.recreate(); + recreateRenderData(); } else if(result != VK_SUCCESS) core::error::report(e_kind::fatal_error, "Vulkan error : failed to present swap chain image"); @@ -158,6 +158,18 @@ namespace mlx } } + void Renderer::recreateRenderData() + { + _swapchain.recreate(); + _pass.destroy(); + _pass.init(_swapchain.getImagesFormat(), VK_IMAGE_LAYOUT_PRESENT_SRC_KHR); + for(auto& fb : _framebuffers) + fb.destroy(); + _framebuffers.clear(); + for(std::size_t i = 0; i < _swapchain.getImagesNumber(); i++) + _framebuffers.emplace_back().init(_pass, _swapchain.getImage(i)); + } + void Renderer::destroy() { MLX_PROFILE_FUNCTION(); diff --git a/src/renderer/renderer.h b/src/renderer/renderer.h index 7b4dd5f..1d4869b 100644 --- a/src/renderer/renderer.h +++ b/src/renderer/renderer.h @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/12/18 17:14:45 by maldavid #+# #+# */ -/* Updated: 2023/12/22 21:59:15 by kbz_8 ### ########.fr */ +/* Updated: 2024/01/16 08:01:25 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -113,6 +113,9 @@ namespace mlx ~Renderer() = default; + private: + void recreateRenderData(); + private: GraphicPipeline _pipeline; CmdManager _cmd; diff --git a/src/renderer/renderpass/vk_render_pass.cpp b/src/renderer/renderpass/vk_render_pass.cpp index 06b5e75..a4a08a1 100644 --- a/src/renderer/renderpass/vk_render_pass.cpp +++ b/src/renderer/renderpass/vk_render_pass.cpp @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/10/06 18:21:36 by maldavid #+# #+# */ -/* Updated: 2024/01/10 21:53:03 by maldavid ### ########.fr */ +/* Updated: 2024/01/16 08:22:39 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -18,7 +18,7 @@ namespace mlx { - static const VkClearValue clearColor = {{{ 0.0f, 0.0f, 0.0f, 1.0f }}}; // wtf, this mess to satisfy a warning + static const VkClearValue clearColor = {{{ 0.f, 0.f, 0.f, 1.0f }}}; // wtf, this mess to satisfy a warning void RenderPass::init(VkFormat attachement_format, VkImageLayout layout) { diff --git a/src/renderer/texts/font.cpp b/src/renderer/texts/font.cpp index c508c99..d025e12 100644 --- a/src/renderer/texts/font.cpp +++ b/src/renderer/texts/font.cpp @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/12/11 22:06:09 by kbz_8 #+# #+# */ -/* Updated: 2024/01/11 01:23:20 by maldavid ### ########.fr */ +/* Updated: 2024/01/18 13:16:18 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -19,51 +19,43 @@ constexpr const int RANGE = 1024; namespace mlx { - Font::Font(Renderer& renderer, const std::filesystem::path& path, float scale) : non_copyable(), _name(path.string()), _scale(scale) + Font::Font(Renderer& renderer, const std::filesystem::path& path, float scale) : _name(path.string()), _renderer(renderer), _scale(scale) { - MLX_PROFILE_FUNCTION(); - std::vector tmp_bitmap(RANGE * RANGE); - std::vector vulkan_bitmap(RANGE * RANGE * 4); - - std::ifstream file(path, std::ios::binary); - if(!file.is_open()) - { - core::error::report(e_kind::error, "Font load : cannot open font file, %s", _name.c_str()); - return; - } - std::ifstream::pos_type fileSize = std::filesystem::file_size(path); - file.seekg(0, std::ios::beg); - std::vector bytes(fileSize); - file.read(reinterpret_cast(bytes.data()), fileSize); - file.close(); - - stbtt_pack_context pc; - stbtt_PackBegin(&pc, tmp_bitmap.data(), RANGE, RANGE, RANGE, 1, nullptr); - stbtt_PackFontRange(&pc, bytes.data(), 0, scale, 32, 96, _cdata.data()); - stbtt_PackEnd(&pc); - for(int i = 0, j = 0; i < RANGE * RANGE; i++, j += 4) - { - vulkan_bitmap[j + 0] = tmp_bitmap[i]; - vulkan_bitmap[j + 1] = tmp_bitmap[i]; - vulkan_bitmap[j + 2] = tmp_bitmap[i]; - vulkan_bitmap[j + 3] = tmp_bitmap[i]; - } - #ifdef DEBUG - _atlas.create(vulkan_bitmap.data(), RANGE, RANGE, VK_FORMAT_R8G8B8A8_UNORM, std::string(_name + "_font_altas").c_str(), true); - #else - _atlas.create(vulkan_bitmap.data(), RANGE, RANGE, VK_FORMAT_R8G8B8A8_UNORM, nullptr, true); - #endif - _atlas.setDescriptor(renderer.getFragDescriptorSet().duplicate()); + _build_data = path; } - Font::Font(class Renderer& renderer, const std::string& name, const std::vector& ttf_data, float scale) : non_copyable(), _name(name), _scale(scale) + Font::Font(class Renderer& renderer, const std::string& name, const std::vector& ttf_data, float scale) : _name(name), _renderer(renderer), _scale(scale) + { + _build_data = ttf_data; + } + + void Font::buildFont() { MLX_PROFILE_FUNCTION(); + std::vector file_bytes; + if(std::holds_alternative(_build_data)) + { + std::ifstream file(std::get(_build_data), std::ios::binary); + if(!file.is_open()) + { + core::error::report(e_kind::error, "Font load : cannot open font file, %s", _name.c_str()); + return; + } + std::ifstream::pos_type fileSize = std::filesystem::file_size(std::get(_build_data)); + file.seekg(0, std::ios::beg); + file_bytes.resize(fileSize); + file.read(reinterpret_cast(file_bytes.data()), fileSize); + file.close(); + } + std::vector tmp_bitmap(RANGE * RANGE); std::vector vulkan_bitmap(RANGE * RANGE * 4); stbtt_pack_context pc; stbtt_PackBegin(&pc, tmp_bitmap.data(), RANGE, RANGE, RANGE, 1, nullptr); - stbtt_PackFontRange(&pc, ttf_data.data(), 0, scale, 32, 96, _cdata.data()); + if(std::holds_alternative(_build_data)) + stbtt_PackFontRange(&pc, file_bytes.data(), 0, _scale, 32, 96, _cdata.data()); + else + stbtt_PackFontRange(&pc, std::get>(_build_data).data(), 0, _scale, 32, 96, _cdata.data()); stbtt_PackEnd(&pc); for(int i = 0, j = 0; i < RANGE * RANGE; i++, j += 4) { @@ -77,12 +69,20 @@ namespace mlx #else _atlas.create(vulkan_bitmap.data(), RANGE, RANGE, VK_FORMAT_R8G8B8A8_UNORM, nullptr, true); #endif - _atlas.setDescriptor(renderer.getFragDescriptorSet().duplicate()); + _atlas.setDescriptor(_renderer.getFragDescriptorSet().duplicate()); + _is_init = true; + } + + void Font::destroy() + { + MLX_PROFILE_FUNCTION(); + _atlas.destroy(); + _is_init = false; } Font::~Font() { - MLX_PROFILE_FUNCTION(); - _atlas.destroy(); + if(_is_init) + destroy(); } } diff --git a/src/renderer/texts/font.h b/src/renderer/texts/font.h index d25c4b7..9e39cde 100644 --- a/src/renderer/texts/font.h +++ b/src/renderer/texts/font.h @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/12/11 21:17:04 by kbz_8 #+# #+# */ -/* Updated: 2023/12/14 17:51:40 by maldavid ### ########.fr */ +/* Updated: 2024/01/18 13:15:55 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -15,45 +15,41 @@ #include #include -#include #include #include +#include namespace mlx { - class Font : public non_copyable + class Font { + friend class FontLibrary; public: Font() = delete; Font(class Renderer& renderer, const std::filesystem::path& path, float scale); Font(class Renderer& renderer, const std::string& name, const std::vector& ttf_data, float scale); + inline const std::string& getName() const { return _name; } inline float getScale() const noexcept { return _scale; } inline const std::array& getCharData() const { return _cdata; } inline const TextureAtlas& getAtlas() const noexcept { return _atlas; } - inline bool operator==(const Font& rhs) const { return rhs._name == _name; } - inline bool operator!=(const Font& rhs) const { return rhs._name != _name; } + inline bool operator==(const Font& rhs) const { return rhs._name == _name && rhs._scale == _scale; } + inline bool operator!=(const Font& rhs) const { return rhs._name != _name || rhs._scale != _scale; } + void destroy(); + ~Font(); + private: + void buildFont(); + private: std::array _cdata; TextureAtlas _atlas; + std::variant> _build_data; std::string _name; + class Renderer& _renderer; float _scale = 0; - }; -} - -namespace std -{ - template <> - struct hash - { - std::size_t operator()(const mlx::Font& f) const noexcept - { - std::size_t hash = 0; - mlx::hashCombine(hash, f.getName(), f.getScale()); - return hash; - } + bool _is_init = false; }; } diff --git a/src/renderer/texts/font_library.cpp b/src/renderer/texts/font_library.cpp new file mode 100644 index 0000000..e3a04c0 --- /dev/null +++ b/src/renderer/texts/font_library.cpp @@ -0,0 +1,69 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* font_library.cpp :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: maldavid +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2024/01/18 09:28:14 by maldavid #+# #+# */ +/* Updated: 2024/01/18 13:07:48 by maldavid ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include +#include +#include +#include +#include +#include + +namespace mlx +{ + std::shared_ptr FontLibrary::getFontData(FontID id) + { + MLX_PROFILE_FUNCTION(); + if(!_cache.count(id) || std::find(_invalid_ids.begin(), _invalid_ids.end(), id) != _invalid_ids.end()) + core::error::report(e_kind::fatal_error, "Font Library : wrong font ID '%d'", id); + return _cache[id]; + } + + FontID FontLibrary::addFontToLibrary(std::shared_ptr font) + { + MLX_PROFILE_FUNCTION(); + auto it = std::find_if(_cache.begin(), _cache.end(), [&](const std::pair>& v) + { + return v.second->getScale() == font->getScale() && + v.second->getName() == font->getName() && + std::find(_invalid_ids.begin(), _invalid_ids.end(), v.first) == _invalid_ids.end(); + }); + if(it != _cache.end()) + return it->first; + font->buildFont(); + _cache[_current_id] = font; + _current_id++; + return _current_id - 1; + } + + void FontLibrary::removeFontFromLibrary(FontID id) + { + MLX_PROFILE_FUNCTION(); + if(!_cache.count(id) || std::find(_invalid_ids.begin(), _invalid_ids.end(), id) != _invalid_ids.end()) + { + core::error::report(e_kind::warning, "Font Library : trying to remove a font with an unkown or invalid ID '%d'", id); + return; + } + _cache[id]->destroy(); + _invalid_ids.push_back(id); + } + + void FontLibrary::clearLibrary() + { + MLX_PROFILE_FUNCTION(); + for(auto& [id, font] : _cache) + { + font->destroy(); + _invalid_ids.push_back(id); + } + // do not `_cache.clear();` as it releases the fonts and may not destroy the texture atlas that is in use by command buffers + } +} diff --git a/src/renderer/texts/font_library.h b/src/renderer/texts/font_library.h new file mode 100644 index 0000000..9a1d4dc --- /dev/null +++ b/src/renderer/texts/font_library.h @@ -0,0 +1,52 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* font_library.h :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: maldavid +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2024/01/18 09:26:03 by maldavid #+# #+# */ +/* Updated: 2024/01/18 09:33:30 by maldavid ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#ifndef __MLX_FONT_LIBRARY__ +#define __MLX_FONT_LIBRARY__ + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace mlx +{ + using FontID = uint32_t; + constexpr FontID nullfont = 0; + + class FontLibrary : public Singleton + { + friend class Singleton; + + public: + std::shared_ptr getFontData(FontID id); + FontID addFontToLibrary(std::shared_ptr font); + void removeFontFromLibrary(FontID id); + + void clearLibrary(); + + private: + FontLibrary() = default; + ~FontLibrary() = default; + + private: + std::unordered_map> _cache; + std::vector _invalid_ids; + FontID _current_id = 1; + }; +} + +#endif diff --git a/src/renderer/texts/text.cpp b/src/renderer/texts/text.cpp index bf1823d..b26c01c 100644 --- a/src/renderer/texts/text.cpp +++ b/src/renderer/texts/text.cpp @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/01/11 00:11:56 by maldavid #+# #+# */ -/* Updated: 2024/01/11 03:31:57 by maldavid ### ########.fr */ +/* Updated: 2024/01/18 13:56:50 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -16,15 +16,21 @@ namespace mlx { - void Text::init(std::string text, Font const* font, std::vector vbo_data, std::vector ibo_data) + void Text::init(std::string text, FontID font, std::vector vbo_data, std::vector ibo_data) { MLX_PROFILE_FUNCTION(); _text = std::move(text); _font = font; #ifdef DEBUG + std::string debug_name = _text; + for(char& c : debug_name) + { + if(c == ' ' || c == '"' || c == '\'') + c = '_'; + } for(int i = 0; i < MAX_FRAMES_IN_FLIGHT; i++) - _vbo[i].create(sizeof(Vertex) * vbo_data.size(), static_cast(vbo_data.data()), _text.c_str()); - _ibo.create(sizeof(uint16_t) * ibo_data.size(), ibo_data.data(), _text.c_str()); + _vbo[i].create(sizeof(Vertex) * vbo_data.size(), static_cast(vbo_data.data()), debug_name.c_str()); + _ibo.create(sizeof(uint16_t) * ibo_data.size(), ibo_data.data(), debug_name.c_str()); #else for(int i = 0; i < MAX_FRAMES_IN_FLIGHT; i++) _vbo[i].create(sizeof(Vertex) * vbo_data.size(), static_cast(vbo_data.data()), nullptr); diff --git a/src/renderer/texts/text.h b/src/renderer/texts/text.h index eff6f8a..44bd7a1 100644 --- a/src/renderer/texts/text.h +++ b/src/renderer/texts/text.h @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/01/11 00:09:04 by maldavid #+# #+# */ -/* Updated: 2024/01/11 00:13:25 by maldavid ### ########.fr */ +/* Updated: 2024/01/18 09:37:42 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -26,9 +27,9 @@ namespace mlx public: Text() = default; - void init(std::string text, Font const* font, std::vector vbo_data, std::vector ibo_data); + void init(std::string text, FontID font, std::vector vbo_data, std::vector ibo_data); void bind(class Renderer& renderer) noexcept; - inline const Font& getFontInUse() const noexcept { return *_font; } + inline FontID getFontInUse() const noexcept { return _font; } void updateVertexData(int frame, std::vector vbo_data); inline uint32_t getIBOsize() noexcept { return _ibo.getSize(); } inline const std::string& getText() const { return _text; } @@ -40,7 +41,7 @@ namespace mlx std::array _vbo; C_IBO _ibo; std::string _text; - Font const* _font = nullptr; + FontID _font = nullfont; }; } diff --git a/src/renderer/texts/text_descriptor.cpp b/src/renderer/texts/text_descriptor.cpp index bc1f35a..4db185a 100644 --- a/src/renderer/texts/text_descriptor.cpp +++ b/src/renderer/texts/text_descriptor.cpp @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/01/11 00:23:11 by maldavid #+# #+# */ -/* Updated: 2024/01/11 03:40:54 by maldavid ### ########.fr */ +/* Updated: 2024/01/18 09:44:54 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -33,7 +33,7 @@ namespace mlx TextDrawDescriptor::TextDrawDescriptor(std::string text, uint32_t _color, int _x, int _y) : color(_color), x(_x), y(_y), _text(std::move(text)) {} - void TextDrawDescriptor::init(Font* const font) noexcept + void TextDrawDescriptor::init(FontID font) noexcept { MLX_PROFILE_FUNCTION(); std::vector vertexData; @@ -42,34 +42,38 @@ namespace mlx float stb_x = 0.0f; float stb_y = 0.0f; - for(char c : _text) { - if(c < 32) - continue; + std::shared_ptr font_data = FontLibrary::get().getFontData(font); - stbtt_aligned_quad q; - stbtt_GetPackedQuad(font->getCharData().data(), RANGE, RANGE, c - 32, &stb_x, &stb_y, &q, 1); + for(char c : _text) + { + if(c < 32) + continue; - std::size_t index = vertexData.size(); + stbtt_aligned_quad q; + stbtt_GetPackedQuad(font_data->getCharData().data(), RANGE, RANGE, c - 32, &stb_x, &stb_y, &q, 1); - glm::vec4 vertex_color = { - static_cast((color & 0x000000FF)) / 255.f, - static_cast((color & 0x0000FF00) >> 8) / 255.f, - static_cast((color & 0x00FF0000) >> 16) / 255.f, - static_cast((color & 0xFF000000) >> 24) / 255.f - }; + std::size_t index = vertexData.size(); - vertexData.emplace_back(glm::vec2{q.x0, q.y0}, vertex_color, glm::vec2{q.s0, q.t0}); - vertexData.emplace_back(glm::vec2{q.x1, q.y0}, vertex_color, glm::vec2{q.s1, q.t0}); - vertexData.emplace_back(glm::vec2{q.x1, q.y1}, vertex_color, glm::vec2{q.s1, q.t1}); - vertexData.emplace_back(glm::vec2{q.x0, q.y1}, vertex_color, glm::vec2{q.s0, q.t1}); + glm::vec4 vertex_color = { + static_cast((color & 0x000000FF)) / 255.f, + static_cast((color & 0x0000FF00) >> 8) / 255.f, + static_cast((color & 0x00FF0000) >> 16) / 255.f, + static_cast((color & 0xFF000000) >> 24) / 255.f + }; - indexData.emplace_back(index + 0); - indexData.emplace_back(index + 1); - indexData.emplace_back(index + 2); - indexData.emplace_back(index + 2); - indexData.emplace_back(index + 3); - indexData.emplace_back(index + 0); + vertexData.emplace_back(glm::vec2{q.x0, q.y0}, vertex_color, glm::vec2{q.s0, q.t0}); + vertexData.emplace_back(glm::vec2{q.x1, q.y0}, vertex_color, glm::vec2{q.s1, q.t0}); + vertexData.emplace_back(glm::vec2{q.x1, q.y1}, vertex_color, glm::vec2{q.s1, q.t1}); + vertexData.emplace_back(glm::vec2{q.x0, q.y1}, vertex_color, glm::vec2{q.s0, q.t1}); + + indexData.emplace_back(index + 0); + indexData.emplace_back(index + 1); + indexData.emplace_back(index + 2); + indexData.emplace_back(index + 2); + indexData.emplace_back(index + 3); + indexData.emplace_back(index + 0); + } } std::shared_ptr text_data = std::make_shared(); text_data->init(_text, font, std::move(vertexData), std::move(indexData)); @@ -84,13 +88,14 @@ namespace mlx { MLX_PROFILE_FUNCTION(); std::shared_ptr draw_data = TextLibrary::get().getTextData(id); - TextureAtlas& atlas = const_cast(draw_data->getFontInUse().getAtlas()); + std::shared_ptr font_data = FontLibrary::get().getFontData(draw_data->getFontInUse()); + TextureAtlas& atlas = const_cast(font_data->getAtlas()); draw_data->bind(renderer); - if(atlas.getSet() == VK_NULL_HANDLE) + if(!atlas.getSet().isInit()) atlas.setDescriptor(renderer.getFragDescriptorSet().duplicate()); if(!atlas.hasBeenUpdated()) atlas.updateSet(0); - sets[1] = const_cast(atlas).getSet(); + sets[1] = const_cast(atlas).getVkSet(); vkCmdBindDescriptorSets(renderer.getActiveCmdBuffer().get(), VK_PIPELINE_BIND_POINT_GRAPHICS, renderer.getPipeline().getPipelineLayout(), 0, sets.size(), sets.data(), 0, nullptr); atlas.render(renderer, x, y, draw_data->getIBOsize()); } @@ -98,7 +103,8 @@ namespace mlx void TextDrawDescriptor::resetUpdate() { std::shared_ptr draw_data = TextLibrary::get().getTextData(id); - TextureAtlas& atlas = const_cast(draw_data->getFontInUse().getAtlas()); + std::shared_ptr font_data = FontLibrary::get().getFontData(draw_data->getFontInUse()); + TextureAtlas& atlas = const_cast(font_data->getAtlas()); atlas.resetUpdate(); } } diff --git a/src/renderer/texts/text_descriptor.h b/src/renderer/texts/text_descriptor.h index b44300b..bc8d239 100644 --- a/src/renderer/texts/text_descriptor.h +++ b/src/renderer/texts/text_descriptor.h @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/01/11 00:13:34 by maldavid #+# #+# */ -/* Updated: 2024/01/11 04:28:58 by maldavid ### ########.fr */ +/* Updated: 2024/01/18 09:40:06 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -19,6 +19,7 @@ #include #include #include +#include #include namespace mlx @@ -36,7 +37,7 @@ namespace mlx public: TextDrawDescriptor(std::string text, uint32_t _color, int _x, int _y); - void init(Font* const font) noexcept; + void init(FontID font) noexcept; bool operator==(const TextDrawDescriptor& rhs) const { return _text == rhs._text && x == rhs.x && y == rhs.y && color == rhs.color; } void render(std::array& sets, Renderer& renderer) override; void resetUpdate() override; diff --git a/src/renderer/texts/text_library.cpp b/src/renderer/texts/text_library.cpp index 9dd5658..4a61b38 100644 --- a/src/renderer/texts/text_library.cpp +++ b/src/renderer/texts/text_library.cpp @@ -6,11 +6,10 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/04/10 11:59:57 by maldavid #+# #+# */ -/* Updated: 2024/01/11 05:19:24 by maldavid ### ########.fr */ +/* Updated: 2024/01/18 08:02:31 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ -#include #include #include #include diff --git a/src/renderer/texts/text_library.h b/src/renderer/texts/text_library.h index 19ae1eb..9bdef36 100644 --- a/src/renderer/texts/text_library.h +++ b/src/renderer/texts/text_library.h @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/04/10 11:52:30 by maldavid #+# #+# */ -/* Updated: 2024/01/11 05:08:04 by maldavid ### ########.fr */ +/* Updated: 2024/01/16 08:54:15 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -15,7 +15,6 @@ #include #include -#include #include #include #include diff --git a/src/renderer/texts/text_manager.cpp b/src/renderer/texts/text_manager.cpp index d4a9f82..81dffd7 100644 --- a/src/renderer/texts/text_manager.cpp +++ b/src/renderer/texts/text_manager.cpp @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/04/06 16:41:13 by maldavid #+# #+# */ -/* Updated: 2024/01/11 04:54:16 by maldavid ### ########.fr */ +/* Updated: 2024/01/18 09:45:24 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -14,28 +14,28 @@ #include #include #include -#include #include -#include #include -#include namespace mlx { void TextManager::init(Renderer& renderer) noexcept { MLX_PROFILE_FUNCTION(); - _font_in_use = &const_cast(*_font_set.emplace(renderer, "default", dogica_ttf, 6.0f).first); + loadFont(renderer, "default", 6.f); } void TextManager::loadFont(Renderer& renderer, const std::filesystem::path& filepath, float scale) { MLX_PROFILE_FUNCTION(); - if(filepath.string() == "default") // we're sure it is already loaded - _font_in_use = &const_cast(*_font_set.emplace(renderer, "default", dogica_ttf, scale).first); + std::shared_ptr font; + if(filepath.string() == "default") + font = std::make_shared(renderer, "default", dogica_ttf, scale); else - _font_in_use = &const_cast(*_font_set.emplace(renderer, filepath, scale).first); + font = std::make_shared(renderer, filepath, scale); + + _font_in_use = FontLibrary::get().addFontToLibrary(font); } std::pair TextManager::registerText(int x, int y, uint32_t color, std::string str) @@ -49,8 +49,9 @@ namespace mlx } auto text_ptr = TextLibrary::get().getTextData(res.first->id); - if(*_font_in_use != text_ptr->getFontInUse()) + if(_font_in_use != text_ptr->getFontInUse()) { + // TODO : update text vertex buffers rather than destroying it and recreating it TextLibrary::get().removeTextFromLibrary(res.first->id); const_cast(*res.first).init(_font_in_use); } @@ -61,6 +62,5 @@ namespace mlx { MLX_PROFILE_FUNCTION(); _text_descriptors.clear(); - _font_set.clear(); } } diff --git a/src/renderer/texts/text_manager.h b/src/renderer/texts/text_manager.h index 93cfedb..8198b66 100644 --- a/src/renderer/texts/text_manager.h +++ b/src/renderer/texts/text_manager.h @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/04/06 16:24:11 by maldavid #+# #+# */ -/* Updated: 2024/01/11 05:18:42 by maldavid ### ########.fr */ +/* Updated: 2024/01/18 13:52:01 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -19,9 +19,12 @@ #include #include #include +#include #include #include #include +#include +#include namespace mlx { @@ -40,8 +43,7 @@ namespace mlx private: std::unordered_set _text_descriptors; - std::unordered_set _font_set; - Font* _font_in_use = nullptr; + FontID _font_in_use = nullfont; }; } diff --git a/third_party/glm/common.hpp b/third_party/glm/common.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/_features.hpp b/third_party/glm/detail/_features.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/_fixes.hpp b/third_party/glm/detail/_fixes.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/_noise.hpp b/third_party/glm/detail/_noise.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/_swizzle.hpp b/third_party/glm/detail/_swizzle.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/_swizzle_func.hpp b/third_party/glm/detail/_swizzle_func.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/_vectorize.hpp b/third_party/glm/detail/_vectorize.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/compute_common.hpp b/third_party/glm/detail/compute_common.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/compute_vector_relational.hpp b/third_party/glm/detail/compute_vector_relational.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/func_common.inl b/third_party/glm/detail/func_common.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/func_common_simd.inl b/third_party/glm/detail/func_common_simd.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/func_exponential.inl b/third_party/glm/detail/func_exponential.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/func_exponential_simd.inl b/third_party/glm/detail/func_exponential_simd.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/func_geometric.inl b/third_party/glm/detail/func_geometric.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/func_geometric_simd.inl b/third_party/glm/detail/func_geometric_simd.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/func_integer.inl b/third_party/glm/detail/func_integer.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/func_integer_simd.inl b/third_party/glm/detail/func_integer_simd.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/func_matrix.inl b/third_party/glm/detail/func_matrix.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/func_matrix_simd.inl b/third_party/glm/detail/func_matrix_simd.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/func_packing.inl b/third_party/glm/detail/func_packing.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/func_packing_simd.inl b/third_party/glm/detail/func_packing_simd.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/func_trigonometric.inl b/third_party/glm/detail/func_trigonometric.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/func_trigonometric_simd.inl b/third_party/glm/detail/func_trigonometric_simd.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/func_vector_relational.inl b/third_party/glm/detail/func_vector_relational.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/func_vector_relational_simd.inl b/third_party/glm/detail/func_vector_relational_simd.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/glm.cpp b/third_party/glm/detail/glm.cpp old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/qualifier.hpp b/third_party/glm/detail/qualifier.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/setup.hpp b/third_party/glm/detail/setup.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/type_float.hpp b/third_party/glm/detail/type_float.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/type_half.hpp b/third_party/glm/detail/type_half.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/type_half.inl b/third_party/glm/detail/type_half.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/type_mat2x2.hpp b/third_party/glm/detail/type_mat2x2.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/type_mat2x2.inl b/third_party/glm/detail/type_mat2x2.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/type_mat2x3.hpp b/third_party/glm/detail/type_mat2x3.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/type_mat2x3.inl b/third_party/glm/detail/type_mat2x3.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/type_mat2x4.hpp b/third_party/glm/detail/type_mat2x4.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/type_mat2x4.inl b/third_party/glm/detail/type_mat2x4.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/type_mat3x2.hpp b/third_party/glm/detail/type_mat3x2.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/type_mat3x2.inl b/third_party/glm/detail/type_mat3x2.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/type_mat3x3.hpp b/third_party/glm/detail/type_mat3x3.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/type_mat3x3.inl b/third_party/glm/detail/type_mat3x3.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/type_mat3x4.hpp b/third_party/glm/detail/type_mat3x4.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/type_mat3x4.inl b/third_party/glm/detail/type_mat3x4.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/type_mat4x2.hpp b/third_party/glm/detail/type_mat4x2.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/type_mat4x2.inl b/third_party/glm/detail/type_mat4x2.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/type_mat4x3.hpp b/third_party/glm/detail/type_mat4x3.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/type_mat4x3.inl b/third_party/glm/detail/type_mat4x3.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/type_mat4x4.hpp b/third_party/glm/detail/type_mat4x4.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/type_mat4x4.inl b/third_party/glm/detail/type_mat4x4.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/type_mat4x4_simd.inl b/third_party/glm/detail/type_mat4x4_simd.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/type_quat.hpp b/third_party/glm/detail/type_quat.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/type_quat.inl b/third_party/glm/detail/type_quat.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/type_quat_simd.inl b/third_party/glm/detail/type_quat_simd.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/type_vec1.hpp b/third_party/glm/detail/type_vec1.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/type_vec1.inl b/third_party/glm/detail/type_vec1.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/type_vec2.hpp b/third_party/glm/detail/type_vec2.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/type_vec2.inl b/third_party/glm/detail/type_vec2.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/type_vec3.hpp b/third_party/glm/detail/type_vec3.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/type_vec3.inl b/third_party/glm/detail/type_vec3.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/type_vec4.hpp b/third_party/glm/detail/type_vec4.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/type_vec4.inl b/third_party/glm/detail/type_vec4.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/detail/type_vec4_simd.inl b/third_party/glm/detail/type_vec4_simd.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/exponential.hpp b/third_party/glm/exponential.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext.hpp b/third_party/glm/ext.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_clip_space.hpp b/third_party/glm/ext/matrix_clip_space.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_clip_space.inl b/third_party/glm/ext/matrix_clip_space.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_common.hpp b/third_party/glm/ext/matrix_common.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_common.inl b/third_party/glm/ext/matrix_common.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_double2x2.hpp b/third_party/glm/ext/matrix_double2x2.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_double2x2_precision.hpp b/third_party/glm/ext/matrix_double2x2_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_double2x3.hpp b/third_party/glm/ext/matrix_double2x3.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_double2x3_precision.hpp b/third_party/glm/ext/matrix_double2x3_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_double2x4.hpp b/third_party/glm/ext/matrix_double2x4.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_double2x4_precision.hpp b/third_party/glm/ext/matrix_double2x4_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_double3x2.hpp b/third_party/glm/ext/matrix_double3x2.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_double3x2_precision.hpp b/third_party/glm/ext/matrix_double3x2_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_double3x3.hpp b/third_party/glm/ext/matrix_double3x3.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_double3x3_precision.hpp b/third_party/glm/ext/matrix_double3x3_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_double3x4.hpp b/third_party/glm/ext/matrix_double3x4.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_double3x4_precision.hpp b/third_party/glm/ext/matrix_double3x4_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_double4x2.hpp b/third_party/glm/ext/matrix_double4x2.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_double4x2_precision.hpp b/third_party/glm/ext/matrix_double4x2_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_double4x3.hpp b/third_party/glm/ext/matrix_double4x3.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_double4x3_precision.hpp b/third_party/glm/ext/matrix_double4x3_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_double4x4.hpp b/third_party/glm/ext/matrix_double4x4.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_double4x4_precision.hpp b/third_party/glm/ext/matrix_double4x4_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_float2x2.hpp b/third_party/glm/ext/matrix_float2x2.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_float2x2_precision.hpp b/third_party/glm/ext/matrix_float2x2_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_float2x3.hpp b/third_party/glm/ext/matrix_float2x3.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_float2x3_precision.hpp b/third_party/glm/ext/matrix_float2x3_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_float2x4.hpp b/third_party/glm/ext/matrix_float2x4.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_float2x4_precision.hpp b/third_party/glm/ext/matrix_float2x4_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_float3x2.hpp b/third_party/glm/ext/matrix_float3x2.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_float3x2_precision.hpp b/third_party/glm/ext/matrix_float3x2_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_float3x3.hpp b/third_party/glm/ext/matrix_float3x3.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_float3x3_precision.hpp b/third_party/glm/ext/matrix_float3x3_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_float3x4.hpp b/third_party/glm/ext/matrix_float3x4.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_float3x4_precision.hpp b/third_party/glm/ext/matrix_float3x4_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_float4x2.hpp b/third_party/glm/ext/matrix_float4x2.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_float4x2_precision.hpp b/third_party/glm/ext/matrix_float4x2_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_float4x3.hpp b/third_party/glm/ext/matrix_float4x3.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_float4x3_precision.hpp b/third_party/glm/ext/matrix_float4x3_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_float4x4.hpp b/third_party/glm/ext/matrix_float4x4.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_float4x4_precision.hpp b/third_party/glm/ext/matrix_float4x4_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_projection.hpp b/third_party/glm/ext/matrix_projection.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_projection.inl b/third_party/glm/ext/matrix_projection.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_relational.hpp b/third_party/glm/ext/matrix_relational.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_relational.inl b/third_party/glm/ext/matrix_relational.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_transform.hpp b/third_party/glm/ext/matrix_transform.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/matrix_transform.inl b/third_party/glm/ext/matrix_transform.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/quaternion_common.hpp b/third_party/glm/ext/quaternion_common.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/quaternion_common.inl b/third_party/glm/ext/quaternion_common.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/quaternion_common_simd.inl b/third_party/glm/ext/quaternion_common_simd.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/quaternion_double.hpp b/third_party/glm/ext/quaternion_double.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/quaternion_double_precision.hpp b/third_party/glm/ext/quaternion_double_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/quaternion_exponential.hpp b/third_party/glm/ext/quaternion_exponential.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/quaternion_exponential.inl b/third_party/glm/ext/quaternion_exponential.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/quaternion_float.hpp b/third_party/glm/ext/quaternion_float.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/quaternion_float_precision.hpp b/third_party/glm/ext/quaternion_float_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/quaternion_geometric.hpp b/third_party/glm/ext/quaternion_geometric.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/quaternion_geometric.inl b/third_party/glm/ext/quaternion_geometric.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/quaternion_relational.hpp b/third_party/glm/ext/quaternion_relational.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/quaternion_relational.inl b/third_party/glm/ext/quaternion_relational.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/quaternion_transform.hpp b/third_party/glm/ext/quaternion_transform.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/quaternion_transform.inl b/third_party/glm/ext/quaternion_transform.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/quaternion_trigonometric.hpp b/third_party/glm/ext/quaternion_trigonometric.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/quaternion_trigonometric.inl b/third_party/glm/ext/quaternion_trigonometric.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/scalar_common.hpp b/third_party/glm/ext/scalar_common.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/scalar_common.inl b/third_party/glm/ext/scalar_common.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/scalar_constants.hpp b/third_party/glm/ext/scalar_constants.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/scalar_constants.inl b/third_party/glm/ext/scalar_constants.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/scalar_int_sized.hpp b/third_party/glm/ext/scalar_int_sized.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/scalar_integer.hpp b/third_party/glm/ext/scalar_integer.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/scalar_integer.inl b/third_party/glm/ext/scalar_integer.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/scalar_relational.hpp b/third_party/glm/ext/scalar_relational.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/scalar_relational.inl b/third_party/glm/ext/scalar_relational.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/scalar_uint_sized.hpp b/third_party/glm/ext/scalar_uint_sized.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/scalar_ulp.hpp b/third_party/glm/ext/scalar_ulp.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/scalar_ulp.inl b/third_party/glm/ext/scalar_ulp.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_bool1.hpp b/third_party/glm/ext/vector_bool1.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_bool1_precision.hpp b/third_party/glm/ext/vector_bool1_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_bool2.hpp b/third_party/glm/ext/vector_bool2.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_bool2_precision.hpp b/third_party/glm/ext/vector_bool2_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_bool3.hpp b/third_party/glm/ext/vector_bool3.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_bool3_precision.hpp b/third_party/glm/ext/vector_bool3_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_bool4.hpp b/third_party/glm/ext/vector_bool4.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_bool4_precision.hpp b/third_party/glm/ext/vector_bool4_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_common.hpp b/third_party/glm/ext/vector_common.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_common.inl b/third_party/glm/ext/vector_common.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_double1.hpp b/third_party/glm/ext/vector_double1.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_double1_precision.hpp b/third_party/glm/ext/vector_double1_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_double2.hpp b/third_party/glm/ext/vector_double2.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_double2_precision.hpp b/third_party/glm/ext/vector_double2_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_double3.hpp b/third_party/glm/ext/vector_double3.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_double3_precision.hpp b/third_party/glm/ext/vector_double3_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_double4.hpp b/third_party/glm/ext/vector_double4.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_double4_precision.hpp b/third_party/glm/ext/vector_double4_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_float1.hpp b/third_party/glm/ext/vector_float1.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_float1_precision.hpp b/third_party/glm/ext/vector_float1_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_float2.hpp b/third_party/glm/ext/vector_float2.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_float2_precision.hpp b/third_party/glm/ext/vector_float2_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_float3.hpp b/third_party/glm/ext/vector_float3.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_float3_precision.hpp b/third_party/glm/ext/vector_float3_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_float4.hpp b/third_party/glm/ext/vector_float4.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_float4_precision.hpp b/third_party/glm/ext/vector_float4_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_int1.hpp b/third_party/glm/ext/vector_int1.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_int1_precision.hpp b/third_party/glm/ext/vector_int1_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_int2.hpp b/third_party/glm/ext/vector_int2.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_int2_precision.hpp b/third_party/glm/ext/vector_int2_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_int3.hpp b/third_party/glm/ext/vector_int3.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_int3_precision.hpp b/third_party/glm/ext/vector_int3_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_int4.hpp b/third_party/glm/ext/vector_int4.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_int4_precision.hpp b/third_party/glm/ext/vector_int4_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_integer.hpp b/third_party/glm/ext/vector_integer.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_integer.inl b/third_party/glm/ext/vector_integer.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_relational.hpp b/third_party/glm/ext/vector_relational.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_relational.inl b/third_party/glm/ext/vector_relational.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_uint1.hpp b/third_party/glm/ext/vector_uint1.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_uint1_precision.hpp b/third_party/glm/ext/vector_uint1_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_uint2.hpp b/third_party/glm/ext/vector_uint2.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_uint2_precision.hpp b/third_party/glm/ext/vector_uint2_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_uint3.hpp b/third_party/glm/ext/vector_uint3.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_uint3_precision.hpp b/third_party/glm/ext/vector_uint3_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_uint4.hpp b/third_party/glm/ext/vector_uint4.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_uint4_precision.hpp b/third_party/glm/ext/vector_uint4_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_ulp.hpp b/third_party/glm/ext/vector_ulp.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/ext/vector_ulp.inl b/third_party/glm/ext/vector_ulp.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/fwd.hpp b/third_party/glm/fwd.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/geometric.hpp b/third_party/glm/geometric.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/glm.hpp b/third_party/glm/glm.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtc/bitfield.hpp b/third_party/glm/gtc/bitfield.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtc/bitfield.inl b/third_party/glm/gtc/bitfield.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtc/color_space.hpp b/third_party/glm/gtc/color_space.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtc/color_space.inl b/third_party/glm/gtc/color_space.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtc/constants.hpp b/third_party/glm/gtc/constants.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtc/constants.inl b/third_party/glm/gtc/constants.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtc/epsilon.hpp b/third_party/glm/gtc/epsilon.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtc/epsilon.inl b/third_party/glm/gtc/epsilon.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtc/integer.hpp b/third_party/glm/gtc/integer.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtc/integer.inl b/third_party/glm/gtc/integer.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtc/matrix_access.hpp b/third_party/glm/gtc/matrix_access.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtc/matrix_access.inl b/third_party/glm/gtc/matrix_access.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtc/matrix_integer.hpp b/third_party/glm/gtc/matrix_integer.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtc/matrix_inverse.hpp b/third_party/glm/gtc/matrix_inverse.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtc/matrix_inverse.inl b/third_party/glm/gtc/matrix_inverse.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtc/matrix_transform.hpp b/third_party/glm/gtc/matrix_transform.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtc/matrix_transform.inl b/third_party/glm/gtc/matrix_transform.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtc/noise.hpp b/third_party/glm/gtc/noise.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtc/noise.inl b/third_party/glm/gtc/noise.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtc/packing.hpp b/third_party/glm/gtc/packing.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtc/packing.inl b/third_party/glm/gtc/packing.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtc/quaternion.hpp b/third_party/glm/gtc/quaternion.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtc/quaternion.inl b/third_party/glm/gtc/quaternion.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtc/quaternion_simd.inl b/third_party/glm/gtc/quaternion_simd.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtc/random.hpp b/third_party/glm/gtc/random.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtc/random.inl b/third_party/glm/gtc/random.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtc/reciprocal.hpp b/third_party/glm/gtc/reciprocal.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtc/reciprocal.inl b/third_party/glm/gtc/reciprocal.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtc/round.hpp b/third_party/glm/gtc/round.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtc/round.inl b/third_party/glm/gtc/round.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtc/type_aligned.hpp b/third_party/glm/gtc/type_aligned.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtc/type_precision.hpp b/third_party/glm/gtc/type_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtc/type_precision.inl b/third_party/glm/gtc/type_precision.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtc/type_ptr.hpp b/third_party/glm/gtc/type_ptr.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtc/type_ptr.inl b/third_party/glm/gtc/type_ptr.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtc/ulp.hpp b/third_party/glm/gtc/ulp.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtc/ulp.inl b/third_party/glm/gtc/ulp.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtc/vec1.hpp b/third_party/glm/gtc/vec1.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/associated_min_max.hpp b/third_party/glm/gtx/associated_min_max.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/associated_min_max.inl b/third_party/glm/gtx/associated_min_max.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/bit.hpp b/third_party/glm/gtx/bit.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/bit.inl b/third_party/glm/gtx/bit.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/closest_point.hpp b/third_party/glm/gtx/closest_point.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/closest_point.inl b/third_party/glm/gtx/closest_point.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/color_encoding.hpp b/third_party/glm/gtx/color_encoding.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/color_encoding.inl b/third_party/glm/gtx/color_encoding.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/color_space.hpp b/third_party/glm/gtx/color_space.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/color_space.inl b/third_party/glm/gtx/color_space.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/color_space_YCoCg.hpp b/third_party/glm/gtx/color_space_YCoCg.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/color_space_YCoCg.inl b/third_party/glm/gtx/color_space_YCoCg.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/common.hpp b/third_party/glm/gtx/common.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/common.inl b/third_party/glm/gtx/common.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/compatibility.hpp b/third_party/glm/gtx/compatibility.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/compatibility.inl b/third_party/glm/gtx/compatibility.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/component_wise.hpp b/third_party/glm/gtx/component_wise.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/component_wise.inl b/third_party/glm/gtx/component_wise.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/dual_quaternion.hpp b/third_party/glm/gtx/dual_quaternion.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/dual_quaternion.inl b/third_party/glm/gtx/dual_quaternion.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/easing.hpp b/third_party/glm/gtx/easing.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/easing.inl b/third_party/glm/gtx/easing.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/euler_angles.hpp b/third_party/glm/gtx/euler_angles.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/euler_angles.inl b/third_party/glm/gtx/euler_angles.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/extend.hpp b/third_party/glm/gtx/extend.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/extend.inl b/third_party/glm/gtx/extend.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/extended_min_max.hpp b/third_party/glm/gtx/extended_min_max.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/extended_min_max.inl b/third_party/glm/gtx/extended_min_max.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/exterior_product.hpp b/third_party/glm/gtx/exterior_product.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/exterior_product.inl b/third_party/glm/gtx/exterior_product.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/fast_exponential.hpp b/third_party/glm/gtx/fast_exponential.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/fast_exponential.inl b/third_party/glm/gtx/fast_exponential.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/fast_square_root.hpp b/third_party/glm/gtx/fast_square_root.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/fast_square_root.inl b/third_party/glm/gtx/fast_square_root.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/fast_trigonometry.hpp b/third_party/glm/gtx/fast_trigonometry.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/fast_trigonometry.inl b/third_party/glm/gtx/fast_trigonometry.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/float_notmalize.inl b/third_party/glm/gtx/float_notmalize.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/functions.hpp b/third_party/glm/gtx/functions.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/functions.inl b/third_party/glm/gtx/functions.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/gradient_paint.hpp b/third_party/glm/gtx/gradient_paint.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/gradient_paint.inl b/third_party/glm/gtx/gradient_paint.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/handed_coordinate_space.hpp b/third_party/glm/gtx/handed_coordinate_space.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/handed_coordinate_space.inl b/third_party/glm/gtx/handed_coordinate_space.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/hash.hpp b/third_party/glm/gtx/hash.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/hash.inl b/third_party/glm/gtx/hash.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/integer.hpp b/third_party/glm/gtx/integer.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/integer.inl b/third_party/glm/gtx/integer.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/intersect.hpp b/third_party/glm/gtx/intersect.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/intersect.inl b/third_party/glm/gtx/intersect.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/io.hpp b/third_party/glm/gtx/io.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/io.inl b/third_party/glm/gtx/io.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/log_base.hpp b/third_party/glm/gtx/log_base.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/log_base.inl b/third_party/glm/gtx/log_base.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/matrix_cross_product.hpp b/third_party/glm/gtx/matrix_cross_product.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/matrix_cross_product.inl b/third_party/glm/gtx/matrix_cross_product.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/matrix_decompose.hpp b/third_party/glm/gtx/matrix_decompose.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/matrix_decompose.inl b/third_party/glm/gtx/matrix_decompose.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/matrix_factorisation.hpp b/third_party/glm/gtx/matrix_factorisation.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/matrix_factorisation.inl b/third_party/glm/gtx/matrix_factorisation.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/matrix_interpolation.hpp b/third_party/glm/gtx/matrix_interpolation.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/matrix_interpolation.inl b/third_party/glm/gtx/matrix_interpolation.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/matrix_major_storage.hpp b/third_party/glm/gtx/matrix_major_storage.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/matrix_major_storage.inl b/third_party/glm/gtx/matrix_major_storage.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/matrix_operation.hpp b/third_party/glm/gtx/matrix_operation.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/matrix_operation.inl b/third_party/glm/gtx/matrix_operation.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/matrix_query.hpp b/third_party/glm/gtx/matrix_query.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/matrix_query.inl b/third_party/glm/gtx/matrix_query.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/matrix_transform_2d.hpp b/third_party/glm/gtx/matrix_transform_2d.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/matrix_transform_2d.inl b/third_party/glm/gtx/matrix_transform_2d.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/mixed_product.hpp b/third_party/glm/gtx/mixed_product.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/mixed_product.inl b/third_party/glm/gtx/mixed_product.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/norm.hpp b/third_party/glm/gtx/norm.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/norm.inl b/third_party/glm/gtx/norm.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/normal.hpp b/third_party/glm/gtx/normal.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/normal.inl b/third_party/glm/gtx/normal.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/normalize_dot.hpp b/third_party/glm/gtx/normalize_dot.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/normalize_dot.inl b/third_party/glm/gtx/normalize_dot.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/number_precision.hpp b/third_party/glm/gtx/number_precision.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/number_precision.inl b/third_party/glm/gtx/number_precision.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/optimum_pow.hpp b/third_party/glm/gtx/optimum_pow.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/optimum_pow.inl b/third_party/glm/gtx/optimum_pow.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/orthonormalize.hpp b/third_party/glm/gtx/orthonormalize.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/orthonormalize.inl b/third_party/glm/gtx/orthonormalize.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/perpendicular.hpp b/third_party/glm/gtx/perpendicular.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/perpendicular.inl b/third_party/glm/gtx/perpendicular.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/polar_coordinates.hpp b/third_party/glm/gtx/polar_coordinates.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/polar_coordinates.inl b/third_party/glm/gtx/polar_coordinates.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/projection.hpp b/third_party/glm/gtx/projection.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/projection.inl b/third_party/glm/gtx/projection.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/quaternion.hpp b/third_party/glm/gtx/quaternion.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/quaternion.inl b/third_party/glm/gtx/quaternion.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/range.hpp b/third_party/glm/gtx/range.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/raw_data.hpp b/third_party/glm/gtx/raw_data.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/raw_data.inl b/third_party/glm/gtx/raw_data.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/rotate_normalized_axis.hpp b/third_party/glm/gtx/rotate_normalized_axis.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/rotate_normalized_axis.inl b/third_party/glm/gtx/rotate_normalized_axis.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/rotate_vector.hpp b/third_party/glm/gtx/rotate_vector.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/rotate_vector.inl b/third_party/glm/gtx/rotate_vector.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/scalar_multiplication.hpp b/third_party/glm/gtx/scalar_multiplication.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/scalar_relational.hpp b/third_party/glm/gtx/scalar_relational.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/scalar_relational.inl b/third_party/glm/gtx/scalar_relational.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/spline.hpp b/third_party/glm/gtx/spline.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/spline.inl b/third_party/glm/gtx/spline.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/std_based_type.hpp b/third_party/glm/gtx/std_based_type.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/std_based_type.inl b/third_party/glm/gtx/std_based_type.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/string_cast.hpp b/third_party/glm/gtx/string_cast.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/string_cast.inl b/third_party/glm/gtx/string_cast.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/texture.hpp b/third_party/glm/gtx/texture.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/texture.inl b/third_party/glm/gtx/texture.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/transform.hpp b/third_party/glm/gtx/transform.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/transform.inl b/third_party/glm/gtx/transform.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/transform2.hpp b/third_party/glm/gtx/transform2.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/transform2.inl b/third_party/glm/gtx/transform2.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/type_aligned.hpp b/third_party/glm/gtx/type_aligned.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/type_aligned.inl b/third_party/glm/gtx/type_aligned.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/type_trait.hpp b/third_party/glm/gtx/type_trait.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/type_trait.inl b/third_party/glm/gtx/type_trait.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/vec_swizzle.hpp b/third_party/glm/gtx/vec_swizzle.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/vector_angle.hpp b/third_party/glm/gtx/vector_angle.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/vector_angle.inl b/third_party/glm/gtx/vector_angle.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/vector_query.hpp b/third_party/glm/gtx/vector_query.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/vector_query.inl b/third_party/glm/gtx/vector_query.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/wrap.hpp b/third_party/glm/gtx/wrap.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/gtx/wrap.inl b/third_party/glm/gtx/wrap.inl old mode 100644 new mode 100755 diff --git a/third_party/glm/integer.hpp b/third_party/glm/integer.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/mat2x2.hpp b/third_party/glm/mat2x2.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/mat2x3.hpp b/third_party/glm/mat2x3.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/mat2x4.hpp b/third_party/glm/mat2x4.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/mat3x2.hpp b/third_party/glm/mat3x2.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/mat3x3.hpp b/third_party/glm/mat3x3.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/mat3x4.hpp b/third_party/glm/mat3x4.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/mat4x2.hpp b/third_party/glm/mat4x2.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/mat4x3.hpp b/third_party/glm/mat4x3.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/mat4x4.hpp b/third_party/glm/mat4x4.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/matrix.hpp b/third_party/glm/matrix.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/packing.hpp b/third_party/glm/packing.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/simd/common.h b/third_party/glm/simd/common.h old mode 100644 new mode 100755 diff --git a/third_party/glm/simd/exponential.h b/third_party/glm/simd/exponential.h old mode 100644 new mode 100755 diff --git a/third_party/glm/simd/geometric.h b/third_party/glm/simd/geometric.h old mode 100644 new mode 100755 diff --git a/third_party/glm/simd/integer.h b/third_party/glm/simd/integer.h old mode 100644 new mode 100755 diff --git a/third_party/glm/simd/matrix.h b/third_party/glm/simd/matrix.h old mode 100644 new mode 100755 diff --git a/third_party/glm/simd/neon.h b/third_party/glm/simd/neon.h old mode 100644 new mode 100755 diff --git a/third_party/glm/simd/packing.h b/third_party/glm/simd/packing.h old mode 100644 new mode 100755 diff --git a/third_party/glm/simd/platform.h b/third_party/glm/simd/platform.h old mode 100644 new mode 100755 diff --git a/third_party/glm/simd/trigonometric.h b/third_party/glm/simd/trigonometric.h old mode 100644 new mode 100755 diff --git a/third_party/glm/simd/vector_relational.h b/third_party/glm/simd/vector_relational.h old mode 100644 new mode 100755 diff --git a/third_party/glm/trigonometric.hpp b/third_party/glm/trigonometric.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/vec2.hpp b/third_party/glm/vec2.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/vec3.hpp b/third_party/glm/vec3.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/vec4.hpp b/third_party/glm/vec4.hpp old mode 100644 new mode 100755 diff --git a/third_party/glm/vector_relational.hpp b/third_party/glm/vector_relational.hpp old mode 100644 new mode 100755 diff --git a/valgrind.supp b/valgrind.supp index d746267..04fc934 100644 --- a/valgrind.supp +++ b/valgrind.supp @@ -1,7 +1,31 @@ { name Memcheck:Leak - fun:*alloc + fun:* + ... + obj:*libmlx* + ... +} +{ + name + Memcheck:Cond + fun:* + ... + obj:*libmlx* + ... +} +{ + name + Memcheck:Value8 + fun:* + ... + obj:*libmlx* + ... +} +{ + name + Memcheck:Addr4 + fun:* ... obj:*libmlx* ... @@ -9,7 +33,7 @@ { name Memcheck:Leak - fun:*alloc + fun:* ... obj:*SDL* ... @@ -17,7 +41,7 @@ { name Memcheck:Leak - fun:*alloc + fun:* ... obj:*X11* ... @@ -25,7 +49,7 @@ { name Memcheck:Leak - fun:*alloc + fun:* ... obj:*nvidia.so* ... @@ -33,7 +57,7 @@ { name Memcheck:Leak - fun:*alloc + fun:* obj:* ... fun:X11* @@ -51,7 +75,16 @@ { name Memcheck:Leak - fun:*alloc + fun:* + obj:* + ... + fun:_dl_* + ... +} +{ + name + Memcheck:Leak + fun:* obj:* ... fun:dl_* @@ -66,32 +99,3 @@ fun:dl_* ... } -{ - name - Memcheck:Leak - fun:calloc - obj:* -} -{ - name - Memcheck:Leak - fun:realloc - obj:* -} -{ - name - Memcheck:Leak - fun:malloc - obj:* - obj:* - obj:* - obj:* - obj:* - obj:* - obj:* - obj:* - obj:* - obj:* - obj:* -} -