mirror of
https://github.com/allankoechke/raylib-cpp.git
synced 2026-11-30 17:19:27 +00:00
Merge pull request #265 from RobLoach/update-5.0.0
Update to raylib 5.0.0
This commit is contained in:
@@ -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.2
|
||||
VERSION 5.0.0
|
||||
DESCRIPTION "raylib-cpp C++ Object Oriented Wrapper for raylib"
|
||||
HOMEPAGE_URL "https://github.com/robloach/raylib-cpp"
|
||||
LANGUAGES C CXX
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||

|
||||
|
||||
# raylib-cpp [](https://raylib.com) [](https://github.com/RobLoach/raylib-cpp/actions?query=workflow%3ATests+branch%3Amaster) [](LICENSE)
|
||||
# raylib-cpp  [](https://github.com/RobLoach/raylib-cpp/actions?query=workflow%3ATests+branch%3Amaster) [](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.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "raylib-cpp",
|
||||
"version": "4.5.2",
|
||||
"version": "5.0.0-alpha1",
|
||||
"repo": "RobLoach/raylib-cpp",
|
||||
"description": "raylib-cpp: C++ Object-Oriented Wrapper for raylib",
|
||||
"homepage": "https://github.com/robloach/raylib-cpp",
|
||||
|
||||
@@ -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 ae50bfa2cc569c0f8d5bc4315d39db64005b1b08
|
||||
)
|
||||
FetchContent_GetProperties(raylib)
|
||||
if (NOT raylib_POPULATED) # Have we downloaded raylib yet?
|
||||
|
||||
@@ -203,6 +203,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
|
||||
*/
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -305,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
|
||||
*
|
||||
@@ -484,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
|
||||
*/
|
||||
|
||||
@@ -37,7 +37,7 @@ class ModelAnimation : public ::ModelAnimation {
|
||||
* Load model animations from file
|
||||
*/
|
||||
static std::vector<ModelAnimation> Load(const std::string& fileName) {
|
||||
unsigned int count = 0;
|
||||
int count = 0;
|
||||
::ModelAnimation* modelAnimations = ::LoadModelAnimations(fileName.c_str(), &count);
|
||||
std::vector<ModelAnimation> mats(modelAnimations, modelAnimations + count);
|
||||
|
||||
|
||||
@@ -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)
|
||||
*/
|
||||
|
||||
@@ -190,6 +190,14 @@ class Window {
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle window state: borderless/windowed
|
||||
*/
|
||||
inline Window& ToggleBorderless() {
|
||||
::ToggleBorderlessWindowed();
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set window state: maximized, if resizable (only PLATFORM_DESKTOP)
|
||||
*/
|
||||
@@ -222,6 +230,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 +301,14 @@ class Window {
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set window focused (only PLATFORM_DESKTOP)
|
||||
*/
|
||||
inline Window& SetFocused() {
|
||||
::SetWindowFocused();
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set window dimensions
|
||||
*/
|
||||
|
||||
@@ -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 < 5
|
||||
#error "raylib-cpp requires at least raylib 5.0.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_MAJOR > 5
|
||||
#error "raylib-cpp targets raylib 5. Use the `next` branch for the next version of raylib."
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "raylib-cpp",
|
||||
"version": "4.5.2",
|
||||
"version": "5.0.0-alpha1",
|
||||
"description": "raylib-cpp: C++ Object-Oriented Wrapper for raylib",
|
||||
"main": "index.js",
|
||||
"private": true,
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user