moving profile to API scope

This commit is contained in:
2023-12-11 20:28:58 +01:00
parent e8f4056b81
commit 4d6c970a71
40 changed files with 87 additions and 72 deletions

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */ /* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/04 16:56:35 by maldavid #+# #+# */ /* Created: 2022/10/04 16:56:35 by maldavid #+# #+# */
/* Updated: 2023/12/08 18:07:40 by kbz_8 ### ########.fr */ /* Updated: 2023/12/11 19:45:15 by kbz_8 ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@@ -15,18 +15,16 @@
#ifndef __MACRO_LIB_X_H__ #ifndef __MACRO_LIB_X_H__
#define __MACRO_LIB_X_H__ #define __MACRO_LIB_X_H__
#if defined(_WIN32) || defined(_WIN64) #include "mlx_profile.h"
#define MLX_EXPORT __declspec(dllexport)
#define MLX_IMPORT __declspec(dllimport)
#else
#define MLX_EXPORT
#define MLX_IMPORT
#endif
#ifdef MLX_BUILD #ifdef MLX_COMPILER_MSVC
#define MLX_API MLX_EXPORT #ifdef MLX_BUILD
#define MLX_API __declspec(dllexport)
#else
#define MLX_IMPORT __declspec(dllimport)
#endif
#else #else
#define MLX_API MLX_IMPORT #define MLX_API
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus

View File

@@ -1,12 +1,12 @@
/* ************************************************************************** */ /* ************************************************************************** */
/* */ /* */
/* ::: :::::::: */ /* ::: :::::::: */
/* profile.h :+: :+: :+: */ /* mlx_profile.h :+: :+: :+: */
/* +:+ +:+ +:+ */ /* +:+ +:+ +:+ */
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */ /* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/10 08:49:17 by maldavid #+# #+# */ /* Created: 2023/11/10 08:49:17 by maldavid #+# #+# */
/* Updated: 2023/12/08 18:49:38 by kbz_8 ### ########.fr */ /* Updated: 2023/12/11 20:25:51 by kbz_8 ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@@ -53,21 +53,38 @@
#error "Unknown environment!" #error "Unknown environment!"
#endif #endif
// Checking common assumptions // Checking common assumptions
#include <climits> #ifdef __cplusplus
#include <cstdint> #include <climits>
#include <cstdint>
static_assert(CHAR_BIT == 8, "CHAR_BIT is expected to be 8"); static_assert(CHAR_BIT == 8, "CHAR_BIT is expected to be 8");
static_assert(sizeof(int8_t) == 1, "int8_t is not of the correct size" ); static_assert(sizeof(int8_t) == 1, "int8_t is not of the correct size" );
static_assert(sizeof(int16_t) == 2, "int16_t is not of the correct size"); static_assert(sizeof(int16_t) == 2, "int16_t is not of the correct size");
static_assert(sizeof(int32_t) == 4, "int32_t is not of the correct size"); static_assert(sizeof(int32_t) == 4, "int32_t is not of the correct size");
static_assert(sizeof(int64_t) == 8, "int64_t is not of the correct size"); static_assert(sizeof(int64_t) == 8, "int64_t is not of the correct size");
static_assert(sizeof(uint8_t) == 1, "uint8_t is not of the correct size" ); static_assert(sizeof(uint8_t) == 1, "uint8_t is not of the correct size" );
static_assert(sizeof(uint16_t) == 2, "uint16_t is not of the correct size"); static_assert(sizeof(uint16_t) == 2, "uint16_t is not of the correct size");
static_assert(sizeof(uint32_t) == 4, "uint32_t is not of the correct size"); static_assert(sizeof(uint32_t) == 4, "uint32_t is not of the correct size");
static_assert(sizeof(uint64_t) == 8, "uint64_t is not of the correct size"); static_assert(sizeof(uint64_t) == 8, "uint64_t is not of the correct size");
#else
#define STATIC_ASSERT(COND, MSG) typedef char static_assertion___##MSG[(COND)?1:-1]
#include <limits.h>
#include <stdint.h>
STATIC_ASSERT(CHAR_BIT == 8, CHAR_BIT_is_expected_to_be_8);
STATIC_ASSERT(sizeof(int8_t) == 1, int8_t_is_not_of_the_correct_size);
STATIC_ASSERT(sizeof(int16_t) == 2, int16_t_is_not_of_the_correct_size);
STATIC_ASSERT(sizeof(int32_t) == 4, int32_t_is_not_of_the_correct_size);
STATIC_ASSERT(sizeof(int64_t) == 8, int64_t_is_not_of_the_correct_size);
STATIC_ASSERT(sizeof(uint8_t) == 1, uint8_t_is_not_of_the_correct_size);
STATIC_ASSERT(sizeof(uint16_t) == 2, uint16_t_is_not_of_the_correct_size);
STATIC_ASSERT(sizeof(uint32_t) == 4, uint32_t_is_not_of_the_correct_size);
STATIC_ASSERT(sizeof(uint64_t) == 8, uint64_t_is_not_of_the_correct_size);
#endif
#endif #endif

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */ /* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/04 22:10:52 by maldavid #+# #+# */ /* Created: 2022/10/04 22:10:52 by maldavid #+# #+# */
/* Updated: 2023/12/11 15:12:39 by kbz_8 ### ########.fr */ /* Updated: 2023/12/11 19:46:13 by kbz_8 ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@@ -15,7 +15,7 @@
#include <renderer/core/render_core.h> #include <renderer/core/render_core.h>
#include <array> #include <array>
#include <core/errors.h> #include <core/errors.h>
#include <core/profile.h> #include <mlx_profile.h>
#include <core/memory.h> #include <core/memory.h>
namespace mlx::core namespace mlx::core

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */ /* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/04 21:49:46 by maldavid #+# #+# */ /* Created: 2022/10/04 21:49:46 by maldavid #+# #+# */
/* Updated: 2023/12/10 22:19:59 by kbz_8 ### ########.fr */ /* Updated: 2023/12/11 19:46:49 by kbz_8 ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@@ -24,7 +24,7 @@
#include <core/graphics.h> #include <core/graphics.h>
#include <platform/inputs.h> #include <platform/inputs.h>
#include <core/profile.h> #include <mlx_profile.h>
namespace mlx::core namespace mlx::core
{ {

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */ /* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/04 17:42:32 by maldavid #+# #+# */ /* Created: 2022/10/04 17:42:32 by maldavid #+# #+# */
/* Updated: 2023/12/08 18:53:11 by kbz_8 ### ########.fr */ /* Updated: 2023/12/11 19:46:57 by kbz_8 ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@@ -14,7 +14,7 @@
#define __MLX_ERRORS__ #define __MLX_ERRORS__
#include <string> #include <string>
#include <core/profile.h> #include <mlx_profile.h>
enum class e_kind enum class e_kind
{ {

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */ /* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2023/04/02 14:49:49 by maldavid #+# #+# */ /* Created: 2023/04/02 14:49:49 by maldavid #+# #+# */
/* Updated: 2023/12/08 19:04:59 by kbz_8 ### ########.fr */ /* Updated: 2023/12/11 19:47:03 by kbz_8 ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@@ -26,7 +26,7 @@
#include <renderer/text_pipeline.h> #include <renderer/text_pipeline.h>
#include <utils/non_copyable.h> #include <utils/non_copyable.h>
#include <renderer/images/texture.h> #include <renderer/images/texture.h>
#include <core/profile.h> #include <mlx_profile.h>
namespace mlx namespace mlx
{ {

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */ /* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2023/12/07 16:31:51 by kbz_8 #+# #+# */ /* Created: 2023/12/07 16:31:51 by kbz_8 #+# #+# */
/* Updated: 2023/12/11 15:13:46 by kbz_8 ### ########.fr */ /* Updated: 2023/12/11 19:47:13 by kbz_8 ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@@ -14,7 +14,7 @@
#define __MLX_MEMORY__ #define __MLX_MEMORY__
#include <utils/singleton.h> #include <utils/singleton.h>
#include <core/profile.h> #include <mlx_profile.h>
#include <list> #include <list>
namespace mlx namespace mlx

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */ /* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/05 16:27:35 by maldavid #+# #+# */ /* Created: 2022/10/05 16:27:35 by maldavid #+# #+# */
/* Updated: 2023/12/11 19:06:13 by kbz_8 ### ########.fr */ /* Updated: 2023/12/11 19:47:20 by kbz_8 ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@@ -18,7 +18,7 @@
#include <SDL2/SDL.h> #include <SDL2/SDL.h>
#include <unordered_map> #include <unordered_map>
#include <core/profile.h> #include <mlx_profile.h>
#include "window.h" #include "window.h"

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */ /* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/04 21:53:12 by maldavid #+# #+# */ /* Created: 2022/10/04 21:53:12 by maldavid #+# #+# */
/* Updated: 2023/12/09 16:35:57 by kbz_8 ### ########.fr */ /* Updated: 2023/12/11 19:47:26 by kbz_8 ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@@ -15,7 +15,7 @@
#include <SDL2/SDL.h> #include <SDL2/SDL.h>
#include <string> #include <string>
#include <core/profile.h> #include <mlx_profile.h>
namespace mlx namespace mlx
{ {

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */ /* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/06 23:18:52 by maldavid #+# #+# */ /* Created: 2022/10/06 23:18:52 by maldavid #+# #+# */
/* Updated: 2023/12/08 19:05:50 by kbz_8 ### ########.fr */ /* Updated: 2023/12/11 19:47:39 by kbz_8 ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@@ -15,7 +15,7 @@
#include <volk.h> #include <volk.h>
#include <renderer/core/render_core.h> #include <renderer/core/render_core.h>
#include <core/profile.h> #include <mlx_profile.h>
namespace mlx namespace mlx
{ {

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */ /* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2023/01/25 15:05:05 by maldavid #+# #+# */ /* Created: 2023/01/25 15:05:05 by maldavid #+# #+# */
/* Updated: 2023/12/08 19:06:07 by kbz_8 ### ########.fr */ /* Updated: 2023/12/11 19:47:47 by kbz_8 ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@@ -16,7 +16,7 @@
#include <volk.h> #include <volk.h>
#include "vk_buffer.h" #include "vk_buffer.h"
#include <renderer/renderer.h> #include <renderer/renderer.h>
#include <core/profile.h> #include <mlx_profile.h>
namespace mlx namespace mlx
{ {

View File

@@ -16,7 +16,7 @@
#include "vk_buffer.h" #include "vk_buffer.h"
#include <array> #include <array>
#include <cstddef> #include <cstddef>
#include <core/profile.h> #include <mlx_profile.h>
namespace mlx namespace mlx
{ {

View File

@@ -15,7 +15,7 @@
#include "vk_buffer.h" #include "vk_buffer.h"
#include <renderer/renderer.h> #include <renderer/renderer.h>
#include <core/profile.h> #include <mlx_profile.h>
namespace mlx namespace mlx
{ {

View File

@@ -16,7 +16,7 @@
#include <array> #include <array>
#include <volk.h> #include <volk.h>
#include <core/profile.h> #include <mlx_profile.h>
#include <renderer/core/render_core.h> #include <renderer/core/render_core.h>
#include <renderer/command/vk_cmd_pool.h> #include <renderer/command/vk_cmd_pool.h>
#include <renderer/command/vk_cmd_buffer.h> #include <renderer/command/vk_cmd_buffer.h>

View File

@@ -15,7 +15,7 @@
#include <volk.h> #include <volk.h>
#include <renderer/core/vk_fence.h> #include <renderer/core/vk_fence.h>
#include <core/profile.h> #include <mlx_profile.h>
namespace mlx namespace mlx
{ {

View File

@@ -14,7 +14,7 @@
#define __MLX_VK_CMD_POOL__ #define __MLX_VK_CMD_POOL__
#include <volk.h> #include <volk.h>
#include <core/profile.h> #include <mlx_profile.h>
namespace mlx namespace mlx
{ {

View File

@@ -10,7 +10,7 @@
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
#include <core/profile.h> #include <mlx_profile.h>
#include <core/errors.h> #include <core/errors.h>
#include <cstdio> #include <cstdio>

View File

@@ -15,7 +15,7 @@
#include <volk.h> #include <volk.h>
#include <vma.h> #include <vma.h>
#include <core/profile.h> #include <mlx_profile.h>
namespace mlx namespace mlx
{ {

View File

@@ -24,7 +24,7 @@
#include <utils/singleton.h> #include <utils/singleton.h>
#include <core/errors.h> #include <core/errors.h>
#include <core/profile.h> #include <mlx_profile.h>
namespace mlx namespace mlx
{ {

View File

@@ -15,7 +15,7 @@
#include <volk.h> #include <volk.h>
#include "vk_queues.h" #include "vk_queues.h"
#include <core/profile.h> #include <mlx_profile.h>
namespace mlx namespace mlx
{ {

View File

@@ -14,7 +14,7 @@
#define __MLX_VK_FENCE__ #define __MLX_VK_FENCE__
#include <volk.h> #include <volk.h>
#include <core/profile.h> #include <mlx_profile.h>
#include <renderer/core/render_core.h> #include <renderer/core/render_core.h>
namespace mlx namespace mlx

View File

@@ -15,7 +15,7 @@
#include <volk.h> #include <volk.h>
#include <vector> #include <vector>
#include <core/profile.h> #include <mlx_profile.h>
namespace mlx namespace mlx
{ {

View File

@@ -16,7 +16,7 @@
#include <volk.h> #include <volk.h>
#include <optional> #include <optional>
#include <cstdint> #include <cstdint>
#include <core/profile.h> #include <mlx_profile.h>
namespace mlx namespace mlx
{ {

View File

@@ -15,7 +15,7 @@
#include <volk.h> #include <volk.h>
#include <vector> #include <vector>
#include <core/profile.h> #include <mlx_profile.h>
namespace mlx namespace mlx
{ {

View File

@@ -15,7 +15,7 @@
#include <volk.h> #include <volk.h>
#include <vector> #include <vector>
#include <core/profile.h> #include <mlx_profile.h>
namespace mlx namespace mlx
{ {

View File

@@ -14,7 +14,7 @@
#define __VK_VALIDATION_LAYERS__ #define __VK_VALIDATION_LAYERS__
#include <volk.h> #include <volk.h>
#include <core/profile.h> #include <mlx_profile.h>
namespace mlx namespace mlx
{ {

View File

@@ -15,7 +15,7 @@
#include <volk.h> #include <volk.h>
#include <cstddef> #include <cstddef>
#include <core/profile.h> #include <mlx_profile.h>
namespace mlx namespace mlx
{ {

View File

@@ -15,7 +15,7 @@
#include <volk.h> #include <volk.h>
#include <array> #include <array>
#include <core/profile.h> #include <mlx_profile.h>
#include <renderer/core/render_core.h> #include <renderer/core/render_core.h>
namespace mlx namespace mlx

View File

@@ -17,7 +17,7 @@
#include <cstddef> #include <cstddef>
#include <vector> #include <vector>
#include <map> #include <map>
#include <core/profile.h> #include <mlx_profile.h>
namespace mlx namespace mlx
{ {

View File

@@ -21,7 +21,7 @@
#include <renderer/descriptors/vk_descriptor_set.h> #include <renderer/descriptors/vk_descriptor_set.h>
#include <renderer/buffers/vk_ibo.h> #include <renderer/buffers/vk_ibo.h>
#include <renderer/buffers/vk_vbo.h> #include <renderer/buffers/vk_vbo.h>
#include <core/profile.h> #include <mlx_profile.h>
namespace mlx namespace mlx
{ {

View File

@@ -16,7 +16,7 @@
#include <renderer/images/texture.h> #include <renderer/images/texture.h>
#include <array> #include <array>
#include <glm/glm.hpp> #include <glm/glm.hpp>
#include <core/profile.h> #include <mlx_profile.h>
namespace mlx namespace mlx
{ {

View File

@@ -18,7 +18,7 @@
#include <vector> #include <vector>
#include <renderer/command/vk_cmd_buffer.h> #include <renderer/command/vk_cmd_buffer.h>
#include <renderer/command/vk_cmd_pool.h> #include <renderer/command/vk_cmd_pool.h>
#include <core/profile.h> #include <mlx_profile.h>
namespace mlx namespace mlx
{ {

View File

@@ -14,7 +14,7 @@
#define __PIPELINE__ #define __PIPELINE__
#include <volk.h> #include <volk.h>
#include <core/profile.h> #include <mlx_profile.h>
#include <renderer/command/vk_cmd_buffer.h> #include <renderer/command/vk_cmd_buffer.h>
namespace mlx namespace mlx

View File

@@ -13,7 +13,7 @@
#ifndef __MLX_PIXEL_PUT__ #ifndef __MLX_PIXEL_PUT__
#define __MLX_PIXEL_PUT__ #define __MLX_PIXEL_PUT__
#include <core/profile.h> #include <mlx_profile.h>
#include <renderer/images/texture.h> #include <renderer/images/texture.h>
#include <renderer/descriptors/vk_descriptor_set.h> #include <renderer/descriptors/vk_descriptor_set.h>

View File

@@ -31,7 +31,7 @@
#include <renderer/descriptors/vk_descriptor_set_layout.h> #include <renderer/descriptors/vk_descriptor_set_layout.h>
#include <core/errors.h> #include <core/errors.h>
#include <core/profile.h> #include <mlx_profile.h>
#include <glm/glm.hpp> #include <glm/glm.hpp>

View File

@@ -14,7 +14,7 @@
#define __MLX_VK_FRAMEBUFFER__ #define __MLX_VK_FRAMEBUFFER__
#include <volk.h> #include <volk.h>
#include <core/profile.h> #include <mlx_profile.h>
namespace mlx namespace mlx
{ {

View File

@@ -14,7 +14,7 @@
#define __MLX_VK_RENDER_PASS__ #define __MLX_VK_RENDER_PASS__
#include <volk.h> #include <volk.h>
#include <core/profile.h> #include <mlx_profile.h>
namespace mlx namespace mlx
{ {

View File

@@ -15,7 +15,7 @@
#include <vector> #include <vector>
#include <volk.h> #include <volk.h>
#include <core/profile.h> #include <mlx_profile.h>
#include <renderer/images/vk_image.h> #include <renderer/images/vk_image.h>
namespace mlx namespace mlx

View File

@@ -20,7 +20,7 @@
#include <memory> #include <memory>
#include <vector> #include <vector>
#include <cstdint> #include <cstdint>
#include <core/profile.h> #include <mlx_profile.h>
namespace mlx namespace mlx
{ {

View File

@@ -20,7 +20,7 @@
#include <cstdint> #include <cstdint>
#include <unordered_set> #include <unordered_set>
#include <renderer/text_library.h> #include <renderer/text_library.h>
#include <core/profile.h> #include <mlx_profile.h>
namespace mlx namespace mlx
{ {