From 564cda134520243718becd10c97d9ae7e95fe5cc Mon Sep 17 00:00:00 2001 From: Hartmut Seichter Date: Sat, 27 Jul 2024 09:40:02 +0200 Subject: [PATCH] WiP --- LICENSE | 2 +- README.md | 26 ++++-------- src/binding/include/pw/scripting/script.hpp | 2 +- src/core/include/pw/core/aabb.hpp | 2 +- src/core/include/pw/core/axisangle.hpp | 2 +- src/core/include/pw/core/buffer.hpp | 11 ----- src/core/include/pw/core/color.hpp | 2 +- src/core/include/pw/core/context.hpp | 0 src/core/include/pw/core/core.hpp | 2 +- src/core/include/pw/core/debug.hpp | 2 +- src/core/include/pw/core/formatter.hpp | 2 +- src/core/include/pw/core/frustum.hpp | 2 +- src/core/include/pw/core/globals.hpp | 2 +- src/core/include/pw/core/image.hpp | 2 +- src/core/include/pw/core/material.hpp | 2 +- src/core/include/pw/core/math.hpp | 2 +- src/core/include/pw/core/matrix.hpp | 6 +-- src/core/include/pw/core/matrix_transform.hpp | 2 +- src/core/include/pw/core/mesh.hpp | 2 +- src/core/include/pw/core/point.hpp | 2 +- src/core/include/pw/core/primitives.hpp | 2 +- src/core/include/pw/core/rectangle.hpp | 2 +- src/core/include/pw/core/resource.hpp | 2 +- src/core/include/pw/core/serialize.hpp | 2 +- src/core/include/pw/core/size.hpp | 8 ++-- src/core/include/pw/core/time.hpp | 23 +++++------ src/core/include/pw/core/vector.hpp | 11 ++--- src/core/src/time.cpp | 3 +- src/io/include/pw/io/image_io.hpp | 21 ++++------ .../include/pw/scene/components/camera.hpp | 14 +++---- .../pw/scene/components/projection.hpp | 3 +- .../pw/scene/components/relationship.hpp | 2 +- src/scene/include/pw/scene/entity.hpp | 2 +- src/scene/include/pw/scene/scene.hpp | 2 +- src/system/include/pw/system/input.hpp | 2 +- src/system/include/pw/system/path.hpp | 41 ++++++++----------- src/visual/include/pw/visual/context.hpp | 2 +- 37 files changed, 92 insertions(+), 125 deletions(-) delete mode 100644 src/core/include/pw/core/buffer.hpp delete mode 100644 src/core/include/pw/core/context.hpp diff --git a/LICENSE b/LICENSE index 21124e8..11faed7 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 1999-2021 Hartmut Seichter +Copyright (c) 1999-2024 Hartmut Seichter Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 09ab938..28dca57 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,19 @@ # pixwerx -pixwerx is an opinionated, academic approach to a 3D graphics engine. It mixes -modern and proven methods to build a fast and portable graphics system. +pixwerx is a general purpose 3D engine written in C++23 and scriptable with Lua. -## Design Principles - -Dogfooding: pixwerx is built on the principle of dogfooding. The engine is a -full-stack system that tries to implement all necessary functions. The engine -editor is just a UI build with the engine. - -Reasonable dependencies: like many engines pixwerx tries to include as much 3rd-party code as possible and implements some of the core systems itself. - -No premature optimization: pixwerx implements only very few systems with machine code. It tries to utilize the power of the compiler as much as possible. - -Computer graphics 101: pixwerx does implement graphics components and systems in a way that makes code portable and not over-parameterized. Usability is -achieved through layers on top of the core components. +## Principles +- datadriven design +- multiple platform capable through heavy usage of STL +- minimal set of dependencies +- efficiency through meta-meta programming techniques +- no CPU intrinsics ## License -pixwerx is licenced under the terms of the MIT License. Please consult the -LICENSE file. +pixwerx is licenced under the terms of the MIT License. Please consult the LICENSE file. ## Authors -© 1999-2020 Hartmut Seichter +© 1999-2024 Hartmut Seichter diff --git a/src/binding/include/pw/scripting/script.hpp b/src/binding/include/pw/scripting/script.hpp index ac1c504..e007644 100644 --- a/src/binding/include/pw/scripting/script.hpp +++ b/src/binding/include/pw/scripting/script.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2021 Hartmut Seichter + * Copyright (c) 1999-2024 Hartmut Seichter * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/core/include/pw/core/aabb.hpp b/src/core/include/pw/core/aabb.hpp index 3976af6..9ebbcba 100644 --- a/src/core/include/pw/core/aabb.hpp +++ b/src/core/include/pw/core/aabb.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2021 Hartmut Seichter + * Copyright (c) 1999-2024 Hartmut Seichter * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/core/include/pw/core/axisangle.hpp b/src/core/include/pw/core/axisangle.hpp index 46ace0d..183557c 100644 --- a/src/core/include/pw/core/axisangle.hpp +++ b/src/core/include/pw/core/axisangle.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2021 Hartmut Seichter + * Copyright (c) 1999-2024 Hartmut Seichter * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/core/include/pw/core/buffer.hpp b/src/core/include/pw/core/buffer.hpp deleted file mode 100644 index 5f894c3..0000000 --- a/src/core/include/pw/core/buffer.hpp +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef PW_CORE_BUFFER_HPP -#define PW_CORE_BUFFER_HPP - -#include -#include - - - - - -#endif // PW_CORE_BUFFER_HPP diff --git a/src/core/include/pw/core/color.hpp b/src/core/include/pw/core/color.hpp index 6f017ec..766f2c5 100644 --- a/src/core/include/pw/core/color.hpp +++ b/src/core/include/pw/core/color.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2021 Hartmut Seichter + * Copyright (c) 1999-2024 Hartmut Seichter * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/core/include/pw/core/context.hpp b/src/core/include/pw/core/context.hpp deleted file mode 100644 index e69de29..0000000 diff --git a/src/core/include/pw/core/core.hpp b/src/core/include/pw/core/core.hpp index 60c4361..ed32cf9 100644 --- a/src/core/include/pw/core/core.hpp +++ b/src/core/include/pw/core/core.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2021 Hartmut Seichter + * Copyright (c) 1999-2024 Hartmut Seichter * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/core/include/pw/core/debug.hpp b/src/core/include/pw/core/debug.hpp index 3350453..6f0876e 100644 --- a/src/core/include/pw/core/debug.hpp +++ b/src/core/include/pw/core/debug.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2021 Hartmut Seichter + * Copyright (c) 1999-2024 Hartmut Seichter * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/core/include/pw/core/formatter.hpp b/src/core/include/pw/core/formatter.hpp index 04be12b..94030d1 100644 --- a/src/core/include/pw/core/formatter.hpp +++ b/src/core/include/pw/core/formatter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2021 Hartmut Seichter + * Copyright (c) 1999-2024 Hartmut Seichter * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/core/include/pw/core/frustum.hpp b/src/core/include/pw/core/frustum.hpp index 7e66a97..5f69d16 100644 --- a/src/core/include/pw/core/frustum.hpp +++ b/src/core/include/pw/core/frustum.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2021 Hartmut Seichter + * Copyright (c) 1999-2024 Hartmut Seichter * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/core/include/pw/core/globals.hpp b/src/core/include/pw/core/globals.hpp index a5cfb02..aeeefbc 100644 --- a/src/core/include/pw/core/globals.hpp +++ b/src/core/include/pw/core/globals.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2021 Hartmut Seichter + * Copyright (c) 1999-2024 Hartmut Seichter * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/core/include/pw/core/image.hpp b/src/core/include/pw/core/image.hpp index ce512ee..f5258f6 100644 --- a/src/core/include/pw/core/image.hpp +++ b/src/core/include/pw/core/image.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2021 Hartmut Seichter + * Copyright (c) 1999-2024 Hartmut Seichter * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/core/include/pw/core/material.hpp b/src/core/include/pw/core/material.hpp index 374be53..dd29339 100644 --- a/src/core/include/pw/core/material.hpp +++ b/src/core/include/pw/core/material.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2021 Hartmut Seichter + * Copyright (c) 1999-2024 Hartmut Seichter * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/core/include/pw/core/math.hpp b/src/core/include/pw/core/math.hpp index 1a06ec4..4545255 100644 --- a/src/core/include/pw/core/math.hpp +++ b/src/core/include/pw/core/math.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2021 Hartmut Seichter + * Copyright (c) 1999-2024 Hartmut Seichter * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/core/include/pw/core/matrix.hpp b/src/core/include/pw/core/matrix.hpp index 9857045..6588d76 100644 --- a/src/core/include/pw/core/matrix.hpp +++ b/src/core/include/pw/core/matrix.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2021 Hartmut Seichter + * Copyright (c) 1999-2024 Hartmut Seichter * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -259,7 +259,7 @@ constexpr auto operator*(const matrix& A, } // -// matrix aliases +// type aliases // template using matrix2x2 = matrix; @@ -277,7 +277,7 @@ using matrix4x4d = matrix4x4; } // namespace pw // -// tuple - protocol +// tuple protocol // template struct std::tuple_size> diff --git a/src/core/include/pw/core/matrix_transform.hpp b/src/core/include/pw/core/matrix_transform.hpp index cf170f2..faa8bd8 100644 --- a/src/core/include/pw/core/matrix_transform.hpp +++ b/src/core/include/pw/core/matrix_transform.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2021 Hartmut Seichter + * Copyright (c) 1999-2024 Hartmut Seichter * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/core/include/pw/core/mesh.hpp b/src/core/include/pw/core/mesh.hpp index 9492013..de48299 100644 --- a/src/core/include/pw/core/mesh.hpp +++ b/src/core/include/pw/core/mesh.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2021 Hartmut Seichter + * Copyright (c) 1999-2024 Hartmut Seichter * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/core/include/pw/core/point.hpp b/src/core/include/pw/core/point.hpp index f85e4a6..5ce5a9d 100644 --- a/src/core/include/pw/core/point.hpp +++ b/src/core/include/pw/core/point.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2021 Hartmut Seichter + * Copyright (c) 1999-2024 Hartmut Seichter * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/core/include/pw/core/primitives.hpp b/src/core/include/pw/core/primitives.hpp index d497043..0116cf3 100644 --- a/src/core/include/pw/core/primitives.hpp +++ b/src/core/include/pw/core/primitives.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2021 Hartmut Seichter + * Copyright (c) 1999-2024 Hartmut Seichter * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/core/include/pw/core/rectangle.hpp b/src/core/include/pw/core/rectangle.hpp index 3e86420..eea564a 100644 --- a/src/core/include/pw/core/rectangle.hpp +++ b/src/core/include/pw/core/rectangle.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2021 Hartmut Seichter + * Copyright (c) 1999-2024 Hartmut Seichter * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/core/include/pw/core/resource.hpp b/src/core/include/pw/core/resource.hpp index 2e8d070..2a92aa9 100644 --- a/src/core/include/pw/core/resource.hpp +++ b/src/core/include/pw/core/resource.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2021 Hartmut Seichter + * Copyright (c) 1999-2024 Hartmut Seichter * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/core/include/pw/core/serialize.hpp b/src/core/include/pw/core/serialize.hpp index f3ac050..99c30af 100644 --- a/src/core/include/pw/core/serialize.hpp +++ b/src/core/include/pw/core/serialize.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2021 Hartmut Seichter + * Copyright (c) 1999-2024 Hartmut Seichter * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/core/include/pw/core/size.hpp b/src/core/include/pw/core/size.hpp index 628cf53..ebe49f8 100644 --- a/src/core/include/pw/core/size.hpp +++ b/src/core/include/pw/core/size.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2021 Hartmut Seichter + * Copyright (c) 1999-2024 Hartmut Seichter * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -31,7 +31,7 @@ namespace pw { template struct size { using value_type = Scalar; - Scalar width, height; + Scalar width{}, height{}; constexpr auto area() const noexcept -> Scalar { if constexpr (std::is_unsigned_v) { @@ -53,7 +53,9 @@ template struct size { } }; -// deduction guide for size +// +// deduction guide +// template > size(U...) -> size; diff --git a/src/core/include/pw/core/time.hpp b/src/core/include/pw/core/time.hpp index a24268b..35db565 100644 --- a/src/core/include/pw/core/time.hpp +++ b/src/core/include/pw/core/time.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2021 Hartmut Seichter + * Copyright (c) 1999-2024 Hartmut Seichter * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -8,8 +8,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, @@ -32,14 +32,13 @@ namespace pw { /** * @brief A simple high resolution timer */ -class time { -public: +struct time final { - using tick_t = std::chrono::time_point ; + using tick_t = std::chrono::time_point; - time() = default; + time() = default; time(const time&) = default; - ~time() = default; /// d'tor + ~time() = default; /// d'tor /** * @brief reset timer to current system time @@ -58,12 +57,10 @@ public: */ static double now(); -protected: - - tick_t _start = std::chrono::high_resolution_clock::now(); + protected: + tick_t _start{std::chrono::high_resolution_clock::now()}; }; -} - +} // namespace pw #endif diff --git a/src/core/include/pw/core/vector.hpp b/src/core/include/pw/core/vector.hpp index 79f4acb..5f055b0 100644 --- a/src/core/include/pw/core/vector.hpp +++ b/src/core/include/pw/core/vector.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2021 Hartmut Seichter + * Copyright (c) 1999-2024 Hartmut Seichter * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -292,14 +292,15 @@ template struct vector final { constexpr const_pointer end() const { return &v_[N]; } }; -// deduction guide for vector +// +// deduction guide +// template > vector(T, U...) -> vector; // -// Vector Aliases +// type aliases // - template using vector2 = vector; template using vector3 = vector; template using vector4 = vector; @@ -319,7 +320,7 @@ using vector4i = vector4; } // namespace pw // -// tuple - protocol +// tuple protocol // template struct std::tuple_size> diff --git a/src/core/src/time.cpp b/src/core/src/time.cpp index 65289b2..273cd19 100644 --- a/src/core/src/time.cpp +++ b/src/core/src/time.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2021 Hartmut Seichter + * Copyright (c) 1999-2024 Hartmut Seichter * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -42,4 +42,3 @@ double time::now() } } - diff --git a/src/io/include/pw/io/image_io.hpp b/src/io/include/pw/io/image_io.hpp index f1646e1..07978e7 100644 --- a/src/io/include/pw/io/image_io.hpp +++ b/src/io/include/pw/io/image_io.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2021 Hartmut Seichter + * Copyright (c) 1999-2024 Hartmut Seichter * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -8,8 +8,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, @@ -28,27 +28,22 @@ namespace pw { -class image_io { -public: - +struct image_io final { static image_io& get(); - image read(std::string const& uri,uint32_t flags = 0); + image read(std::string const& uri, uint32_t flags = 0); - bool write(const std::string &uri, const image &img, uint32_t flags = 0); + bool write(const std::string& uri, const image& img, uint32_t flags = 0); ~image_io(); - -protected: - + protected: struct impl; std::unique_ptr _impl; image_io(); - }; -} +} // namespace pw #endif diff --git a/src/scene/include/pw/scene/components/camera.hpp b/src/scene/include/pw/scene/components/camera.hpp index 4181392..ac1298a 100644 --- a/src/scene/include/pw/scene/components/camera.hpp +++ b/src/scene/include/pw/scene/components/camera.hpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 1999-2020 Hartmut Seichter + * Copyright (C) 1999-2024 Hartmut Seichter * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,17 +32,15 @@ namespace pw { struct camera { - matrix4x4 view = matrix4x4::identity(); - matrix4x4 projection = matrix_transform::look_at(vector3{0,0,0}, - vector3{0,0,1}, - vector3{0,1,0}); + matrix4x4f projection = matrix4x4f::identity(); + matrix4x4f view = matrix_transform::look_at(vector3f{}, vector3f::x_axis(), + vector3f::y_axis()); - rectangle viewport = pw::rectangle({0, 0, 1, 1}); + matrix4x4f viewport = pw::rectangle{{0.f, 0.f} {1.f, 1.f}}; uint32_t mask = 0xFFFFFF; }; -} - +} // namespace pw #endif diff --git a/src/scene/include/pw/scene/components/projection.hpp b/src/scene/include/pw/scene/components/projection.hpp index 28c6920..b598174 100644 --- a/src/scene/include/pw/scene/components/projection.hpp +++ b/src/scene/include/pw/scene/components/projection.hpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 1999-2020 Hartmut Seichter + * Copyright (C) 1999-2024 Hartmut Seichter * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -73,4 +73,3 @@ struct projection { } #endif - diff --git a/src/scene/include/pw/scene/components/relationship.hpp b/src/scene/include/pw/scene/components/relationship.hpp index b00da04..94dc6c4 100644 --- a/src/scene/include/pw/scene/components/relationship.hpp +++ b/src/scene/include/pw/scene/components/relationship.hpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 1999-2020 Hartmut Seichter + * Copyright (C) 1999-2024 Hartmut Seichter * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/scene/include/pw/scene/entity.hpp b/src/scene/include/pw/scene/entity.hpp index aa2655a..bcdc203 100644 --- a/src/scene/include/pw/scene/entity.hpp +++ b/src/scene/include/pw/scene/entity.hpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 1999-2020 Hartmut Seichter + * Copyright (C) 1999-2024 Hartmut Seichter * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/scene/include/pw/scene/scene.hpp b/src/scene/include/pw/scene/scene.hpp index d70c570..389d8dd 100644 --- a/src/scene/include/pw/scene/scene.hpp +++ b/src/scene/include/pw/scene/scene.hpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 1999-2017 Hartmut Seichter + * Copyright (C) 1999-2024 Hartmut Seichter * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/system/include/pw/system/input.hpp b/src/system/include/pw/system/input.hpp index 7ded0d9..638690c 100644 --- a/src/system/include/pw/system/input.hpp +++ b/src/system/include/pw/system/input.hpp @@ -7,7 +7,7 @@ namespace pw { -struct input { +struct input final { static input& get(); diff --git a/src/system/include/pw/system/path.hpp b/src/system/include/pw/system/path.hpp index 553047e..4790366 100644 --- a/src/system/include/pw/system/path.hpp +++ b/src/system/include/pw/system/path.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2021 Hartmut Seichter + * Copyright (c) 1999-2024 Hartmut Seichter * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -8,8 +8,8 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, @@ -27,38 +27,33 @@ namespace pw { - -class path { -public: - +struct path final { using path_list = std::vector; - static path& get(); - ~path(); + static path& get(); + ~path(); - std::string separator() const; + std::string separator() const; - std::string executable_path() const; + std::string executable_path() const; - path_list resource_paths() const { return _resource_paths; } + path_list resource_paths() const { return _resource_paths; } void set_resource_paths(path_list pl); - std::string find_file(const std::string &filename) const; + std::string find_file(const std::string& filename) const; - std::string get_filename(const std::string &filepath, bool with_extension = true) const; + std::string get_filename(const std::string& filepath, + bool with_extension = true) const; -protected: - - path_list _resource_paths; - - path(); - - struct impl; - std::unique_ptr _impl; + private: + path_list _resource_paths; + path(); + struct impl; + std::unique_ptr _impl; }; -} +} // namespace pw #endif diff --git a/src/visual/include/pw/visual/context.hpp b/src/visual/include/pw/visual/context.hpp index c007528..9b0c41d 100644 --- a/src/visual/include/pw/visual/context.hpp +++ b/src/visual/include/pw/visual/context.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2021 Hartmut Seichter + * Copyright (c) 1999-2024 Hartmut Seichter * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal