Skip to content

Commit 34748eb

Browse files
authored
Merge pull request #265 from RobLoach/update-5.0.0
Update to raylib 5.0.0
2 parents 7d2ce8f + 6f4de62 commit 34748eb

File tree

12 files changed

+77
-33
lines changed

12 files changed

+77
-33
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.11)
22
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
33
project (raylib_cpp
4-
VERSION 4.5.2
4+
VERSION 5.0.0
55
DESCRIPTION "raylib-cpp C++ Object Oriented Wrapper for raylib"
66
HOMEPAGE_URL "https://github.com/robloach/raylib-cpp"
77
LANGUAGES C CXX

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![raylib-cpp Logo](projects/Doxygen/raylib-cpp_256x256.png)
22

3-
# raylib-cpp [![Targeting raylib 4.5](https://img.shields.io/badge/for_raylib-4.5-blue)](https://raylib.com) [![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)
3+
# 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)
44

55
[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.
66

clib.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "raylib-cpp",
3-
"version": "4.5.2",
3+
"version": "5.0.0-alpha1",
44
"repo": "RobLoach/raylib-cpp",
55
"description": "raylib-cpp: C++ Object-Oriented Wrapper for raylib",
66
"homepage": "https://github.com/robloach/raylib-cpp",

examples/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ if (NOT raylib_FOUND)
1515
FetchContent_Declare(
1616
raylib
1717
GIT_REPOSITORY https://github.com/raysan5/raylib.git
18-
GIT_TAG 4.5.0
18+
GIT_TAG ae50bfa2cc569c0f8d5bc4315d39db64005b1b08
1919
)
2020
FetchContent_GetProperties(raylib)
2121
if (NOT raylib_POPULATED) # Have we downloaded raylib yet?

include/Color.hpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,27 @@ class Color : public ::Color {
203203
::DrawRectangleLinesEx(rec, lineThick, *this);
204204
}
205205

206+
/**
207+
* Get color multiplied with another color
208+
*/
209+
inline Color Tint(::Color tint) {
210+
return ::ColorTint(*this, tint);
211+
}
212+
213+
/**
214+
* Get color with brightness correction, brightness factor goes from -1.0f to 1.0f
215+
*/
216+
inline Color Brightness(float factor) {
217+
return ::ColorBrightness(*this, factor);
218+
}
219+
220+
/**
221+
* Get color with contrast correction, contrast values between -1.0f and 1.0f
222+
*/
223+
inline Color Contrast(float contrast) {
224+
return ::ColorContrast(*this, contrast);
225+
}
226+
206227
/**
207228
* Returns color with alpha applied, alpha goes from 0.0f to 1.0f
208229
*/

include/Image.hpp

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -131,17 +131,10 @@ class Image : public ::Image {
131131
}
132132

133133
/**
134-
* Generate image: vertical gradient
134+
* Generate image: linear gradient
135135
*/
136-
static ::Image GradientV(int width, int height, ::Color top, ::Color bottom) {
137-
return ::GenImageGradientV(width, height, top, bottom);
138-
}
139-
140-
/**
141-
* Generate image: horizontal gradient
142-
*/
143-
static ::Image GradientH(int width, int height, ::Color left, ::Color right) {
144-
return ::GenImageGradientH(width, height, left, right);
136+
static ::Image GradientLinear(int width, int height, int direction, ::Color start, ::Color end) {
137+
return ::GenImageGradientLinear(width, height, direction, start, end);
145138
}
146139

147140
/**
@@ -305,6 +298,13 @@ class Image : public ::Image {
305298
}
306299
}
307300

301+
/**
302+
* Export image to memory buffer
303+
*/
304+
inline unsigned char* ExportToMemory(const char *fileType, int *fileSize) {
305+
return ::ExportImageToMemory(*this, fileType, fileSize);
306+
}
307+
308308
/**
309309
* Export image as code file defining an array of bytes, returns true on success
310310
*
@@ -484,6 +484,14 @@ class Image : public ::Image {
484484
return *this;
485485
}
486486

487+
/**
488+
* Rotate image by input angle in degrees (-359 to 359)
489+
*/
490+
inline Image& Rotate(int degrees) {
491+
::ImageRotate(this, degrees);
492+
return *this;
493+
}
494+
487495
/**
488496
* Rotate image clockwise 90deg
489497
*/

include/ModelAnimation.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class ModelAnimation : public ::ModelAnimation {
3737
* Load model animations from file
3838
*/
3939
static std::vector<ModelAnimation> Load(const std::string& fileName) {
40-
unsigned int count = 0;
40+
int count = 0;
4141
::ModelAnimation* modelAnimations = ::LoadModelAnimations(fileName.c_str(), &count);
4242
std::vector<ModelAnimation> mats(modelAnimations, modelAnimations + count);
4343

include/Vector2.hpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -354,17 +354,6 @@ class Vector2 : public ::Vector2 {
354354
::DrawLineBezier(*this, endPos, thick, color);
355355
}
356356

357-
/**
358-
* Draw line using quadratic bezier curves with a control point.
359-
*/
360-
inline void DrawLineBezierQuad(
361-
::Vector2 endPos,
362-
::Vector2 controlPos,
363-
float thick,
364-
::Color color = {0, 0, 0, 255}) const {
365-
::DrawLineBezierQuad(*this, endPos, controlPos, thick, color);
366-
}
367-
368357
/**
369358
* Draw a color-filled circle (Vector version)
370359
*/

include/Window.hpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,14 @@ class Window {
190190
return *this;
191191
}
192192

193+
/**
194+
* Toggle window state: borderless/windowed
195+
*/
196+
inline Window& ToggleBorderless() {
197+
::ToggleBorderlessWindowed();
198+
return *this;
199+
}
200+
193201
/**
194202
* Set window state: maximized, if resizable (only PLATFORM_DESKTOP)
195203
*/
@@ -222,6 +230,14 @@ class Window {
222230
return *this;
223231
}
224232

233+
/**
234+
* Set icon for window (multiple images, RGBA 32bit, only PLATFORM_DESKTOP)
235+
*/
236+
inline Window& SetIcons(Image* images, int count) {
237+
::SetWindowIcons(images, count);
238+
return *this;
239+
}
240+
225241
/**
226242
* Set title for window
227243
*/
@@ -285,6 +301,14 @@ class Window {
285301
return *this;
286302
}
287303

304+
/**
305+
* Set window focused (only PLATFORM_DESKTOP)
306+
*/
307+
inline Window& SetFocused() {
308+
::SetWindowFocused();
309+
return *this;
310+
}
311+
288312
/**
289313
* Set window dimensions
290314
*/

include/raylib.hpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ extern "C" {
1414

1515
#include RAYLIB_H_FILE // NOLINT
1616

17-
#if !defined(RAYLIB_VERSION_MAJOR) || !defined(RAYLIB_VERSION_MINOR) || RAYLIB_VERSION_MAJOR < 4 || RAYLIB_VERSION_MINOR < 5
18-
#error "raylib-cpp requires at least raylib 4.5.0"
17+
#if !defined(RAYLIB_VERSION_MAJOR) || !defined(RAYLIB_VERSION_MINOR)
18+
#if RAYLIB_VERSION_MAJOR < 5
19+
#error "raylib-cpp requires at least raylib 5.0.0"
20+
#endif
1921
#endif
2022

21-
#if RAYLIB_VERSION_MINOR > 5
22-
#error "raylib-cpp targets raylib 4.5. Use the `next` branch for the next version of raylib."
23+
#if RAYLIB_VERSION_MAJOR > 5
24+
#error "raylib-cpp targets raylib 5. Use the `next` branch for the next version of raylib."
2325
#endif
2426

2527
#ifdef __cplusplus

0 commit comments

Comments
 (0)