diff --git a/.gitignore b/.gitignore index 6bc8987..7bf0577 100644 --- a/.gitignore +++ b/.gitignore @@ -5,10 +5,16 @@ *.so *.out *.dll +*.lib +*.exp *.json *.tmp +*.ilk +*.pdb +.vs/ .xmake/ .cache/ +objs/ build/ test/.gdb_history test/Test diff --git a/Makefile b/Makefile index f5c7986..a6d8efe 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,7 @@ NAME = libmlx.so SRCS = $(wildcard $(addsuffix /*.cpp, ./src/core)) +SRCS += $(wildcard $(addsuffix /*.cpp, ./src/core/**)) SRCS += $(wildcard $(addsuffix /*.cpp, ./src/platform)) SRCS += $(wildcard $(addsuffix /*.cpp, ./src/renderer)) SRCS += $(wildcard $(addsuffix /*.cpp, ./src/renderer/**)) diff --git a/includes/mlx.h b/includes/mlx.h index 3f083a0..57dc761 100644 --- a/includes/mlx.h +++ b/includes/mlx.h @@ -15,13 +15,9 @@ #ifndef __MACRO_LIB_X_H__ #define __MACRO_LIB_X_H__ -#ifdef __cplusplus -extern "C" { -#endif - #if defined(_WIN32) || defined(_WIN64) #define MLX_EXPORT __declspec(dllexport) - #define MLX_IMPORT __declspec(dllexport) + #define MLX_IMPORT __declspec(dllimport) #else #define MLX_EXPORT #define MLX_IMPORT @@ -33,6 +29,10 @@ extern "C" { #define MLX_API MLX_IMPORT #endif +#ifdef __cplusplus +extern "C" { +#endif + typedef enum { MLX_KEYDOWN = 0, diff --git a/src/core/application.h b/src/core/application.h index b113f06..a877086 100644 --- a/src/core/application.h +++ b/src/core/application.h @@ -28,7 +28,7 @@ namespace mlx::core { - class MLX_API Application + class Application { public: Application(); diff --git a/src/core/bridge.cpp b/src/core/bridge.cpp index 9240ddc..854d9f5 100644 --- a/src/core/bridge.cpp +++ b/src/core/bridge.cpp @@ -15,6 +15,7 @@ #include "application.h" #include #include +#include extern "C" { @@ -31,29 +32,29 @@ extern "C" if(app == nullptr) mlx::core::error::report(e_kind::fatal_error, "Tout a pété"); init = true; - return app; + return static_cast(app); } - void* mlx_new_window(mlx::core::Application* mlx, int w, int h, const char* title) + void* mlx_new_window(void* mlx, int w, int h, const char* title) { - return mlx->newGraphicsSuport(w, h, title); + return static_cast(mlx)->newGraphicsSuport(w, h, title); } - int mlx_loop_hook(mlx::core::Application* mlx, int (*f)(void*), void* param) + int mlx_loop_hook(void* mlx, int (*f)(void*), void* param) { - mlx->loopHook(f, param); + static_cast(mlx)->loopHook(f, param); return 0; } - int mlx_loop(mlx::core::Application* mlx) + int mlx_loop(void* mlx) { - mlx->run(); + static_cast(mlx)->run(); return 0; } - int mlx_loop_end(mlx::core::Application* mlx) + int mlx_loop_end(void* mlx) { - mlx->loopEnd(); + static_cast(mlx)->loopEnd(); return 0; } @@ -67,57 +68,57 @@ extern "C" return SDL_ShowCursor(SDL_DISABLE); } - int mlx_mouse_move(mlx::core::Application* mlx, void* win, int x, int y) + int mlx_mouse_move(void* mlx, void* win, int x, int y) { - mlx->mouseMove(win, x, y); + static_cast(mlx)->mouseMove(win, x, y); return 0; } - int mlx_mouse_get_pos(mlx::core::Application* mlx, int* x, int* y) + int mlx_mouse_get_pos(void* mlx, int* x, int* y) { - mlx->getMousePos(x, y); + static_cast(mlx)->getMousePos(x, y); return 0; } - int mlx_on_event(mlx::core::Application* mlx, void* win, int event, int (*funct_ptr)(int, void*), void* param) + int mlx_on_event(void* mlx, void* win, mlx_event_type event, int (*funct_ptr)(int, void*), void* param) { - mlx->onEvent(win, event, funct_ptr, param); + static_cast(mlx)->onEvent(win, static_cast(event), funct_ptr, param); return 0; } - void* mlx_new_image(mlx::core::Application* mlx, int width, int height) + void* mlx_new_image(void* mlx, int width, int height) { - return mlx->newTexture(width, height); + return static_cast(mlx)->newTexture(width, height); } - int mlx_get_image_pixel(mlx::core::Application* mlx, void* img, int x, int y) + int mlx_get_image_pixel(void* mlx, void* img, int x, int y) { - return mlx->getTexturePixel(img, x, y); + return static_cast(mlx)->getTexturePixel(img, x, y); } - void mlx_set_image_pixel(mlx::core::Application* mlx, void* img, int x, int y, int color) + void mlx_set_image_pixel(void* mlx, void* img, int x, int y, int color) { unsigned char color_bits[4]; color_bits[0] = (color & 0x00FF0000) >> 16; color_bits[1] = (color & 0x0000FF00) >> 8; color_bits[2] = (color & 0x000000FF); color_bits[3] = (color & 0xFF000000) >> 24; - mlx->setTexturePixel(img, x, y, *reinterpret_cast(color_bits)); + static_cast(mlx)->setTexturePixel(img, x, y, *reinterpret_cast(color_bits)); } - int mlx_put_image_to_window(mlx::core::Application* mlx, void* win, void* img, int x, int y) + int mlx_put_image_to_window(void* mlx, void* win, void* img, int x, int y) { - mlx->texturePut(win, img, x, y); + static_cast(mlx)->texturePut(win, img, x, y); return 0; } - int mlx_destroy_image(mlx::core::Application* mlx, void* img) + int mlx_destroy_image(void* mlx, void* img) { - mlx->destroyTexture(img); + static_cast(mlx)->destroyTexture(img); return 0; } - void* mlx_png_file_to_image(mlx::core::Application* mlx, char* filename, int* width, int* height) + void* mlx_png_file_to_image(void* mlx, char* filename, int* width, int* height) { std::filesystem::path file(filename); if(file.extension() != ".png") @@ -125,10 +126,10 @@ extern "C" mlx::core::error::report(e_kind::error, "PNG loader : not a png file '%s'", filename); return nullptr; } - return mlx->newStbTexture(filename, width, height); + return static_cast(mlx)->newStbTexture(filename, width, height); } - void* mlx_jpg_file_to_image(mlx::core::Application* mlx, char* filename, int* width, int* height) + void* mlx_jpg_file_to_image(void* mlx, char* filename, int* width, int* height) { std::filesystem::path file(filename); if(file.extension() != ".jpg" && file.extension() != ".jpeg") @@ -136,10 +137,10 @@ extern "C" mlx::core::error::report(e_kind::error, "JPG loader : not a jpg file '%s'", filename); return nullptr; } - return mlx->newStbTexture(filename, width, height); + return static_cast(mlx)->newStbTexture(filename, width, height); } - void* mlx_bmp_file_to_image(mlx::core::Application* mlx, char* filename, int* width, int* height) + void* mlx_bmp_file_to_image(void* mlx, char* filename, int* width, int* height) { std::filesystem::path file(filename); if(file.extension() != ".bmp" && file.extension() != ".dib") @@ -147,32 +148,32 @@ extern "C" mlx::core::error::report(e_kind::error, "BMP loader : not a bmp file '%s'", filename); return nullptr; } - return mlx->newStbTexture(filename, width, height); + return static_cast(mlx)->newStbTexture(filename, width, height); } - int mlx_pixel_put(mlx::core::Application* mlx, void* win, int x, int y, int color) + int mlx_pixel_put(void* mlx, void* win, int x, int y, int color) { unsigned char color_bits[4]; color_bits[0] = (color & 0x00FF0000) >> 16; color_bits[1] = (color & 0x0000FF00) >> 8; color_bits[2] = color & 0x000000FF; color_bits[3] = 0xFF; - mlx->pixelPut(win, x, y, *reinterpret_cast(color_bits)); + static_cast(mlx)->pixelPut(win, x, y, *reinterpret_cast(color_bits)); return 0; } - int mlx_string_put(mlx::core::Application* mlx, void* win, int x, int y, int color, char* str) + int mlx_string_put(void* mlx, void* win, int x, int y, int color, char* str) { unsigned char color_bits[4]; color_bits[0] = (color & 0x00FF0000) >> 16; color_bits[1] = (color & 0x0000FF00) >> 8; color_bits[2] = color & 0x000000FF; color_bits[3] = 0xFF; - mlx->stringPut(win, x, y, *reinterpret_cast(color_bits), str); + static_cast(mlx)->stringPut(win, x, y, *reinterpret_cast(color_bits), str); return 0; } - void mlx_set_font(mlx::core::Application* mlx, void* win, char* filepath) + void mlx_set_font(void* mlx, void* win, char* filepath) { std::filesystem::path file(filepath); if(file.extension() != ".ttf" && file.extension() != ".tte") @@ -180,10 +181,10 @@ extern "C" mlx::core::error::report(e_kind::error, "TTF loader : not a truetype font file '%s'", filepath); return; } - mlx->loadFont(win, file, 16.f); + static_cast(mlx)->loadFont(win, file, 16.f); } - void mlx_set_font_scale(mlx::core::Application* mlx, void* win, char* filepath, float scale) + void mlx_set_font_scale(void* mlx, void* win, char* filepath, float scale) { std::filesystem::path file(filepath); if(file.extension() != ".ttf" && file.extension() != ".tte") @@ -191,31 +192,31 @@ extern "C" mlx::core::error::report(e_kind::error, "TTF loader : not a truetype font file '%s'", filepath); return; } - mlx->loadFont(win, file, scale); + static_cast(mlx)->loadFont(win, file, scale); } - int mlx_clear_window(mlx::core::Application* mlx, void* win) + int mlx_clear_window(void* mlx, void* win) { - mlx->clearGraphicsSupport(win); + static_cast(mlx)->clearGraphicsSupport(win); return 0; } - int mlx_destroy_window(mlx::core::Application* mlx, void* win) + int mlx_destroy_window(void* mlx, void* win) { - mlx->destroyGraphicsSupport(win); + static_cast(mlx)->destroyGraphicsSupport(win); return 0; } - int mlx_destroy_display(mlx::core::Application* mlx) + int mlx_destroy_display(void* mlx) { - delete mlx; + delete static_cast(mlx); mlx::Render_Core::get().destroy(); return 0; } - int mlx_get_screens_size(mlx::core::Application* mlx, int* w, int* h) + int mlx_get_screens_size(void* mlx, int* w, int* h) { - mlx->getScreenSize(w, h); + static_cast(mlx)->getScreenSize(w, h); return 0; } -} +} \ No newline at end of file diff --git a/src/core/errors.h b/src/core/errors.h index 943b39f..d8f5ba1 100644 --- a/src/core/errors.h +++ b/src/core/errors.h @@ -26,7 +26,7 @@ enum class e_kind namespace mlx::core::error { - void MLX_API report(e_kind kind, std::string msg, ...); + void report(e_kind kind, std::string msg, ...); } #endif // __MLX_ERRORS__ diff --git a/src/core/graphics.h b/src/core/graphics.h index f79fcbc..2680162 100644 --- a/src/core/graphics.h +++ b/src/core/graphics.h @@ -30,7 +30,7 @@ namespace mlx { - class MLX_API GraphicsSupport : public non_copyable + class GraphicsSupport : public non_copyable { public: GraphicsSupport(std::size_t w, std::size_t h, const std::string& title, int id); diff --git a/src/core/memory.h b/src/core/memory.h index 6fce3fc..b4649e1 100644 --- a/src/core/memory.h +++ b/src/core/memory.h @@ -19,7 +19,7 @@ namespace mlx { - class MLX_API MemManager : public Singleton + class MemManager : public Singleton { friend class Singleton; diff --git a/src/core/profile.h b/src/core/profile.h index 2a6f307..45d6ed7 100644 --- a/src/core/profile.h +++ b/src/core/profile.h @@ -41,19 +41,18 @@ #warning "This compiler is not fully supported" #endif -#if defined(_WIN32) || defined(_WIN64) - #define MLX_EXPORT __declspec(dllexport) - #define MLX_IMPORT __declspec(dllexport) +#if defined(_WIN32) || defined(__CYGWIN__) + #define MLX_PLAT_WINDOWS +#elif defined(__linux__) + #define MLX_PLAT_LINUX +#elif defined(__APPLE__) && defined(__MACH__) + #define MLX_PLAT_MACOS +#elif defined(unix) || defined(__unix__) || defined(__unix) + #define MLX_PLAT_UNIX #else - #define MLX_EXPORT - #define MLX_IMPORT + #error "Unknown environment!" #endif -#ifdef MLX_BUILD - #define MLX_API MLX_EXPORT -#else - #define MLX_API MLX_IMPORT -#endif // Checking common assumptions #include diff --git a/src/platform/inputs.h b/src/platform/inputs.h index b6d5acb..332d8e0 100644 --- a/src/platform/inputs.h +++ b/src/platform/inputs.h @@ -32,7 +32,7 @@ namespace mlx void* param = nullptr; }; - class MLX_API Input + class Input { public: Input(); diff --git a/src/platform/window.h b/src/platform/window.h index 362a7ca..8923564 100644 --- a/src/platform/window.h +++ b/src/platform/window.h @@ -19,7 +19,7 @@ namespace mlx { - class MLX_API MLX_Window + class MLX_Window { public: MLX_Window(std::size_t w, std::size_t h, const std::string& title); diff --git a/src/renderer/buffers/vk_buffer.h b/src/renderer/buffers/vk_buffer.h index 5c630f5..783c486 100644 --- a/src/renderer/buffers/vk_buffer.h +++ b/src/renderer/buffers/vk_buffer.h @@ -19,7 +19,7 @@ namespace mlx { - class MLX_API Buffer + class Buffer { public: enum class kind { dynamic, uniform, constant }; diff --git a/src/renderer/buffers/vk_ibo.h b/src/renderer/buffers/vk_ibo.h index 7109eba..ecaa21f 100644 --- a/src/renderer/buffers/vk_ibo.h +++ b/src/renderer/buffers/vk_ibo.h @@ -20,7 +20,7 @@ namespace mlx { - class MLX_API C_IBO : public Buffer + class C_IBO : public Buffer { public: inline void create(uint32_t size, const uint16_t* data, const char* name) { Buffer::create(Buffer::kind::constant, size, VK_BUFFER_USAGE_INDEX_BUFFER_BIT, name, data); } diff --git a/src/renderer/buffers/vk_ubo.h b/src/renderer/buffers/vk_ubo.h index 9a63aaa..057e24e 100644 --- a/src/renderer/buffers/vk_ubo.h +++ b/src/renderer/buffers/vk_ubo.h @@ -20,7 +20,7 @@ namespace mlx { - class MLX_API UBO + class UBO { public: void create(class Renderer* renderer, uint32_t size, const char* name); diff --git a/src/renderer/buffers/vk_vbo.h b/src/renderer/buffers/vk_vbo.h index 22f89b9..7b52c76 100644 --- a/src/renderer/buffers/vk_vbo.h +++ b/src/renderer/buffers/vk_vbo.h @@ -19,7 +19,7 @@ namespace mlx { - class MLX_API VBO : public Buffer + class VBO : public Buffer { public: inline void create(uint32_t size, const char* name) { Buffer::create(Buffer::kind::dynamic, size, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT, name); } @@ -27,7 +27,7 @@ namespace mlx inline void bind(Renderer& renderer) noexcept { vkCmdBindVertexBuffers(renderer.getActiveCmdBuffer().get(), 0, 1, &_buffer, &_offset); } }; - class MLX_API C_VBO : public Buffer + class C_VBO : public Buffer { public: inline void create(uint32_t size, const void* data, const char* name) { Buffer::create(Buffer::kind::constant, size, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT, name, data); } diff --git a/src/renderer/command/cmd_manager.h b/src/renderer/command/cmd_manager.h index 5298157..e6a13be 100644 --- a/src/renderer/command/cmd_manager.h +++ b/src/renderer/command/cmd_manager.h @@ -23,7 +23,7 @@ namespace mlx { - class MLX_API CmdManager + class CmdManager { public: CmdManager() = default; diff --git a/src/renderer/command/vk_cmd_buffer.h b/src/renderer/command/vk_cmd_buffer.h index 7a44d04..0b4e742 100644 --- a/src/renderer/command/vk_cmd_buffer.h +++ b/src/renderer/command/vk_cmd_buffer.h @@ -19,7 +19,7 @@ namespace mlx { - class MLX_API CmdBuffer + class CmdBuffer { public: void init(class CmdManager* manager); diff --git a/src/renderer/command/vk_cmd_pool.h b/src/renderer/command/vk_cmd_pool.h index f64e42b..cacc651 100644 --- a/src/renderer/command/vk_cmd_pool.h +++ b/src/renderer/command/vk_cmd_pool.h @@ -18,7 +18,7 @@ namespace mlx { - class MLX_API CmdPool + class CmdPool { public: void init(); diff --git a/src/renderer/core/memory.h b/src/renderer/core/memory.h index 336613c..671a90b 100644 --- a/src/renderer/core/memory.h +++ b/src/renderer/core/memory.h @@ -19,7 +19,7 @@ namespace mlx { - class MLX_API GPUallocator + class GPUallocator { public: GPUallocator() = default; diff --git a/src/renderer/core/render_core.cpp b/src/renderer/core/render_core.cpp index 13e46cc..aa8ec23 100644 --- a/src/renderer/core/render_core.cpp +++ b/src/renderer/core/render_core.cpp @@ -24,7 +24,11 @@ #include #ifdef DEBUG - #warning "MLX is being compiled in debug mode, this activates Vulkan's validation layers and debug messages which may impact rendering performances" + #ifndef MLX_COMPILER_MSVC + #warning "MLX is being compiled in debug mode, this activates Vulkan's validation layers and debug messages which may impact rendering performances" + #else + #pragma NOTE("MLX is being compiled in debug mode, this activates Vulkan's validation layers and debug messages which may impact rendering performances") + #endif #endif namespace mlx diff --git a/src/renderer/core/render_core.h b/src/renderer/core/render_core.h index ab43baa..8319cca 100644 --- a/src/renderer/core/render_core.h +++ b/src/renderer/core/render_core.h @@ -43,7 +43,7 @@ namespace mlx constexpr const int MAX_FRAMES_IN_FLIGHT = 3; - class MLX_API Render_Core : public Singleton + class Render_Core : public Singleton { public: Render_Core() = default; diff --git a/src/renderer/core/vk_device.h b/src/renderer/core/vk_device.h index e8b8885..c2353af 100644 --- a/src/renderer/core/vk_device.h +++ b/src/renderer/core/vk_device.h @@ -19,7 +19,7 @@ namespace mlx { - class MLX_API Device + class Device { public: void init(); diff --git a/src/renderer/core/vk_fence.h b/src/renderer/core/vk_fence.h index abe6c60..342ce78 100644 --- a/src/renderer/core/vk_fence.h +++ b/src/renderer/core/vk_fence.h @@ -19,7 +19,7 @@ namespace mlx { - class MLX_API Fence + class Fence { public: Fence() = default; diff --git a/src/renderer/core/vk_instance.h b/src/renderer/core/vk_instance.h index a8948cc..d5de82d 100644 --- a/src/renderer/core/vk_instance.h +++ b/src/renderer/core/vk_instance.h @@ -19,7 +19,7 @@ namespace mlx { - class MLX_API Instance + class Instance { public: void init(); diff --git a/src/renderer/core/vk_queues.h b/src/renderer/core/vk_queues.h index ef3d270..1716999 100644 --- a/src/renderer/core/vk_queues.h +++ b/src/renderer/core/vk_queues.h @@ -20,7 +20,7 @@ namespace mlx { - class MLX_API Queues + class Queues { public: struct QueueFamilyIndices diff --git a/src/renderer/core/vk_semaphore.h b/src/renderer/core/vk_semaphore.h index f16e074..9ae964f 100644 --- a/src/renderer/core/vk_semaphore.h +++ b/src/renderer/core/vk_semaphore.h @@ -19,7 +19,7 @@ namespace mlx { - class MLX_API Semaphore + class Semaphore { public: void init(); diff --git a/src/renderer/core/vk_surface.h b/src/renderer/core/vk_surface.h index 9d6933a..24dd3ec 100644 --- a/src/renderer/core/vk_surface.h +++ b/src/renderer/core/vk_surface.h @@ -19,7 +19,7 @@ namespace mlx { - class MLX_API Surface + class Surface { public: void create(class Renderer& renderer); diff --git a/src/renderer/core/vk_validation_layers.h b/src/renderer/core/vk_validation_layers.h index 9b6ca8f..a956674 100644 --- a/src/renderer/core/vk_validation_layers.h +++ b/src/renderer/core/vk_validation_layers.h @@ -18,7 +18,7 @@ namespace mlx { - class MLX_API ValidationLayers + class ValidationLayers { public: void init(); diff --git a/src/renderer/descriptors/vk_descriptor_pool.h b/src/renderer/descriptors/vk_descriptor_pool.h index 9779593..7a97760 100644 --- a/src/renderer/descriptors/vk_descriptor_pool.h +++ b/src/renderer/descriptors/vk_descriptor_pool.h @@ -19,7 +19,7 @@ namespace mlx { - class MLX_API DescriptorPool + class DescriptorPool { public: void init(std::size_t n, VkDescriptorPoolSize* size); diff --git a/src/renderer/descriptors/vk_descriptor_set.h b/src/renderer/descriptors/vk_descriptor_set.h index 0959235..d9c51d3 100644 --- a/src/renderer/descriptors/vk_descriptor_set.h +++ b/src/renderer/descriptors/vk_descriptor_set.h @@ -20,7 +20,7 @@ namespace mlx { - class MLX_API DescriptorSet + class DescriptorSet { public: void init(class Renderer* renderer, class DescriptorPool* pool, class DescriptorSetLayout* layout); diff --git a/src/renderer/descriptors/vk_descriptor_set_layout.h b/src/renderer/descriptors/vk_descriptor_set_layout.h index 11ae849..23d2ef2 100644 --- a/src/renderer/descriptors/vk_descriptor_set_layout.h +++ b/src/renderer/descriptors/vk_descriptor_set_layout.h @@ -21,7 +21,7 @@ namespace mlx { - class MLX_API DescriptorSetLayout + class DescriptorSetLayout { public: void init(std::vector> binds, VkShaderStageFlagBits stage); diff --git a/src/renderer/images/texture.h b/src/renderer/images/texture.h index f35c7e9..e15b5fc 100644 --- a/src/renderer/images/texture.h +++ b/src/renderer/images/texture.h @@ -25,7 +25,7 @@ namespace mlx { - class MLX_API Texture : public Image + class Texture : public Image { public: Texture() = default; @@ -62,9 +62,9 @@ namespace mlx bool _has_been_updated = false; }; - MLX_API Texture stbTextureLoad(std::filesystem::path file, int* w, int* h); + Texture stbTextureLoad(std::filesystem::path file, int* w, int* h); - struct MLX_API TextureRenderData + struct TextureRenderData { Texture* texture; std::size_t hash = 0; @@ -79,7 +79,7 @@ namespace mlx namespace std { template <> - struct MLX_API hash + struct hash { size_t operator()(const mlx::TextureRenderData& td) const noexcept { diff --git a/src/renderer/images/texture_atlas.h b/src/renderer/images/texture_atlas.h index 0d39c6b..59a0edc 100644 --- a/src/renderer/images/texture_atlas.h +++ b/src/renderer/images/texture_atlas.h @@ -20,7 +20,7 @@ namespace mlx { - class MLX_API TextureAtlas : public Image + class TextureAtlas : public Image { public: TextureAtlas() = default; diff --git a/src/renderer/images/vk_image.h b/src/renderer/images/vk_image.h index 3d04dbf..7e0e865 100644 --- a/src/renderer/images/vk_image.h +++ b/src/renderer/images/vk_image.h @@ -22,9 +22,9 @@ namespace mlx { - MLX_API uint32_t formatSize(VkFormat format); + uint32_t formatSize(VkFormat format); - class MLX_API Image + class Image { friend class SwapChain; diff --git a/src/renderer/pipeline/pipeline.h b/src/renderer/pipeline/pipeline.h index 8533d69..6dbfe7a 100644 --- a/src/renderer/pipeline/pipeline.h +++ b/src/renderer/pipeline/pipeline.h @@ -19,7 +19,7 @@ namespace mlx { - class MLX_API GraphicPipeline + class GraphicPipeline { public: void init(class Renderer& renderer); diff --git a/src/renderer/pixel_put.h b/src/renderer/pixel_put.h index 66688fe..503bf62 100644 --- a/src/renderer/pixel_put.h +++ b/src/renderer/pixel_put.h @@ -19,7 +19,7 @@ namespace mlx { - class MLX_API PixelPutPipeline + class PixelPutPipeline { public: PixelPutPipeline() = default; diff --git a/src/renderer/renderer.h b/src/renderer/renderer.h index 699e97c..42b8db9 100644 --- a/src/renderer/renderer.h +++ b/src/renderer/renderer.h @@ -37,7 +37,7 @@ namespace mlx { - struct MLX_API Vertex + struct Vertex { glm::vec2 pos; glm::vec4 color; @@ -78,7 +78,7 @@ namespace mlx } }; - class MLX_API Renderer + class Renderer { public: Renderer() = default; diff --git a/src/renderer/renderpass/vk_framebuffer.h b/src/renderer/renderpass/vk_framebuffer.h index aa30e9a..d8c92ed 100644 --- a/src/renderer/renderpass/vk_framebuffer.h +++ b/src/renderer/renderpass/vk_framebuffer.h @@ -18,7 +18,7 @@ namespace mlx { - class MLX_API FrameBuffer + class FrameBuffer { public: void init(class RenderPass& renderpass, class Image& image); diff --git a/src/renderer/renderpass/vk_render_pass.h b/src/renderer/renderpass/vk_render_pass.h index 4ca66a9..c955800 100644 --- a/src/renderer/renderpass/vk_render_pass.h +++ b/src/renderer/renderpass/vk_render_pass.h @@ -18,7 +18,7 @@ namespace mlx { - class MLX_API RenderPass + class RenderPass { public: void init(VkFormat attachement_format); diff --git a/src/renderer/swapchain/vk_swapchain.h b/src/renderer/swapchain/vk_swapchain.h index 15aab51..b6b8374 100644 --- a/src/renderer/swapchain/vk_swapchain.h +++ b/src/renderer/swapchain/vk_swapchain.h @@ -20,14 +20,14 @@ namespace mlx { - class MLX_API SwapChain + class SwapChain { friend class GraphicPipeline; friend class RenderPass; friend class Renderer; public: - struct MLX_API SwapChainSupportDetails + struct SwapChainSupportDetails { VkSurfaceCapabilitiesKHR capabilities; std::vector formats; diff --git a/src/renderer/text_library.h b/src/renderer/text_library.h index b7459c2..aa124c3 100644 --- a/src/renderer/text_library.h +++ b/src/renderer/text_library.h @@ -27,7 +27,7 @@ namespace mlx using TextID = uint32_t; constexpr TextID nulltext = 0; - class MLX_API TextData + class TextData { public: TextData() = default; @@ -46,7 +46,7 @@ namespace mlx std::string _text; }; - class MLX_API TextLibrary + class TextLibrary { public: TextLibrary() = default; diff --git a/src/renderer/text_pipeline.h b/src/renderer/text_pipeline.h index 7f0f78b..e1e29ec 100644 --- a/src/renderer/text_pipeline.h +++ b/src/renderer/text_pipeline.h @@ -24,7 +24,7 @@ namespace mlx { - struct MLX_API TextDrawData + struct TextDrawData { TextID id; int x; @@ -41,7 +41,7 @@ namespace mlx namespace std { template <> - struct MLX_API hash + struct hash { std::size_t operator()(const mlx::TextDrawData& d) const noexcept { @@ -52,7 +52,7 @@ namespace std namespace mlx { - class MLX_API TextPutPipeline + class TextPutPipeline { public: TextPutPipeline() = default; diff --git a/test/Test.exe b/test/Test.exe new file mode 100644 index 0000000..9fea3c5 Binary files /dev/null and b/test/Test.exe differ