mirror of
https://github.com/allankoechke/raylib-cpp.git
synced 2026-12-01 17:29:38 +00:00
Merge pull request #319 from RobLoach/versions
Update AutomationEventList usage
This commit is contained in:
@@ -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);
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user