Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 23 additions & 10 deletions include/AutomationEventList.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,18 @@ class AutomationEventList : public ::AutomationEventList {
set(automationEventList);
}

AutomationEventList(unsigned int capacity = 16384,
unsigned int count = 0,
AutomationEvent *events = nullptr) : ::AutomationEventList{capacity, count, events} {
// Nothing.
/**
* Load an empty automation events list.
*/
AutomationEventList() {
set(::LoadAutomationEventList(0));
}

/**
* Load automation events list from file.
*
* @param fileName The file path to load the automation events list from.
*/
AutomationEventList(const char* fileName) {
Load(fileName);
}
Expand Down Expand Up @@ -82,12 +88,19 @@ class AutomationEventList : public ::AutomationEventList {
* Update audio stream buffers with data
*/
void Unload() {
#if RAYLIB_VERSION_MAJOR >= 5
#if RAYLIB_VERSION_MINOR == 0
::UnloadAutomationEventList(this);
#elif RAYLIB_VERSION_MINOR >= 1
::UnloadAutomationEventList(*this);
#endif
if (!IsReady()) {
return;
}

// The function signature of UnloadAutomationEventList() changes from raylib 5.0.
#if RAYLIB_VERSION_MAJOR == 5
#if RAYLIB_VERSION_MINOR == 0
::UnloadAutomationEventList(this);
#elif RAYLIB_VERSION_MINOR >= 1
::UnloadAutomationEventList(*this);
#endif
#else
::UnloadAutomationEventList(*this);
#endif
}

Expand Down
8 changes: 5 additions & 3 deletions include/raylib.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ extern "C" {
#include RAYLIB_H_FILE // NOLINT

#if !defined(RAYLIB_VERSION_MAJOR) || !defined(RAYLIB_VERSION_MINOR)
#if RAYLIB_VERSION_MAJOR < 5
#error "raylib-cpp requires at least raylib 5.0.0"
#error "raylib-cpp requires raylib >= 5"
#endif

#if RAYLIB_VERSION_MAJOR < 5
#error "raylib-cpp requires raylib >= 5"
#endif

#if RAYLIB_VERSION_MAJOR > 5
#error "raylib-cpp targets raylib 5. Use the `next` branch for the next version of raylib."
#error "raylib-cpp requires raylib ~5.0. Use the `next` branch for the next version of raylib."
#endif

#ifdef __cplusplus
Expand Down