diff --git a/CPPLINT.cfg b/CPPLINT.cfg index 14d6dd0..b95edee 100644 --- a/CPPLINT.cfg +++ b/CPPLINT.cfg @@ -4,3 +4,4 @@ linelength=120 exclude_files=vendor exclude_files=docs filter=-runtime/explicit +filter=-legal/copyright diff --git a/examples/core/core_drop_files.cpp b/examples/core/core_drop_files.cpp index 59ceabe..d2132a9 100644 --- a/examples/core/core_drop_files.cpp +++ b/examples/core/core_drop_files.cpp @@ -39,7 +39,7 @@ int main() { // Draw //---------------------------------------------------------------------------------- BeginDrawing(); - + { ClearBackground(RAYWHITE); // Check if there are files to process. @@ -62,7 +62,7 @@ int main() { DrawText("Drop new files...", 100, 110 + 40 * droppedFiles.size(), 20, DARKGRAY); } - + } EndDrawing(); //---------------------------------------------------------------------------------- } diff --git a/include/AudioDevice.hpp b/include/AudioDevice.hpp index e73a628..1f050ce 100644 --- a/include/AudioDevice.hpp +++ b/include/AudioDevice.hpp @@ -1,27 +1,3 @@ -/* -* LICENSE: zlib/libpng -* -* raylib-cpp is licensed under an unmodified zlib/libpng license, which is an OSI-certified, -* BSD-like license that allows static linking with closed source software: -* -* Copyright (c) 2020 Rob Loach (@RobLoach) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - #ifndef RAYLIB_CPP_INCLUDE_AUDIODEVICE_HPP_ #define RAYLIB_CPP_INCLUDE_AUDIODEVICE_HPP_ @@ -63,9 +39,8 @@ class AudioDevice { /** * Close the audio device and context. */ - inline AudioDevice& Close() { + inline void Close() { ::CloseAudioDevice(); - return *this; } /** diff --git a/include/AudioStream.hpp b/include/AudioStream.hpp index b5ee869..c5b91e2 100644 --- a/include/AudioStream.hpp +++ b/include/AudioStream.hpp @@ -1,27 +1,3 @@ -/* -* LICENSE: zlib/libpng -* -* raylib-cpp is licensed under an unmodified zlib/libpng license, which is an OSI-certified, -* BSD-like license that allows static linking with closed source software: -* -* Copyright (c) 2020 Rob Loach (@RobLoach) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - #ifndef RAYLIB_CPP_INCLUDE_AUDIOSTREAM_HPP_ #define RAYLIB_CPP_INCLUDE_AUDIOSTREAM_HPP_ @@ -143,7 +119,7 @@ class AudioStream : public ::AudioStream { ::SetAudioStreamBufferSizeDefault(size); } - protected: + private: inline void set(const ::AudioStream& stream) { buffer = stream.buffer; sampleRate = stream.sampleRate; diff --git a/include/BoundingBox.hpp b/include/BoundingBox.hpp index 533f31d..7b8c4ce 100644 --- a/include/BoundingBox.hpp +++ b/include/BoundingBox.hpp @@ -1,27 +1,3 @@ -/* -* LICENSE: zlib/libpng -* -* raylib-cpp is licensed under an unmodified zlib/libpng license, which is an OSI-certified, -* BSD-like license that allows static linking with closed source software: -* -* Copyright (c) 2020 Rob Loach (@RobLoach) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - #ifndef RAYLIB_CPP_INCLUDE_BOUNDINGBOX_HPP_ #define RAYLIB_CPP_INCLUDE_BOUNDINGBOX_HPP_ @@ -87,7 +63,7 @@ class BoundingBox : public ::BoundingBox { return CheckCollisionRayBox(ray, *this); } - protected: + private: inline void set(const ::BoundingBox& box) { min = box.min; max = box.max; diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index a7c4d13..640675c 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -22,6 +22,7 @@ install(FILES Model.hpp Mouse.hpp Music.hpp + physac.hpp Physics.hpp RayHitInfo.hpp Ray.hpp diff --git a/include/Camera2D.hpp b/include/Camera2D.hpp index 78cb108..fb55a8c 100644 --- a/include/Camera2D.hpp +++ b/include/Camera2D.hpp @@ -1,27 +1,3 @@ -/* -* LICENSE: zlib/libpng -* -* raylib-cpp is licensed under an unmodified zlib/libpng license, which is an OSI-certified, -* BSD-like license that allows static linking with closed source software: -* -* Copyright (c) 2020 Rob Loach (@RobLoach) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - #ifndef RAYLIB_CPP_INCLUDE_CAMERA2D_HPP_ #define RAYLIB_CPP_INCLUDE_CAMERA2D_HPP_ @@ -30,6 +6,9 @@ #include "./raylib-cpp-utils.hpp" namespace raylib { +/** + * Camera2D type, defines a 2d camera + */ class Camera2D : public ::Camera2D { public: Camera2D() {} @@ -86,7 +65,7 @@ class Camera2D : public ::Camera2D { return ::GetScreenToWorld2D(position, *this); } - protected: + private: inline void set(const ::Camera2D& camera) { offset = camera.offset; target = camera.target; diff --git a/include/Camera3D.hpp b/include/Camera3D.hpp index 4006aa0..f235c59 100644 --- a/include/Camera3D.hpp +++ b/include/Camera3D.hpp @@ -1,27 +1,3 @@ -/* -* LICENSE: zlib/libpng -* -* raylib-cpp is licensed under an unmodified zlib/libpng license, which is an OSI-certified, -* BSD-like license that allows static linking with closed source software: -* -* Copyright (c) 2020 Rob Loach (@RobLoach) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - #ifndef RAYLIB_CPP_INCLUDE_CAMERA3D_HPP_ #define RAYLIB_CPP_INCLUDE_CAMERA3D_HPP_ @@ -30,6 +6,9 @@ #include "./raylib-cpp-utils.hpp" namespace raylib { +/** + * Camera type, defines a camera position/orientation in 3d space + */ class Camera3D : public ::Camera3D { public: Camera3D(const ::Camera3D& camera) { @@ -171,7 +150,7 @@ class Camera3D : public ::Camera3D { return *this; } - protected: + private: inline void set(const ::Camera3D& camera) { position = camera.position; target = camera.target; diff --git a/include/Color.hpp b/include/Color.hpp index e7cc8d5..2389a4f 100644 --- a/include/Color.hpp +++ b/include/Color.hpp @@ -1,27 +1,3 @@ -/* -* LICENSE: zlib/libpng -* -* raylib-cpp is licensed under an unmodified zlib/libpng license, which is an OSI-certified, -* BSD-like license that allows static linking with closed source software: -* -* Copyright (c) 2020 Rob Loach (@RobLoach) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - #ifndef RAYLIB_CPP_INCLUDE_COLOR_HPP_ #define RAYLIB_CPP_INCLUDE_COLOR_HPP_ @@ -32,6 +8,9 @@ #include "./raylib-cpp-utils.hpp" namespace raylib { +/** + * Color type, RGBA (32bit) + */ class Color : public ::Color { public: Color(const ::Color& color) { @@ -264,7 +243,7 @@ class Color : public ::Color { inline static Color Magenta() { return MAGENTA; } inline static Color RayWhite() { return RAYWHITE; } - protected: + private: inline void set(const ::Color& color) { r = color.r; g = color.g; diff --git a/include/Font.hpp b/include/Font.hpp index 2481ff1..f0b0d6a 100644 --- a/include/Font.hpp +++ b/include/Font.hpp @@ -1,27 +1,3 @@ -/* -* LICENSE: zlib/libpng -* -* raylib-cpp is licensed under an unmodified zlib/libpng license, which is an OSI-certified, -* BSD-like license that allows static linking with closed source software: -* -* Copyright (c) 2020 Rob Loach (@RobLoach) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - #ifndef RAYLIB_CPP_INCLUDE_FONT_HPP_ #define RAYLIB_CPP_INCLUDE_FONT_HPP_ @@ -31,6 +7,9 @@ #include "./raylib-cpp-utils.hpp" namespace raylib { +/** + * Font type, includes texture and charSet array data + */ class Font : public ::Font { public: Font() { @@ -138,7 +117,7 @@ class Font : public ::Font { return ::ImageTextEx(*this, text.c_str(), fontSize, spacing, tint); } - protected: + private: void set(const ::Font& font) { baseSize = font.baseSize; charsCount = font.charsCount; diff --git a/include/Functions.hpp b/include/Functions.hpp index 18e701e..d1dab21 100644 --- a/include/Functions.hpp +++ b/include/Functions.hpp @@ -1,27 +1,6 @@ -/* -* LICENSE: zlib/libpng -* -* raylib-cpp is licensed under an unmodified zlib/libpng license, which is an OSI-certified, -* BSD-like license that allows static linking with closed source software: -* -* Copyright (c) 2020 Rob Loach (@RobLoach) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - +/** + * C++ wrapper functions for raylib. + */ #ifndef RAYLIB_CPP_INCLUDE_FUNCTIONS_HPP_ #define RAYLIB_CPP_INCLUDE_FUNCTIONS_HPP_ @@ -243,7 +222,7 @@ RLCPPAPI inline ::Image LoadImageAnim(const std::string& fileName, int *frames) } /** - * Load image from memory buffer, fileType refers to extension: i.e. "png" + * Load image from memory buffer, fileType refers to extension like "png" */ RLCPPAPI inline ::Image LoadImageFromMemory(const std::string& fileType, const unsigned char *fileData, diff --git a/include/Gamepad.hpp b/include/Gamepad.hpp index 2d84667..1781992 100644 --- a/include/Gamepad.hpp +++ b/include/Gamepad.hpp @@ -1,27 +1,3 @@ -/* -* LICENSE: zlib/libpng -* -* raylib-cpp is licensed under an unmodified zlib/libpng license, which is an OSI-certified, -* BSD-like license that allows static linking with closed source software: -* -* Copyright (c) 2020 Rob Loach (@RobLoach) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - #ifndef RAYLIB_CPP_INCLUDE_GAMEPAD_HPP_ #define RAYLIB_CPP_INCLUDE_GAMEPAD_HPP_ @@ -31,6 +7,9 @@ #include "./raylib-cpp-utils.hpp" namespace raylib { +/** + * Input-related functions: gamepads + */ class Gamepad { public: Gamepad(int gamepadNumber = 0) { @@ -136,7 +115,7 @@ class Gamepad { return ::GetGamepadAxisMovement(number, axis); } - protected: + private: inline void set(int gamepadNumber) { number = gamepadNumber; } diff --git a/include/Image.hpp b/include/Image.hpp index a55a47a..fcdd972 100644 --- a/include/Image.hpp +++ b/include/Image.hpp @@ -1,27 +1,3 @@ -/* -* LICENSE: zlib/libpng -* -* raylib-cpp is licensed under an unmodified zlib/libpng license, which is an OSI-certified, -* BSD-like license that allows static linking with closed source software: -* -* Copyright (c) 2020 Rob Loach (@RobLoach) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - #ifndef RAYLIB_CPP_INCLUDE_IMAGE_HPP_ #define RAYLIB_CPP_INCLUDE_IMAGE_HPP_ @@ -31,6 +7,11 @@ #include "./raylib-cpp-utils.hpp" namespace raylib { +/** + * Image type, bpp always RGBA (32bit) + * + * Data stored in CPU memory (RAM) + */ class Image : public ::Image { public: Image(const ::Image& image) { @@ -561,7 +542,7 @@ class Image : public ::Image { return LoadTexture(); } - protected: + private: inline void set(const ::Image& image) { data = image.data; width = image.width; diff --git a/include/Material.hpp b/include/Material.hpp index f9fe496..b3f6903 100644 --- a/include/Material.hpp +++ b/include/Material.hpp @@ -1,27 +1,3 @@ -/* -* LICENSE: zlib/libpng -* -* raylib-cpp is licensed under an unmodified zlib/libpng license, which is an OSI-certified, -* BSD-like license that allows static linking with closed source software: -* -* Copyright (c) 2020 Rob Loach (@RobLoach) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - #ifndef RAYLIB_CPP_INCLUDE_MATERIAL_HPP_ #define RAYLIB_CPP_INCLUDE_MATERIAL_HPP_ @@ -32,6 +8,9 @@ #include "./raylib-cpp-utils.hpp" namespace raylib { +/** + * Material type (generic) + */ class Material : public ::Material { public: Material(const ::Material& material) { @@ -85,7 +64,7 @@ class Material : public ::Material { return *this; } - protected: + private: inline void set(const ::Material& material) { shader = material.shader; maps = material.maps; diff --git a/include/Matrix.hpp b/include/Matrix.hpp index f36c817..252514e 100644 --- a/include/Matrix.hpp +++ b/include/Matrix.hpp @@ -1,48 +1,18 @@ -/* -* LICENSE: zlib/libpng -* -* raylib-cpp is licensed under an unmodified zlib/libpng license, which is an OSI-certified, -* BSD-like license that allows static linking with closed source software: -* -* Copyright (c) 2020 Rob Loach (@RobLoach) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - #ifndef RAYLIB_CPP_INCLUDE_MATRIX_HPP_ #define RAYLIB_CPP_INCLUDE_MATRIX_HPP_ -#ifdef __cplusplus -extern "C" { -#endif -#include "raylib.h" // NOLINT -#ifndef RAYLIB_CPP_NO_MATH -#include "raymath.h" // NOLINT -#endif -#ifdef __cplusplus -} -#endif +#include "./raylib.hpp" +#include "./raylib-cpp-utils.hpp" +#include "./raymath.hpp" #ifndef RAYLIB_CPP_NO_MATH #include #endif -#include "./raylib-cpp-utils.hpp" - namespace raylib { +/** + * Matrix type (OpenGL style 4x4 - right handed, column major) + */ class Matrix : public ::Matrix { public: Matrix(const ::Matrix& mat) { @@ -261,7 +231,7 @@ class Matrix : public ::Matrix { #endif - protected: + private: inline void set(const ::Matrix& mat) { m0 = mat.m0; m1 = mat.m1; diff --git a/include/Mesh.hpp b/include/Mesh.hpp index 7ee8a19..03b790e 100644 --- a/include/Mesh.hpp +++ b/include/Mesh.hpp @@ -1,27 +1,3 @@ -/* -* LICENSE: zlib/libpng -* -* raylib-cpp is licensed under an unmodified zlib/libpng license, which is an OSI-certified, -* BSD-like license that allows static linking with closed source software: -* -* Copyright (c) 2020 Rob Loach (@RobLoach) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - #ifndef RAYLIB_CPP_INCLUDE_MESH_HPP_ #define RAYLIB_CPP_INCLUDE_MESH_HPP_ @@ -34,6 +10,9 @@ #include "./Model.hpp" namespace raylib { +/** + * Vertex data definning a mesh + */ class Mesh : public ::Mesh { public: Mesh(const ::Mesh& mesh) { @@ -157,6 +136,9 @@ class Mesh : public ::Mesh { return ExportMesh(*this, fileName.c_str()); } + /** + * Unload mesh from memory (RAM and/or VRAM) + */ inline void Unload() { if (vboId != NULL) { ::UnloadMesh(*this); @@ -216,7 +198,7 @@ class Mesh : public ::Mesh { return ::LoadModelFromMesh(*this); } - protected: + private: inline void set(const ::Mesh& mesh) { vertexCount = mesh.vertexCount; triangleCount = mesh.triangleCount; diff --git a/include/Model.hpp b/include/Model.hpp index 68e9f57..a3deff9 100644 --- a/include/Model.hpp +++ b/include/Model.hpp @@ -1,27 +1,3 @@ -/* -* LICENSE: zlib/libpng -* -* raylib-cpp is licensed under an unmodified zlib/libpng license, which is an OSI-certified, -* BSD-like license that allows static linking with closed source software: -* -* Copyright (c) 2020 Rob Loach (@RobLoach) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - #ifndef RAYLIB_CPP_INCLUDE_MODEL_HPP_ #define RAYLIB_CPP_INCLUDE_MODEL_HPP_ @@ -32,6 +8,9 @@ #include "./Mesh.hpp" namespace raylib { +/** + * Model type + */ class Model : public ::Model { public: Model(const ::Model& model) { @@ -160,7 +139,7 @@ class Model : public ::Model { return *this; } - protected: + private: inline void set(const ::Model& model) { transform = model.transform; diff --git a/include/ModelAnimation.hpp b/include/ModelAnimation.hpp index cd13f0f..1f57062 100644 --- a/include/ModelAnimation.hpp +++ b/include/ModelAnimation.hpp @@ -1,27 +1,3 @@ -/* -* LICENSE: zlib/libpng -* -* raylib-cpp is licensed under an unmodified zlib/libpng license, which is an OSI-certified, -* BSD-like license that allows static linking with closed source software: -* -* Copyright (c) 2020 Rob Loach (@RobLoach) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - #ifndef RAYLIB_CPP_INCLUDE_MODELANIMATION_HPP_ #define RAYLIB_CPP_INCLUDE_MODELANIMATION_HPP_ @@ -87,7 +63,7 @@ class ModelAnimation : public ::ModelAnimation { return ::IsModelAnimationValid(model, *this); } - protected: + private: inline void set(const ::ModelAnimation& model) { boneCount = model.boneCount; bones = model.bones; diff --git a/include/Mouse.hpp b/include/Mouse.hpp index 2cd009e..b4f7392 100644 --- a/include/Mouse.hpp +++ b/include/Mouse.hpp @@ -1,32 +1,7 @@ -/* -* LICENSE: zlib/libpng -* -* raylib-cpp is licensed under an unmodified zlib/libpng license, which is an OSI-certified, -* BSD-like license that allows static linking with closed source software: -* -* Copyright (c) 2020 Rob Loach (@RobLoach) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - #ifndef RAYLIB_CPP_INCLUDE_MOUSE_HPP_ #define RAYLIB_CPP_INCLUDE_MOUSE_HPP_ #include "./raylib.hpp" - #include "./Vector2.hpp" namespace raylib { diff --git a/include/Music.hpp b/include/Music.hpp index cba7ce5..cd3a98f 100644 --- a/include/Music.hpp +++ b/include/Music.hpp @@ -1,27 +1,3 @@ -/* -* LICENSE: zlib/libpng -* -* raylib-cpp is licensed under an unmodified zlib/libpng license, which is an OSI-certified, -* BSD-like license that allows static linking with closed source software: -* -* Copyright (c) 2020 Rob Loach (@RobLoach) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - #ifndef RAYLIB_CPP_INCLUDE_MUSIC_HPP_ #define RAYLIB_CPP_INCLUDE_MUSIC_HPP_ @@ -31,6 +7,9 @@ #include "./raylib-cpp-utils.hpp" namespace raylib { +/** + * Music stream type (audio file streaming from memory) + */ class Music : public ::Music { public: Music(const ::Music& music) { @@ -146,7 +125,7 @@ class Music : public ::Music { return ::GetMusicTimePlayed(*this); } - protected: + private: inline void set(const ::Music& music) { ctxType = music.ctxType; ctxData = music.ctxData; diff --git a/include/Physics.hpp b/include/Physics.hpp index 4731217..e2606ac 100644 --- a/include/Physics.hpp +++ b/include/Physics.hpp @@ -1,43 +1,14 @@ -/* -* LICENSE: zlib/libpng -* -* raylib-cpp is licensed under an unmodified zlib/libpng license, which is an OSI-certified, -* BSD-like license that allows static linking with closed source software: -* -* Copyright (c) 2020 Rob Loach (@RobLoach) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - #ifndef RAYLIB_CPP_INCLUDE_PHYSICS_HPP_ #define RAYLIB_CPP_INCLUDE_PHYSICS_HPP_ #include "./raylib.hpp" - -#ifdef __cplusplus -extern "C" { -#endif -#include "physac.h" // NOLINT -#ifdef __cplusplus -} -#endif - +#include "./physac.hpp" #include "./Vector2.hpp" namespace raylib { +/** + * 2D Physics library for videogames + */ class Physics { public: Physics() { diff --git a/include/Ray.hpp b/include/Ray.hpp index 49a1623..beb08b9 100644 --- a/include/Ray.hpp +++ b/include/Ray.hpp @@ -1,34 +1,8 @@ -/* -* LICENSE: zlib/libpng -* -* raylib-cpp is licensed under an unmodified zlib/libpng license, which is an OSI-certified, -* BSD-like license that allows static linking with closed source software: -* -* Copyright (c) 2020 Rob Loach (@RobLoach) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - #ifndef RAYLIB_CPP_INCLUDE_RAY_HPP_ #define RAYLIB_CPP_INCLUDE_RAY_HPP_ #include "./raylib.hpp" - #include "./raylib-cpp-utils.hpp" - #include "./RayHitInfo.hpp" namespace raylib { @@ -109,7 +83,7 @@ class Ray : public ::Ray { return GetCollisionRayGround(*this, groundHeight); } - protected: + private: inline void set(const ::Ray& ray) { position = ray.position; direction = ray.direction; diff --git a/include/RayHitInfo.hpp b/include/RayHitInfo.hpp index 746f472..35c44d8 100644 --- a/include/RayHitInfo.hpp +++ b/include/RayHitInfo.hpp @@ -1,27 +1,3 @@ -/* -* LICENSE: zlib/libpng -* -* raylib-cpp is licensed under an unmodified zlib/libpng license, which is an OSI-certified, -* BSD-like license that allows static linking with closed source software: -* -* Copyright (c) 2020 Rob Loach (@RobLoach) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - #ifndef RAYLIB_CPP_INCLUDE_RAYHITINFO_HPP_ #define RAYLIB_CPP_INCLUDE_RAYHITINFO_HPP_ @@ -83,7 +59,7 @@ class RayHitInfo : public ::RayHitInfo { GETTERSETTER(::Vector3, Position, position) GETTERSETTER(::Vector3, Normal, normal) - protected: + private: inline void set(const ::RayHitInfo& ray) { hit = ray.hit; distance = ray.distance; diff --git a/include/Rectangle.hpp b/include/Rectangle.hpp index b98eef3..986b510 100644 --- a/include/Rectangle.hpp +++ b/include/Rectangle.hpp @@ -1,27 +1,3 @@ -/* -* LICENSE: zlib/libpng -* -* raylib-cpp is licensed under an unmodified zlib/libpng license, which is an OSI-certified, -* BSD-like license that allows static linking with closed source software: -* -* Copyright (c) 2020 Rob Loach (@RobLoach) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - #ifndef RAYLIB_CPP_INCLUDE_RECTANGLE_HPP_ #define RAYLIB_CPP_INCLUDE_RECTANGLE_HPP_ @@ -30,6 +6,9 @@ #include "./Vector2.hpp" namespace raylib { +/** + * Rectangle type + */ class Rectangle : public ::Rectangle { public: Rectangle(const ::Rectangle& vec) { @@ -173,7 +152,7 @@ class Rectangle : public ::Rectangle { return SetPosition(position.x, position.y); } - protected: + private: inline void set(const ::Rectangle& rect) { x = rect.x; y = rect.y; diff --git a/include/RenderTexture.hpp b/include/RenderTexture.hpp index 09d1ed1..75c8a6d 100644 --- a/include/RenderTexture.hpp +++ b/include/RenderTexture.hpp @@ -1,27 +1,3 @@ -/* -* LICENSE: zlib/libpng -* -* raylib-cpp is licensed under an unmodified zlib/libpng license, which is an OSI-certified, -* BSD-like license that allows static linking with closed source software: -* -* Copyright (c) 2020 Rob Loach (@RobLoach) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - #ifndef RAYLIB_CPP_INCLUDE_RENDERTEXTURE_HPP_ #define RAYLIB_CPP_INCLUDE_RENDERTEXTURE_HPP_ @@ -29,6 +5,9 @@ #include "./raylib-cpp-utils.hpp" namespace raylib { +/** + * RenderTexture type, for texture rendering + */ class RenderTexture : public ::RenderTexture { public: RenderTexture(const ::RenderTexture& renderTexture) { @@ -76,7 +55,7 @@ class RenderTexture : public ::RenderTexture { return *this; } - protected: + private: inline void set(const ::RenderTexture& renderTexture) { id = renderTexture.id; texture = renderTexture.texture; diff --git a/include/Shader.hpp b/include/Shader.hpp index 9147e0d..047f1f1 100644 --- a/include/Shader.hpp +++ b/include/Shader.hpp @@ -1,27 +1,3 @@ -/* -* LICENSE: zlib/libpng -* -* raylib-cpp is licensed under an unmodified zlib/libpng license, which is an OSI-certified, -* BSD-like license that allows static linking with closed source software: -* -* Copyright (c) 2020 Rob Loach (@RobLoach) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - #ifndef RAYLIB_CPP_INCLUDE_SHADER_HPP_ #define RAYLIB_CPP_INCLUDE_SHADER_HPP_ @@ -32,6 +8,9 @@ #include "Texture.hpp" namespace raylib { +/** + * Shader type (generic) + */ class Shader : public ::Shader { public: Shader(const ::Shader& shader) { @@ -171,7 +150,7 @@ class Shader : public ::Shader { return ::GenTextureBRDF(*this, size); } - protected: + private: inline void set(const ::Shader& shader) { id = shader.id; locs = shader.locs; diff --git a/include/Sound.hpp b/include/Sound.hpp index 4deee22..5dc51df 100644 --- a/include/Sound.hpp +++ b/include/Sound.hpp @@ -1,27 +1,3 @@ -/* -* LICENSE: zlib/libpng -* -* raylib-cpp is licensed under an unmodified zlib/libpng license, which is an OSI-certified, -* BSD-like license that allows static linking with closed source software: -* -* Copyright (c) 2020 Rob Loach (@RobLoach) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - #ifndef RAYLIB_CPP_INCLUDE_SOUND_HPP_ #define RAYLIB_CPP_INCLUDE_SOUND_HPP_ @@ -33,6 +9,11 @@ namespace raylib { /** * Wave/Sound management functions + * + * @code + * raylib::Sound boom("boom.wav"); + * boom.Play(); + * @endcode */ class Sound : public ::Sound { public: @@ -146,7 +127,7 @@ class Sound : public ::Sound { return *this; } - protected: + private: inline void set(const ::Sound& sound) { sampleCount = sound.sampleCount; stream = sound.stream; diff --git a/include/Text.hpp b/include/Text.hpp index 1c70539..197d80b 100644 --- a/include/Text.hpp +++ b/include/Text.hpp @@ -1,30 +1,6 @@ -/* -* Font Loading and Text Drawing Functions (Module: text) -* -* LICENSE: zlib/libpng -* -* raylib-cpp is licensed under an unmodified zlib/libpng license, which is an OSI-certified, -* BSD-like license that allows static linking with closed source software: -* -* Copyright (c) 2020 Rob Loach (@RobLoach) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - - +/** + * Text drawing functions + */ #ifndef RAYLIB_CPP_INCLUDE_TEXT_HPP_ #define RAYLIB_CPP_INCLUDE_TEXT_HPP_ @@ -67,6 +43,13 @@ RLCPPAPI inline bool TextIsEqual(const std::string& text1, const std::string& te return ::TextIsEqual(text1.c_str(), text2.c_str()); } +/** + * Check if two text string are equal + */ +RLCPPAPI inline unsigned int TextLength(const std::string& text) { + return ::TextLength(text.c_str()); +} + // TODO(RobLoach): Add remaining raylib C functions with string c_str() wrappers. } // namespace raylib diff --git a/include/Texture.hpp b/include/Texture.hpp index 4470674..1386352 100644 --- a/include/Texture.hpp +++ b/include/Texture.hpp @@ -1,27 +1,3 @@ -/* -* LICENSE: zlib/libpng -* -* raylib-cpp is licensed under an unmodified zlib/libpng license, which is an OSI-certified, -* BSD-like license that allows static linking with closed source software: -* -* Copyright (c) 2020 Rob Loach (@RobLoach) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - #ifndef RAYLIB_CPP_INCLUDE_TEXTURE_HPP_ #define RAYLIB_CPP_INCLUDE_TEXTURE_HPP_ @@ -246,7 +222,7 @@ class Texture : public ::Texture { return *this; } - protected: + private: inline void set(const ::Texture& texture) { id = texture.id; width = texture.width; diff --git a/include/Vector2.hpp b/include/Vector2.hpp index 28edaf6..0470e86 100644 --- a/include/Vector2.hpp +++ b/include/Vector2.hpp @@ -1,27 +1,3 @@ -/* -* LICENSE: zlib/libpng -* -* raylib-cpp is licensed under an unmodified zlib/libpng license, which is an OSI-certified, -* BSD-like license that allows static linking with closed source software: -* -* Copyright (c) 2020 Rob Loach (@RobLoach) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - #ifndef RAYLIB_CPP_INCLUDE_VECTOR2_HPP_ #define RAYLIB_CPP_INCLUDE_VECTOR2_HPP_ @@ -34,6 +10,9 @@ #include "./raylib-cpp-utils.hpp" namespace raylib { +/** + * Vector2 type + */ class Vector2 : public ::Vector2 { public: Vector2(const ::Vector2& vec) { @@ -340,7 +319,7 @@ class Vector2 : public ::Vector2 { return ::CheckCollisionLines(*this, endPos1, startPos2, endPos2, collisionPoint); } - protected: + private: inline void set(const ::Vector2& vec) { x = vec.x; y = vec.y; diff --git a/include/Vector3.hpp b/include/Vector3.hpp index 83ed949..00e5e7e 100644 --- a/include/Vector3.hpp +++ b/include/Vector3.hpp @@ -1,27 +1,3 @@ -/* -* LICENSE: zlib/libpng -* -* raylib-cpp is licensed under an unmodified zlib/libpng license, which is an OSI-certified, -* BSD-like license that allows static linking with closed source software: -* -* Copyright (c) 2020 Rob Loach (@RobLoach) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - #ifndef RAYLIB_CPP_INCLUDE_VECTOR3_HPP_ #define RAYLIB_CPP_INCLUDE_VECTOR3_HPP_ @@ -34,6 +10,9 @@ #include "./raylib-cpp-utils.hpp" namespace raylib { +/** + * Vector3 type + */ class Vector3 : public ::Vector3 { public: Vector3(const ::Vector3& vec) { @@ -324,7 +303,7 @@ class Vector3 : public ::Vector3 { return CheckCollisionSpheres(*this, radius1, center2, radius2); } - protected: + private: inline void set(const ::Vector3& vec) { x = vec.x; y = vec.y; diff --git a/include/Vector4.hpp b/include/Vector4.hpp index 44a4178..d610c17 100644 --- a/include/Vector4.hpp +++ b/include/Vector4.hpp @@ -1,27 +1,3 @@ -/* -* LICENSE: zlib/libpng -* -* raylib-cpp is licensed under an unmodified zlib/libpng license, which is an OSI-certified, -* BSD-like license that allows static linking with closed source software: -* -* Copyright (c) 2020 Rob Loach (@RobLoach) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - #ifndef RAYLIB_CPP_INCLUDE_VECTOR4_HPP_ #define RAYLIB_CPP_INCLUDE_VECTOR4_HPP_ @@ -35,6 +11,9 @@ #include "./raylib-cpp-utils.hpp" namespace raylib { +/** + * Vector4 type + */ class Vector4 : public ::Vector4 { public: Vector4(const ::Vector4& vec) { @@ -169,7 +148,7 @@ class Vector4 : public ::Vector4 { return ColorFromNormalized(); } - protected: + private: inline void set(const ::Vector4& vec4) { x = vec4.x; y = vec4.y; diff --git a/include/VrSimulator.hpp b/include/VrSimulator.hpp index 011fc95..1f31075 100644 --- a/include/VrSimulator.hpp +++ b/include/VrSimulator.hpp @@ -1,27 +1,3 @@ -/* -* LICENSE: zlib/libpng -* -* raylib-cpp is licensed under an unmodified zlib/libpng license, which is an OSI-certified, -* BSD-like license that allows static linking with closed source software: -* -* Copyright (c) 2020 Rob Loach (@RobLoach) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - #ifndef RAYLIB_CPP_INCLUDE_VRSIMULATOR_HPP_ #define RAYLIB_CPP_INCLUDE_VRSIMULATOR_HPP_ @@ -29,6 +5,9 @@ #include "./raylib-cpp-utils.hpp" namespace raylib { +/** + * VR control functions + */ class VrSimulator { public: VrSimulator() { diff --git a/include/Wave.hpp b/include/Wave.hpp index 6155a14..1d5c22d 100644 --- a/include/Wave.hpp +++ b/include/Wave.hpp @@ -1,27 +1,3 @@ -/* -* LICENSE: zlib/libpng -* -* raylib-cpp is licensed under an unmodified zlib/libpng license, which is an OSI-certified, -* BSD-like license that allows static linking with closed source software: -* -* Copyright (c) 2020 Rob Loach (@RobLoach) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - #ifndef RAYLIB_CPP_INCLUDE_WAVE_HPP_ #define RAYLIB_CPP_INCLUDE_WAVE_HPP_ @@ -31,6 +7,9 @@ #include "./raylib-cpp-utils.hpp" namespace raylib { +/** + * Wave type, defines audio wave data + */ class Wave : public ::Wave { public: Wave(const ::Wave& wave) { @@ -62,6 +41,9 @@ class Wave : public ::Wave { set(::LoadWaveFromMemory(fileType.c_str(), fileData, dataSize)); } + /** + * Unload wave data + */ ~Wave() { Unload(); } @@ -161,7 +143,7 @@ class Wave : public ::Wave { return LoadSound(); } - protected: + private: inline void set(const ::Wave& wave) { sampleCount = wave.sampleCount; sampleRate = wave.sampleRate; diff --git a/include/Window.hpp b/include/Window.hpp index 65e32c4..365cfcc 100644 --- a/include/Window.hpp +++ b/include/Window.hpp @@ -1,27 +1,3 @@ -/* -* LICENSE: zlib/libpng -* -* raylib-cpp is licensed under an unmodified zlib/libpng license, which is an OSI-certified, -* BSD-like license that allows static linking with closed source software: -* -* Copyright (c) 2020 Rob Loach (@RobLoach) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - #ifndef RAYLIB_CPP_INCLUDE_WINDOW_HPP_ #define RAYLIB_CPP_INCLUDE_WINDOW_HPP_ @@ -32,14 +8,6 @@ namespace raylib { /** * Window and Graphics Device Functions. - * - * @code - * - * raylib::Window w(640, 480, "raylib-cpp"); - * while (!w.ShouldClose()) { - * // Update - * } - * @endcode */ class Window { public: @@ -53,6 +21,9 @@ class Window { } } + /** + * Close window and unload OpenGL context + */ ~Window() { Close(); } diff --git a/include/physac.hpp b/include/physac.hpp new file mode 100644 index 0000000..7a1be5c --- /dev/null +++ b/include/physac.hpp @@ -0,0 +1,15 @@ +/** + * C++ header to wrap physac.h. + */ +#ifndef RAYLIB_CPP_INCLUDE_PHYSAC_HPP_ +#define RAYLIB_CPP_INCLUDE_PHYSAC_HPP_ + +#ifdef __cplusplus +extern "C" { +#endif +#include "physac.h" // NOLINT +#ifdef __cplusplus +} +#endif + +#endif // RAYLIB_CPP_INCLUDE_PHYSAC_HPP_ diff --git a/include/raylib-cpp-utils.hpp b/include/raylib-cpp-utils.hpp index 8076854..2711684 100644 --- a/include/raylib-cpp-utils.hpp +++ b/include/raylib-cpp-utils.hpp @@ -1,27 +1,6 @@ -/* -* LICENSE: zlib/libpng -* -* raylib-cpp is licensed under an unmodified zlib/libpng license, which is an OSI-certified, -* BSD-like license that allows static linking with closed source software: -* -* Copyright (c) 2020 Rob Loach (@RobLoach) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - +/** + * Utility for raylib-cpp. + */ #ifndef RAYLIB_CPP_INCLUDE_RAYLIB_CPP_UTILS_HPP_ #define RAYLIB_CPP_INCLUDE_RAYLIB_CPP_UTILS_HPP_ @@ -34,7 +13,9 @@ * @param name The machine-readable name of the property. */ #define GETTERSETTER(type, method, name) \ - inline type Get##method() const { return name; } \ + /** Retrieves the name value for the object. @return The name value of the object. */ \ + inline type Get##method() const { return name; } \ + /** Sets the name value for the object. @param value The value of which to set name to. */ \ inline void Set##method(type value) { name = value; } #endif diff --git a/include/raylib-cpp.hpp b/include/raylib-cpp.hpp index 8e64045..de1b869 100644 --- a/include/raylib-cpp.hpp +++ b/include/raylib-cpp.hpp @@ -1,68 +1,32 @@ /** -* LICENSE: zlib/libpng -* -* raylib-cpp is licensed under an unmodified zlib/libpng license, which is an OSI-certified, -* BSD-like license that allows static linking with closed source software: -* -* Copyright 2020 Rob Loach (RobLoach) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -* -* \mainpage raylib-cpp -* -* [raylib-cpp](https://github.com/robloach/raylib-cpp) is a C++ wrapper library for raylib, a simple and easy-to-use library to enjoy videogames programming. This C++ header provides object-oriented wrappers around raylib's struct interfaces. -* -* See the ::raylib namespace for all available classes. -* -* @code -* #include "raylib-cpp.hpp" -* -* int main() -* { -* int screenWidth = 800; -* int screenHeight = 450; -* -* raylib::Window w(screenWidth, screenHeight, "raylib-cpp - basic window"); -* raylib::Texture logo("raylib_logo.png"); -* -* SetTargetFPS(60); -* -* while (!w.ShouldClose()) -* { -* BeginDrawing(); -* -* ClearBackground(RAYWHITE); -* -* DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY); -* -* // Object methods. -* logo.Draw( -* screenWidth / 2 - texture.getWidth() / 2, -* screenHeight / 2 - texture.getHeight() / 2); -* -* EndDrawing(); -* } -* -* // UnloadTexture() and CloseWindow() are called automatically. -* -* return 0; -* } -* @endcode -* -*/ + * raylib-cpp is a C++ wrapper library for raylib, a simple and easy-to-use library to enjoy videogames programming. This C++ header provides object-oriented wrappers around raylib's struct interfaces. + * + * @see raylib namespace for a list of all available classes. + * @mainpage raylib-cpp + * @include core_basic_window.cpp + * @author Rob Loach (RobLoach) + * @copyright zlib/libpng + * + * raylib-cpp is licensed under an unmodified zlib/libpng license, which is an OSI-certified, + * BSD-like license that allows static linking with closed source software: + * + * Copyright 2020 Rob Loach (RobLoach) + * + * This software is provided "as-is", without any express or implied warranty. In no event + * will the authors be held liable for any damages arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, including commercial + * applications, and to alter it and redistribute it freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not claim that you + * wrote the original software. If you use this software in a product, an acknowledgment + * in the product documentation would be appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be misrepresented + * as being the original software. + * + * 3. This notice may not be removed or altered from any source distribution. + */ #ifndef RAYLIB_CPP_INCLUDE_RAYLIB_CPP_HPP_ #define RAYLIB_CPP_INCLUDE_RAYLIB_CPP_HPP_ @@ -73,8 +37,8 @@ #include "./Camera2D.hpp" #include "./Camera3D.hpp" #include "./Color.hpp" -#include "./Functions.hpp" #include "./Font.hpp" +#include "./Functions.hpp" #include "./Gamepad.hpp" #include "./Image.hpp" #include "./Material.hpp" @@ -90,6 +54,7 @@ #include "./RenderTexture.hpp" #include "./Shader.hpp" #include "./Sound.hpp" +#include "./Text.hpp" #include "./Texture.hpp" #include "./Vector2.hpp" #include "./Vector3.hpp" @@ -99,7 +64,7 @@ #include "./Window.hpp" /** - * Provides all the classes associated with raylib-cpp. + * All raylib-cpp classes and functions appear in the raylib namespace. */ namespace raylib { // Nothing. diff --git a/include/raylib.hpp b/include/raylib.hpp index 36e5435..deebef0 100644 --- a/include/raylib.hpp +++ b/include/raylib.hpp @@ -1,27 +1,6 @@ -/* -* LICENSE: zlib/libpng -* -* raylib-cpp is licensed under an unmodified zlib/libpng license, which is an OSI-certified, -* BSD-like license that allows static linking with closed source software: -* -* Copyright (c) 2020 Rob Loach (@RobLoach) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - +/** + * C++ header to wrap raylib.h. + */ #ifndef RAYLIB_CPP_INCLUDE_RAYLIB_HPP_ #define RAYLIB_CPP_INCLUDE_RAYLIB_HPP_ diff --git a/include/raymath.hpp b/include/raymath.hpp index 4e17405..0c1c426 100644 --- a/include/raymath.hpp +++ b/include/raymath.hpp @@ -1,27 +1,6 @@ -/* -* LICENSE: zlib/libpng -* -* raylib-cpp is licensed under an unmodified zlib/libpng license, which is an OSI-certified, -* BSD-like license that allows static linking with closed source software: -* -* Copyright (c) 2020 Rob Loach (@RobLoach) -* -* This software is provided "as-is", without any express or implied warranty. In no event -* will the authors be held liable for any damages arising from the use of this software. -* -* Permission is granted to anyone to use this software for any purpose, including commercial -* applications, and to alter it and redistribute it freely, subject to the following restrictions: -* -* 1. The origin of this software must not be misrepresented; you must not claim that you -* wrote the original software. If you use this software in a product, an acknowledgment -* in the product documentation would be appreciated but is not required. -* -* 2. Altered source versions must be plainly marked as such, and must not be misrepresented -* as being the original software. -* -* 3. This notice may not be removed or altered from any source distribution. -*/ - +/** + * C++ header to wrap raymath.h. + */ #ifndef RAYLIB_CPP_INCLUDE_RAYMATH_HPP_ #define RAYLIB_CPP_INCLUDE_RAYMATH_HPP_ diff --git a/package.json b/package.json index 853e0fd..c92e20b 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "include/Model.hpp", "include/Mouse.hpp", "include/Music.hpp", + "include/physac.hpp", "include/Physics.hpp", "include/RayHitInfo.hpp", "include/Ray.hpp", diff --git a/projects/Doxygen/Doxyfile b/projects/Doxygen/Doxyfile index 7939581..c798fe1 100644 --- a/projects/Doxygen/Doxyfile +++ b/projects/Doxygen/Doxyfile @@ -409,13 +409,13 @@ LOOKUP_CACHE_SIZE = 0 # normally produced when WARNINGS is set to YES. # The default value is: NO. -EXTRACT_ALL = YES +EXTRACT_ALL = NO # If the EXTRACT_PRIVATE tag is set to YES all private members of a class will # be included in the documentation. # The default value is: NO. -EXTRACT_PRIVATE = YES +EXTRACT_PRIVATE = NO # If the EXTRACT_PACKAGE tag is set to YES all members with package or internal # scope will be included in the documentation. @@ -452,7 +452,7 @@ EXTRACT_LOCAL_METHODS = NO # are hidden. # The default value is: NO. -EXTRACT_ANON_NSPACES = YES +EXTRACT_ANON_NSPACES = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all # undocumented members inside documented classes or files. If set to NO these @@ -468,7 +468,7 @@ HIDE_UNDOC_MEMBERS = NO # no effect if EXTRACT_ALL is enabled. # The default value is: NO. -HIDE_UNDOC_CLASSES = NO +HIDE_UNDOC_CLASSES = YES # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend # (class|struct|union) declarations. If set to NO these declarations will be @@ -822,7 +822,7 @@ EXCLUDE_SYMBOLS = # that contain example code fragments that are included (see the \include # command). -EXAMPLE_PATH = +EXAMPLE_PATH = examples # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and @@ -836,7 +836,7 @@ EXAMPLE_PATTERNS = # irrespective of the value of the RECURSIVE tag. # The default value is: NO. -EXAMPLE_RECURSIVE = NO +EXAMPLE_RECURSIVE = YES # The IMAGE_PATH tag can be used to specify one or more files or directories # that contain images that are to be included in the documentation (see the @@ -1961,7 +1961,7 @@ EXPAND_AS_DEFINED = # The default value is: YES. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -SKIP_FUNCTION_MACROS = YES +SKIP_FUNCTION_MACROS = NO #--------------------------------------------------------------------------- # Configuration options related to external references