From c93428b0f457699b684c43659fdf753ddb6cf12f Mon Sep 17 00:00:00 2001 From: Canberk Pitirli Date: Sun, 4 Oct 2026 20:36:19 +0300 Subject: [PATCH 1/2] build: turn on engine warnings and hide non-exported symbols on linux Warnings apply to engine sources only, vendors are added as SYSTEM. ENGINE_API now means default visibility outside Windows, and the classes and free functions that were missing it get it. --- CMakeLists.txt | 42 +++- .../Graphics/Vulkan/VulkanRenderer.hpp | 4 +- include/public/Core/File.hpp | 57 +++--- include/public/Core/OSDef.hpp | 7 +- include/public/Core/Object.hpp | 36 ++-- include/public/Core/Timer.hpp | 21 +- include/public/FileSystem/Serializable.hpp | 20 +- include/public/Math/Color.hpp | 7 +- include/public/Math/Quaternion.hpp | 81 ++++---- include/public/Math/Random.hpp | 184 +++++++++--------- include/public/Physics/CollisionDetection.hpp | 47 +++-- include/public/Physics/DynamicAABBTree.hpp | 5 +- include/public/Physics/PhysicsWorld.hpp | 7 +- 13 files changed, 285 insertions(+), 233 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b2602814..934c377d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,12 +74,12 @@ if(MSVC) endif() # --- Build all vendor dependencies --- -add_subdirectory(vendors/freeglut) -add_subdirectory(vendors/SDL3) -add_subdirectory(vendors/spdlog) -add_subdirectory(vendors/json) -add_subdirectory(vendors/yaml-cpp) -add_subdirectory(vendors/assimp) +add_subdirectory(vendors/freeglut SYSTEM) +add_subdirectory(vendors/SDL3 SYSTEM) +add_subdirectory(vendors/spdlog SYSTEM) +add_subdirectory(vendors/json SYSTEM) +add_subdirectory(vendors/yaml-cpp SYSTEM) +add_subdirectory(vendors/assimp SYSTEM) # --- Find system packages --- find_package(OpenGL REQUIRED) @@ -250,6 +250,21 @@ if(WIN32 OR USE_MINGW) ) endif() +# --- Warnings, only on engine code and not on vendored sources built in --- +set(ENGINE_WARNING_SOURCES ${ENGINE_SOURCES}) +list(REMOVE_ITEM ENGINE_WARNING_SOURCES + src/Assets/stb_image_impl.cpp + src/Graphics/OpenGL/glad.c +) +if(MSVC) + set(ENGINE_WARNING_FLAGS /W4) +else() + set(ENGINE_WARNING_FLAGS -Wall -Wextra -Wpedantic) +endif() +set_source_files_properties(${ENGINE_WARNING_SOURCES} + PROPERTIES COMPILE_OPTIONS "${ENGINE_WARNING_FLAGS}" +) + # --- Header files (for IDE source groups) --- file(GLOB_RECURSE ENGINE_PUBLIC_HEADERS "include/public/*.hpp") file(GLOB_RECURSE ENGINE_PRIVATE_HEADERS "include/private/*.hpp") @@ -291,6 +306,13 @@ set_target_properties(Engine PROPERTIES ) target_compile_features(Engine PUBLIC cxx_std_23) +# --- Only ENGINE_API symbols are exported, matching the Windows DLL --- +set_target_properties(Engine PROPERTIES + C_VISIBILITY_PRESET hidden + CXX_VISIBILITY_PRESET hidden + VISIBILITY_INLINES_HIDDEN ON +) + # --- Generated version header --- set(ENGINE_GENERATED_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/generated/include) configure_file( @@ -309,12 +331,16 @@ target_include_directories(Engine PUBLIC $ $ + $ + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/include/private +) +target_include_directories(Engine SYSTEM + PUBLIC $ $ - $ $ PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/include/private ${Vulkan_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR} ${VENDOR_DIR}/imgui diff --git a/include/private/Graphics/Vulkan/VulkanRenderer.hpp b/include/private/Graphics/Vulkan/VulkanRenderer.hpp index 053adb78..fc5b25b6 100644 --- a/include/private/Graphics/Vulkan/VulkanRenderer.hpp +++ b/include/private/Graphics/Vulkan/VulkanRenderer.hpp @@ -18,8 +18,8 @@ #include namespace Sleak { -class ENGINE_API Window; - namespace RenderEngine { +class Window; +namespace RenderEngine { struct QueueIndices { uint32_t GraphicsIndex = UINT32_MAX; diff --git a/include/public/Core/File.hpp b/include/public/Core/File.hpp index 0f5e0474..adb9fc3f 100644 --- a/include/public/Core/File.hpp +++ b/include/public/Core/File.hpp @@ -1,51 +1,52 @@ #ifndef _FILE_H_ #define _FILE_H_ +#include +#include #include #include -#include namespace Sleak { /// Thin wrapper over std::fstream for text/binary file I/O. /// @ingroup filesystem - class File { - public: - // Constructor and Destructor - File(); - ~File(); +class ENGINE_API File { + public: + // Constructor and Destructor + File(); + ~File(); - // Opens a file with the specified mode - bool Open(const std::string& filename, const std::string& mode); + // Opens a file with the specified mode + bool Open(const std::string& filename, const std::string& mode); - // Closes the currently open file - void Close(); + // Closes the currently open file + void Close(); - // Reads all text from the file - std::string ReadAllText(); + // Reads all text from the file + std::string ReadAllText(); - // Reads all bytes from the file - std::vector ReadAllBytes(); + // Reads all bytes from the file + std::vector ReadAllBytes(); - // Writes all text to the file - bool WriteAllText(const std::string& content); + // Writes all text to the file + bool WriteAllText(const std::string& content); - // Writes all bytes to the file - bool WriteAllBytes(const std::vector& data); + // Writes all bytes to the file + bool WriteAllBytes(const std::vector& data); - // Checks if a file exists - static bool Exists(const std::string& filename); + // Checks if a file exists + static bool Exists(const std::string& filename); - private: - // File stream for reading and writing - std::fstream m_fileStream; + private: + // File stream for reading and writing + std::fstream m_fileStream; - // Current file mode - std::string m_mode; + // Current file mode + std::string m_mode; - // Platform-specific implementation for file existence check - static bool ExistsImpl(const std::string& filename); - }; + // Platform-specific implementation for file existence check + static bool ExistsImpl(const std::string& filename); +}; } // namespace Sleak diff --git a/include/public/Core/OSDef.hpp b/include/public/Core/OSDef.hpp index f7d4d476..6533e67f 100644 --- a/include/public/Core/OSDef.hpp +++ b/include/public/Core/OSDef.hpp @@ -31,7 +31,6 @@ #define OS "ios" #define WINDOW_SYSTEM "quartz" #define SLEAK_API - #define ENGINE_API /* Android devices (need to be defined before linux) */ #elif defined(__ANDROID__) @@ -39,7 +38,6 @@ #define OS "android" #define WINDOW_SYSTEM "surfaceflinger" #define SLEAK_API - #define ENGINE_API /* Berkley Software Distribution */ #elif defined(__FreeBSD__) @@ -50,13 +48,16 @@ #define OS "linux" #define WINDOW_SYSTEM std::getenv("XDG_SESSION_TYPE") #define SLEAK_API - #define ENGINE_API #else #error "Undefined OS" #endif +#ifndef _WIN32 +#define ENGINE_API __attribute__((visibility("default"))) +#endif + #define MACRO_STR(macro) #macro #define RESOURCE(path) R"(assets/textures/" path ")" diff --git a/include/public/Core/Object.hpp b/include/public/Core/Object.hpp index 80b860a7..00bf1011 100644 --- a/include/public/Core/Object.hpp +++ b/include/public/Core/Object.hpp @@ -1,36 +1,36 @@ #ifndef _OBJECT_H_ #define _OBJECT_H_ +#include +#include #include #include -#include namespace Sleak { /// Base for anything needing a stable identity: a name and a /// process-unique, atomically assigned ID. /// @ingroup core - class Object { - public: - Object(const std::string& name = "Object") - : m_uniqueID(s_nextUniqueID.fetch_add(1, std::memory_order_relaxed)), - m_name(name) - { - SetName(m_name + "-" + std::to_string(m_uniqueID)); - } +class ENGINE_API Object { + public: + Object(const std::string& name = "Object") + : m_uniqueID(s_nextUniqueID.fetch_add(1, std::memory_order_relaxed)), + m_name(name) { + SetName(m_name + "-" + std::to_string(m_uniqueID)); + } - virtual ~Object() = default; + virtual ~Object() = default; - uint64_t GetUniqueID() const { return m_uniqueID; } + uint64_t GetUniqueID() const { return m_uniqueID; } - const std::string& GetName() const { return m_name; } + const std::string& GetName() const { return m_name; } - inline void SetName(const std::string& value) { m_name = value; } + inline void SetName(const std::string& value) { m_name = value; } - private: - std::string m_name; - uint64_t m_uniqueID; - static inline std::atomic s_nextUniqueID = 0; - }; + private: + std::string m_name; + uint64_t m_uniqueID; + static inline std::atomic s_nextUniqueID = 0; +}; } #endif diff --git a/include/public/Core/Timer.hpp b/include/public/Core/Timer.hpp index 83a3ecdb..bce7c15f 100644 --- a/include/public/Core/Timer.hpp +++ b/include/public/Core/Timer.hpp @@ -1,25 +1,26 @@ #ifndef _TIMER_HPP_ #define _TIMER_HPP_ +#include #include namespace Sleak { /// Wall-clock stopwatch built on std::chrono. Application keeps one for /// frame delta time. /// @ingroup core - class Timer { - public: - Timer(); +class ENGINE_API Timer { + public: + Timer(); - /// Restarts the clock at zero. - void Reset(); + /// Restarts the clock at zero. + void Reset(); - /// Seconds since construction or the last Reset(). - float Elapsed() const; + /// Seconds since construction or the last Reset(). + float Elapsed() const; - private: - std::chrono::time_point startPoint; - }; + private: + std::chrono::time_point startPoint; +}; }; #endif \ No newline at end of file diff --git a/include/public/FileSystem/Serializable.hpp b/include/public/FileSystem/Serializable.hpp index b81bd935..257a6f83 100644 --- a/include/public/FileSystem/Serializable.hpp +++ b/include/public/FileSystem/Serializable.hpp @@ -1,14 +1,16 @@ #ifndef _SERIALIZABLE_H_ #define _SERIALIZABLE_H_ +#include + +#include +#include #include -#include #include -#include -#include -#include #include -#include +#include +#include +#include namespace Sleak { @@ -48,8 +50,8 @@ namespace Sleak { * @brief Base class for objects that can be serialized and deserialized. * @ingroup filesystem */ - class Serializable { - public: + class ENGINE_API Serializable { + public: virtual ~Serializable() = default; /** @@ -82,8 +84,8 @@ namespace Sleak { * @brief Detects file format and creates the appropriate serialization context. * @ingroup filesystem */ - class SerializationFactory { - public: + class ENGINE_API SerializationFactory { + public: /// Picks a format from filePath's extension (.bin/.json/.yaml/.yml). static SerializationFormat DetectFormat(const std::string& filePath); /// Builds the context implementation matching format. diff --git a/include/public/Math/Color.hpp b/include/public/Math/Color.hpp index 0b4abcae..3143249b 100644 --- a/include/public/Math/Color.hpp +++ b/include/public/Math/Color.hpp @@ -1,19 +1,20 @@ #ifndef _COLOR_HPP_ #define _COLOR_HPP_ +#include +#include +#include #include #include #include #include #include -#include -#include namespace Sleak { namespace Math { /// 8-bit RGBA color. Value type, cheap to pass and store on vertices/UI. /// @ingroup math -class Color { +class ENGINE_API Color { public: static const Color Red; static const Color Green; diff --git a/include/public/Math/Quaternion.hpp b/include/public/Math/Quaternion.hpp index bd3cff19..df9dd31a 100644 --- a/include/public/Math/Quaternion.hpp +++ b/include/public/Math/Quaternion.hpp @@ -1,6 +1,7 @@ #ifndef _QUATERNION_H_ #define _QUATERNION_H_ +#include #include #include @@ -23,58 +24,60 @@ namespace Sleak { template class Matrix; - class Quaternion { - public: - float w; // Scalar component - float x; // Vector component (i) - float y; // Vector component (j) - float z; // Vector component (k) + class ENGINE_API Quaternion { + public: + float w; // Scalar component + float x; // Vector component (i) + float y; // Vector component (j) + float z; // Vector component (k) - // Constructors - Quaternion(); - Quaternion(float w, float x, float y, float z); - Quaternion(const Vector3D& axis, float angle); - Quaternion(const Matrix& matrix); + // Constructors + Quaternion(); + Quaternion(float w, float x, float y, float z); + Quaternion(const Vector3D& axis, float angle); + Quaternion(const Matrix& matrix); - // Accessors and Mutators - float& operator[](int index); - const float& operator[](int index) const; + // Accessors and Mutators + float& operator[](int index); + const float& operator[](int index) const; - // Quaternion Operations - Quaternion operator*(const Quaternion& other) const; - Quaternion& operator*=(const Quaternion& other); - Quaternion operator-() const; + // Quaternion Operations + Quaternion operator*(const Quaternion& other) const; + Quaternion& operator*=(const Quaternion& other); + Quaternion operator-() const; - float GetX() const; - float GetY() const; - float GetZ() const; - float GetW() const; + float GetX() const; + float GetY() const; + float GetZ() const; + float GetW() const; - // Normalize the quaternion - void normalize(); + // Normalize the quaternion + void normalize(); - // Calculate the magnitude of the quaternion - float magnitude() const; + // Calculate the magnitude of the quaternion + float magnitude() const; - // Calculate the conjugate of the quaternion - Quaternion conjugate() const; + // Calculate the conjugate of the quaternion + Quaternion conjugate() const; - // Calculate the inverse of the quaternion - Quaternion inverse() const; + // Calculate the inverse of the quaternion + Quaternion inverse() const; - // Rotate a vector by this quaternion - Vector3D rotateVector(const Vector3D& vec) const; + // Rotate a vector by this quaternion + Vector3D rotateVector(const Vector3D& vec) const; - // Conversion to Rotation Matrix - Matrix toRotationMatrix() const; + // Conversion to Rotation Matrix + Matrix toRotationMatrix() const; - // Static method for look rotation - static Quaternion LookRotation(Vector3D& forward, Vector3D& up); - private: - }; + // Static method for look rotation + static Quaternion LookRotation(Vector3D& forward, Vector3D& up); + + private: + }; // Free function for quaternion-vector multiplication - Vector3D operator*(const Quaternion& quat, const Vector3D& vec); + ENGINE_API Vector3D operator*(const Quaternion& quat, + const Vector3D& vec); } // namespace Math } // namespace Sleak diff --git a/include/public/Math/Random.hpp b/include/public/Math/Random.hpp index bb353b63..9427a6a9 100644 --- a/include/public/Math/Random.hpp +++ b/include/public/Math/Random.hpp @@ -1,9 +1,10 @@ #ifndef _RANDOM_H_ #define _RANDOM_H_ -#include -#include +#include #include +#include +#include namespace Sleak { namespace Math { @@ -18,96 +19,95 @@ namespace Sleak { * Twister engine for high-quality random number generation. * @ingroup math */ - class Random { - public: - // Seed the generator with a specific value - static void Seed(unsigned int seed) { - generator_.seed(seed); - } - - // Seed the generator with a non-deterministic random value - static void SeedWithTime() { - std::random_device rd; - generator_.seed(rd()); - } - - // Generate a random integer between min and max (inclusive) - static int Range(int min, int max) { - std::uniform_int_distribution distribution(min, max); - return distribution(generator_); - } - - // Generate a random float between 0.0f and 1.0f - static float Value() { - std::uniform_real_distribution distribution(0.0f, 1.0f); - return distribution(generator_); - } - - // Generate a random float between min and max - static float Range(float min, float max) { - std::uniform_real_distribution distribution(min, max); - return distribution(generator_); - } - - // Generate a random Vector3D with components between 0.0f and 1.0f - static Sleak::Math::Vector3D Vector3D() { - return Sleak::Math::Vector3D(Value(), Value(), Value()); - } - - // Generate a random Vector3D with components between min and max - static Sleak::Math::Vector3D Vector3D(float min, float max) { - return Sleak::Math::Vector3D( - Range(min, max), Range(min, max), Range(min, max)); - } - - // Generate a random Vector2D with components between 0.0f and 1.0f - static Sleak::Math::Vector2D Vector2D() { - return Vector2D(Value(), Value()); - } - - // Generate a random Vector2D with components between min and max - static Sleak::Math::Vector2D Vector2D(float min, float max) { - return Vector2D(Range(min, max), Range(min, max)); - } - - // Generate a random unit vector (direction) - static Sleak::Math::Vector3D UnitVector() { - float z = Range(-1.0f, 1.0f); - float a = Range(0.0f, 2.0f * PI); - float r = sqrt(1.0f - z * z); - float x = r * cos(a); - float y = r * sin(a); - return Sleak::Math::Vector3D(x, y, z); - } - - // Generate a random color with components between 0.0f and 1.0f - static Sleak::Math::Color Color(bool AlphaIncluded = false) { - return Sleak::Math::Color(Value(), Value(), Value(), - AlphaIncluded ? Value() : 1.0f); // Assuming Color is RGBA - } - - // Generate a random color with components between min and max - static Sleak::Math::Color Color(float min, float max, bool AlphaIncluded = false) { - return Sleak::Math::Color(Range(min, max), Range(min, max), - Range(min, max), - AlphaIncluded ? Range(min, max) : 1.0f); // Assuming Color is RGBA - } - - // Generate a random boolean value (true or false) - static bool Boolean() { - return Range(0, 1) == 1; - } - - // Generate a random normal distribution with given mean and standard deviation - static float NormalDistribution(float mean, float stddev) { - std::normal_distribution distribution(mean, stddev); - return distribution(generator_); - } - - private: - inline static std::mt19937 generator_; - }; - + class ENGINE_API Random { + public: + // Seed the generator with a specific value + static void Seed(unsigned int seed) { generator_.seed(seed); } + + // Seed the generator with a non-deterministic random value + static void SeedWithTime() { + std::random_device rd; + generator_.seed(rd()); + } + + // Generate a random integer between min and max (inclusive) + static int Range(int min, int max) { + std::uniform_int_distribution distribution(min, max); + return distribution(generator_); + } + + // Generate a random float between 0.0f and 1.0f + static float Value() { + std::uniform_real_distribution distribution(0.0f, 1.0f); + return distribution(generator_); + } + + // Generate a random float between min and max + static float Range(float min, float max) { + std::uniform_real_distribution distribution(min, max); + return distribution(generator_); + } + + // Generate a random Vector3D with components between 0.0f and 1.0f + static Sleak::Math::Vector3D Vector3D() { + return Sleak::Math::Vector3D(Value(), Value(), Value()); + } + + // Generate a random Vector3D with components between min and max + static Sleak::Math::Vector3D Vector3D(float min, float max) { + return Sleak::Math::Vector3D(Range(min, max), Range(min, max), + Range(min, max)); + } + + // Generate a random Vector2D with components between 0.0f and 1.0f + static Sleak::Math::Vector2D Vector2D() { + return Vector2D(Value(), Value()); + } + + // Generate a random Vector2D with components between min and max + static Sleak::Math::Vector2D Vector2D(float min, float max) { + return Vector2D(Range(min, max), Range(min, max)); + } + + // Generate a random unit vector (direction) + static Sleak::Math::Vector3D UnitVector() { + float z = Range(-1.0f, 1.0f); + float a = Range(0.0f, 2.0f * PI); + float r = sqrt(1.0f - z * z); + float x = r * cos(a); + float y = r * sin(a); + return Sleak::Math::Vector3D(x, y, z); + } + + // Generate a random color with components between 0.0f and 1.0f + static Sleak::Math::Color Color(bool AlphaIncluded = false) { + return Sleak::Math::Color( + Value(), Value(), Value(), + AlphaIncluded ? Value() : 1.0f); // Assuming Color is RGBA + } + + // Generate a random color with components between min and max + static Sleak::Math::Color Color(float min, float max, + bool AlphaIncluded = false) { + return Sleak::Math::Color( + Range(min, max), Range(min, max), Range(min, max), + AlphaIncluded ? Range(min, max) + : 1.0f); // Assuming Color is RGBA + } + + // Generate a random boolean value (true or false) + static bool Boolean() { return Range(0, 1) == 1; } + + // Generate a random normal distribution with given mean and + // standard deviation + static float NormalDistribution(float mean, float stddev) { + std::normal_distribution distribution(mean, stddev); + return distribution(generator_); + } + + private: + inline static std::mt19937 generator_; + }; } } diff --git a/include/public/Physics/CollisionDetection.hpp b/include/public/Physics/CollisionDetection.hpp index 9efd3937..69c7ff79 100644 --- a/include/public/Physics/CollisionDetection.hpp +++ b/include/public/Physics/CollisionDetection.hpp @@ -1,6 +1,7 @@ #ifndef _COLLISION_DETECTION_HPP_ #define _COLLISION_DETECTION_HPP_ +#include #include namespace Sleak { @@ -22,27 +23,41 @@ namespace Physics { }; /// Narrow-phase collision tests; the resulting normal always points from A to B. - CollisionManifold TestAABBvsAABB(const AABB& a, const AABB& b); - CollisionManifold TestSphereVsSphere(const BoundingSphere& a, const BoundingSphere& b); - CollisionManifold TestAABBvsSphere(const AABB& a, const BoundingSphere& b); - CollisionManifold TestSphereVsCapsule(const BoundingSphere& a, const BoundingCapsule& b); - CollisionManifold TestAABBvsCapsule(const AABB& a, const BoundingCapsule& b); - CollisionManifold TestCapsuleVsCapsule(const BoundingCapsule& a, const BoundingCapsule& b); - CollisionManifold TestSphereVsMesh(const BoundingSphere& a, const TriangleMesh& b); - CollisionManifold TestAABBvsMesh(const AABB& a, const TriangleMesh& b); + ENGINE_API CollisionManifold TestAABBvsAABB(const AABB& a, const AABB& b); + ENGINE_API CollisionManifold TestSphereVsSphere(const BoundingSphere& a, + const BoundingSphere& b); + ENGINE_API CollisionManifold TestAABBvsSphere(const AABB& a, + const BoundingSphere& b); + ENGINE_API CollisionManifold TestSphereVsCapsule(const BoundingSphere& a, + const BoundingCapsule& b); + ENGINE_API CollisionManifold TestAABBvsCapsule(const AABB& a, + const BoundingCapsule& b); + ENGINE_API CollisionManifold TestCapsuleVsCapsule(const BoundingCapsule& a, + const BoundingCapsule& b); + ENGINE_API CollisionManifold TestSphereVsMesh(const BoundingSphere& a, + const TriangleMesh& b); + ENGINE_API CollisionManifold TestAABBvsMesh(const AABB& a, + const TriangleMesh& b); /// Dispatches to the right narrow-phase test based on the runtime shape held by each variant. - CollisionManifold TestCollision(const ColliderShape& shapeA, const Vector3D& posA, const Vector3D& scaleA, - const ColliderShape& shapeB, const Vector3D& posB, const Vector3D& scaleB); + ENGINE_API CollisionManifold TestCollision(const ColliderShape& shapeA, + const Vector3D& posA, + const Vector3D& scaleA, + const ColliderShape& shapeB, + const Vector3D& posB, + const Vector3D& scaleB); /// Nearest point on segment [a, b] to the given point. - Vector3D ClosestPointOnSegment(const Vector3D& point, const Vector3D& a, const Vector3D& b); + ENGINE_API Vector3D ClosestPointOnSegment(const Vector3D& point, + const Vector3D& a, + const Vector3D& b); /// Nearest points between two line segments, used for capsule-vs-capsule tests. - void ClosestPointsSegmentSegment(const Vector3D& a1, const Vector3D& a2, - const Vector3D& b1, const Vector3D& b2, - Vector3D& closestA, Vector3D& closestB); - CollisionManifold TestSphereVsTriangle(const BoundingSphere& sphere, - const Vector3D& v0, const Vector3D& v1, const Vector3D& v2); + ENGINE_API void ClosestPointsSegmentSegment( + const Vector3D& a1, const Vector3D& a2, const Vector3D& b1, + const Vector3D& b2, Vector3D& closestA, Vector3D& closestB); + ENGINE_API CollisionManifold + TestSphereVsTriangle(const BoundingSphere& sphere, const Vector3D& v0, + const Vector3D& v1, const Vector3D& v2); } // namespace Physics } // namespace Sleak diff --git a/include/public/Physics/DynamicAABBTree.hpp b/include/public/Physics/DynamicAABBTree.hpp index acbf2bd7..91919f4d 100644 --- a/include/public/Physics/DynamicAABBTree.hpp +++ b/include/public/Physics/DynamicAABBTree.hpp @@ -1,6 +1,7 @@ #ifndef _DYNAMIC_AABB_TREE_HPP_ #define _DYNAMIC_AABB_TREE_HPP_ +#include #include #include #include @@ -26,8 +27,8 @@ namespace Physics { /// Broadphase AABB tree; PhysicsWorld inserts colliders as proxies and queries overlaps against it. /// @ingroup physics - class DynamicAABBTree { - public: + class ENGINE_API DynamicAABBTree { + public: DynamicAABBTree(); ~DynamicAABBTree() = default; diff --git a/include/public/Physics/PhysicsWorld.hpp b/include/public/Physics/PhysicsWorld.hpp index 4a1e3d3d..559e9e05 100644 --- a/include/public/Physics/PhysicsWorld.hpp +++ b/include/public/Physics/PhysicsWorld.hpp @@ -1,11 +1,12 @@ #ifndef _PHYSICS_WORLD_HPP_ #define _PHYSICS_WORLD_HPP_ +#include #include #include #include -#include #include +#include namespace Sleak { @@ -83,8 +84,8 @@ namespace Sleak { /// @see ColliderComponent, RigidbodyComponent, DynamicAABBTree, /// RayHit, SweepResult, CollisionPair /// @ingroup physics - class PhysicsWorld { - public: + class ENGINE_API PhysicsWorld { + public: PhysicsWorld() = default; ~PhysicsWorld() = default; From f76550ee73e5cfe9850089af272145320165307c Mon Sep 17 00:00:00 2001 From: Canberk Pitirli Date: Thu, 8 Oct 2026 12:47:01 +0300 Subject: [PATCH 2/2] style: apply clang-format to changed lines --- include/public/Core/OSDef.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/public/Core/OSDef.hpp b/include/public/Core/OSDef.hpp index 6533e67f..c58cb8a4 100644 --- a/include/public/Core/OSDef.hpp +++ b/include/public/Core/OSDef.hpp @@ -30,14 +30,14 @@ #define PLATFORM_IOS #define OS "ios" #define WINDOW_SYSTEM "quartz" - #define SLEAK_API +#define SLEAK_API /* Android devices (need to be defined before linux) */ #elif defined(__ANDROID__) #define PLATFORM_ANDROID #define OS "android" - #define WINDOW_SYSTEM "surfaceflinger" - #define SLEAK_API + #define WINDOW_SYSTEM "surfaceflinger" +#define SLEAK_API /* Berkley Software Distribution */ #elif defined(__FreeBSD__) @@ -47,7 +47,7 @@ #define PLATFORM_LINUX #define OS "linux" #define WINDOW_SYSTEM std::getenv("XDG_SESSION_TYPE") - #define SLEAK_API +#define SLEAK_API #else #error "Undefined OS"