From 4d47c31567361c0922da34135101505c652c350f Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Thu, 22 Jun 2023 12:26:59 -0400 Subject: [PATCH 1/7] Revert "Revert "Replaced GenImageGradientH / V with GenImageGradientLinear"" --- include/Image.hpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/include/Image.hpp b/include/Image.hpp index 5bc7d087..a6d60d31 100644 --- a/include/Image.hpp +++ b/include/Image.hpp @@ -131,17 +131,10 @@ class Image : public ::Image { } /** - * Generate image: vertical gradient + * Generate image: linear gradient */ - static ::Image GradientV(int width, int height, ::Color top, ::Color bottom) { - return ::GenImageGradientV(width, height, top, bottom); - } - - /** - * Generate image: horizontal gradient - */ - static ::Image GradientH(int width, int height, ::Color left, ::Color right) { - return ::GenImageGradientH(width, height, left, right); + static ::Image GradientLinear(int width, int height, int direction, ::Color start, ::Color end) { + return ::GenImageGradientLinear(width, height, direction, start, end); } /** From 5d86f37fd9be65dec278762e0175e155a73a323d Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Thu, 22 Jun 2023 12:30:52 -0400 Subject: [PATCH 2/7] Update --- CMakeLists.txt | 2 +- examples/CMakeLists.txt | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b2c26eb5..48ba4d6f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.11) set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") project (raylib_cpp - VERSION 4.5.0 + VERSION 4.6.0 DESCRIPTION "raylib-cpp C++ Object Oriented Wrapper for raylib" HOMEPAGE_URL "https://github.com/robloach/raylib-cpp" LANGUAGES C CXX diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 3497a52a..1ec5253c 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -15,7 +15,7 @@ if (NOT raylib_FOUND) FetchContent_Declare( raylib GIT_REPOSITORY https://github.com/raysan5/raylib.git - GIT_TAG 4.5.0 + GIT_TAG 5e1a81555ca130e2c6544add0e2391a8763e7e2a ) FetchContent_GetProperties(raylib) if (NOT raylib_POPULATED) # Have we downloaded raylib yet? diff --git a/package.json b/package.json index f5c549d3..59276e53 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "raylib-cpp", - "version": "4.5.0", + "version": "4.6.0", "description": "raylib-cpp: C++ Object-Oriented Wrapper for raylib", "main": "index.js", "private": true, From 53c99d013981780618bf0a0ff27f6f105c5d1b39 Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Fri, 7 Jul 2023 16:18:26 -0400 Subject: [PATCH 3/7] Update raylib 4.6-dev --- clib.json | 2 +- examples/CMakeLists.txt | 2 +- include/Color.hpp | 21 +++++++++++++++++++++ include/Image.hpp | 15 +++++++++++++++ include/Window.hpp | 16 ++++++++++++++++ include/raylib.hpp | 10 ++++++---- package.json | 2 +- 7 files changed, 61 insertions(+), 7 deletions(-) diff --git a/clib.json b/clib.json index d7992715..3989039c 100644 --- a/clib.json +++ b/clib.json @@ -1,6 +1,6 @@ { "name": "raylib-cpp", - "version": "4.5.1", + "version": "4.6.0-alpha1", "repo": "RobLoach/raylib-cpp", "description": "raylib-cpp: C++ Object-Oriented Wrapper for raylib", "homepage": "https://github.com/robloach/raylib-cpp", diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 1ec5253c..0b32e37e 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -15,7 +15,7 @@ if (NOT raylib_FOUND) FetchContent_Declare( raylib GIT_REPOSITORY https://github.com/raysan5/raylib.git - GIT_TAG 5e1a81555ca130e2c6544add0e2391a8763e7e2a + GIT_TAG 334e96d470c5cb09d154e1c849d04adb721a7a8c ) FetchContent_GetProperties(raylib) if (NOT raylib_POPULATED) # Have we downloaded raylib yet? diff --git a/include/Color.hpp b/include/Color.hpp index 6b84b2f5..5ac76e5b 100644 --- a/include/Color.hpp +++ b/include/Color.hpp @@ -195,6 +195,27 @@ class Color : public ::Color { ::DrawRectangleLinesEx(rec, lineThick, *this); } + /** + * Get color multiplied with another color + */ + inline Color Tint(::Color tint) { + return ::ColorTint(*this, tint); + } + + /** + * Get color with brightness correction, brightness factor goes from -1.0f to 1.0f + */ + inline Color Brightness(float factor) { + return ::ColorBrightness(*this, factor); + } + + /** + * Get color with contrast correction, contrast values between -1.0f and 1.0f + */ + inline Color Contrast(float contrast) { + return ::ColorContrast(*this, contrast); + } + /** * Returns color with alpha applied, alpha goes from 0.0f to 1.0f */ diff --git a/include/Image.hpp b/include/Image.hpp index a6d60d31..55592dd2 100644 --- a/include/Image.hpp +++ b/include/Image.hpp @@ -298,6 +298,13 @@ class Image : public ::Image { } } + /** + * Export image to memory buffer + */ + inline unsigned char* ExportToMemory(const char *fileType, int *fileSize) { + return ::ExportImageToMemory(*this, fileType, fileSize); + } + /** * Export image as code file defining an array of bytes, returns true on success * @@ -477,6 +484,14 @@ class Image : public ::Image { return *this; } + /** + * Rotate image by input angle in degrees (-359 to 359) + */ + inline Image& Rotate(int degrees) { + ::ImageRotate(this, degrees); + return *this; + } + /** * Rotate image clockwise 90deg */ diff --git a/include/Window.hpp b/include/Window.hpp index 2693de63..9faa4cfd 100644 --- a/include/Window.hpp +++ b/include/Window.hpp @@ -222,6 +222,14 @@ class Window { return *this; } + /** + * Set icon for window (multiple images, RGBA 32bit, only PLATFORM_DESKTOP) + */ + inline Window& SetIcons(Image* images, int count) { + ::SetWindowIcons(images, count); + return *this; + } + /** * Set title for window */ @@ -285,6 +293,14 @@ class Window { return *this; } + /** + * Set window focused (only PLATFORM_DESKTOP) + */ + inline Window& SetFocused() { + ::SetWindowFocused(); + return *this; + } + /** * Set window dimensions */ diff --git a/include/raylib.hpp b/include/raylib.hpp index 38b38ff1..87c50fb3 100644 --- a/include/raylib.hpp +++ b/include/raylib.hpp @@ -14,12 +14,14 @@ extern "C" { #include RAYLIB_H_FILE // NOLINT -#if !defined(RAYLIB_VERSION_MAJOR) || !defined(RAYLIB_VERSION_MINOR) || RAYLIB_VERSION_MAJOR < 4 || RAYLIB_VERSION_MINOR < 5 -#error "raylib-cpp requires at least raylib 4.5.0" +#if !defined(RAYLIB_VERSION_MAJOR) || !defined(RAYLIB_VERSION_MINOR) +#if RAYLIB_VERSION_MAJOR < 4 || RAYLIB_VERSION_MINOR < 6 +#error "raylib-cpp requires at least raylib 4.6.0" +#endif #endif -#if RAYLIB_VERSION_MINOR > 5 -#error "raylib-cpp targets raylib 4.5. Use the `next` branch for the next version of raylib." +#if RAYLIB_VERSION_MINOR > 6 +#error "raylib-cpp targets raylib 4.6. Use the `next` branch for the next version of raylib." #endif #ifdef __cplusplus diff --git a/package.json b/package.json index 49f9e600..118a58b0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "raylib-cpp - "version": "4.6.0", + "version": "4.6.0-alpha1", "description": "raylib-cpp: C++ Object-Oriented Wrapper for raylib", "main": "index.js", "private": true, From f949c9ba9ceba971f9d1214182b0d082eed444d7 Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Mon, 10 Jul 2023 00:11:46 -0400 Subject: [PATCH 4/7] Update raylib badge to 4.6 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b2b317ca..522ce26d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![raylib-cpp Logo](projects/Doxygen/raylib-cpp_256x256.png) -# raylib-cpp ![Targeting raylib 4.5](https://img.shields.io/badge/for_raylib-4.5-blue) [![Tests](https://github.com/RobLoach/raylib-cpp/workflows/Tests/badge.svg)](https://github.com/RobLoach/raylib-cpp/actions?query=workflow%3ATests+branch%3Amaster) [![License](https://img.shields.io/badge/license-zlib%2Flibpng-blue.svg)](LICENSE) +# raylib-cpp ![Targeting raylib 4.6](https://img.shields.io/badge/for_raylib-4.5-blue) [![Tests](https://github.com/RobLoach/raylib-cpp/workflows/Tests/badge.svg)](https://github.com/RobLoach/raylib-cpp/actions?query=workflow%3ATests+branch%3Amaster) [![License](https://img.shields.io/badge/license-zlib%2Flibpng-blue.svg)](LICENSE) [raylib-cpp](https://github.com/robloach/raylib-cpp) is a C++ wrapper library for [raylib](https://www.raylib.com), a simple and easy-to-use library to enjoy videogames programming. This C++ header provides object-oriented wrappers around *raylib*'s struct interfaces. *raylib-cpp* is not required to use *raylib* in C++, but the classes do bring using the raylib API more inline with C++'s language paradigm. From 8b346fe879fe547340a4614231143d884ddd0e61 Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Mon, 10 Jul 2023 00:19:13 -0400 Subject: [PATCH 5/7] Fix package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 118a58b0..336f1305 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "raylib-cpp + "name": "raylib-cpp", "version": "4.6.0-alpha1", "description": "raylib-cpp: C++ Object-Oriented Wrapper for raylib", "main": "index.js", From a8bf1908434f4fb932964bdf07ac91ac804df7ce Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Sat, 18 Nov 2023 12:41:21 -0600 Subject: [PATCH 6/7] Fix build --- include/ModelAnimation.hpp | 2 +- include/Vector2.hpp | 11 ----------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/include/ModelAnimation.hpp b/include/ModelAnimation.hpp index d90b6d6e..ccc5a052 100644 --- a/include/ModelAnimation.hpp +++ b/include/ModelAnimation.hpp @@ -37,7 +37,7 @@ class ModelAnimation : public ::ModelAnimation { * Load model animations from file */ static std::vector Load(const std::string& fileName) { - unsigned int count = 0; + int count = 0; ::ModelAnimation* modelAnimations = ::LoadModelAnimations(fileName.c_str(), &count); std::vector mats(modelAnimations, modelAnimations + count); diff --git a/include/Vector2.hpp b/include/Vector2.hpp index 3085caf5..182014b9 100644 --- a/include/Vector2.hpp +++ b/include/Vector2.hpp @@ -354,17 +354,6 @@ class Vector2 : public ::Vector2 { ::DrawLineBezier(*this, endPos, thick, color); } - /** - * Draw line using quadratic bezier curves with a control point. - */ - inline void DrawLineBezierQuad( - ::Vector2 endPos, - ::Vector2 controlPos, - float thick, - ::Color color = {0, 0, 0, 255}) const { - ::DrawLineBezierQuad(*this, endPos, controlPos, thick, color); - } - /** * Draw a color-filled circle (Vector version) */ From 6f4de62b9105997ab29e0c0cd2a89180d5d4bdcc Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Sat, 18 Nov 2023 12:43:17 -0600 Subject: [PATCH 7/7] Update documentation --- README.md | 2 +- projects/CMake/CMakeLists.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7d302b2c..70566007 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![raylib-cpp Logo](projects/Doxygen/raylib-cpp_256x256.png) -# raylib-cpp ![Targeting raylib 4.6](https://img.shields.io/badge/for_raylib-4.6-blue) [![Tests](https://github.com/RobLoach/raylib-cpp/workflows/Tests/badge.svg)](https://github.com/RobLoach/raylib-cpp/actions?query=workflow%3ATests+branch%3Amaster) [![License](https://img.shields.io/badge/license-zlib%2Flibpng-blue.svg)](LICENSE) +# raylib-cpp ![Targeting raylib 5.0](https://img.shields.io/badge/for_raylib-5.0-blue) [![Tests](https://github.com/RobLoach/raylib-cpp/workflows/Tests/badge.svg)](https://github.com/RobLoach/raylib-cpp/actions?query=workflow%3ATests+branch%3Amaster) [![License](https://img.shields.io/badge/license-zlib%2Flibpng-blue.svg)](LICENSE) [raylib-cpp](https://github.com/robloach/raylib-cpp) is a C++ wrapper library for [raylib](https://www.raylib.com), a simple and easy-to-use library to enjoy videogames programming. This C++ header provides object-oriented wrappers around *raylib*'s struct interfaces. *raylib-cpp* is not required to use *raylib* in C++, but the classes do bring using the raylib API more inline with C++'s language paradigm. diff --git a/projects/CMake/CMakeLists.txt b/projects/CMake/CMakeLists.txt index 03db0b70..5ff75385 100644 --- a/projects/CMake/CMakeLists.txt +++ b/projects/CMake/CMakeLists.txt @@ -8,7 +8,7 @@ if (NOT raylib_FOUND) FetchContent_Declare( raylib GIT_REPOSITORY https://github.com/raysan5/raylib.git - GIT_TAG 4.5.0 + GIT_TAG 5.0 ) FetchContent_MakeAvailable(raylib) endif() @@ -20,7 +20,7 @@ if (NOT raylib_cpp_FOUND) FetchContent_Declare( raylib_cpp GIT_REPOSITORY https://github.com/RobLoach/raylib-cpp.git - GIT_TAG v4.5.1 + GIT_TAG v5.0.0 ) FetchContent_MakeAvailable(raylib_cpp) endif()