SetActiveView

This commit is contained in:
Krzosa Karol
2024-07-30 07:31:51 +02:00
parent 7df09a9ebd
commit 111781dc71
5 changed files with 32 additions and 18 deletions

View File

@@ -713,6 +713,11 @@ CircularArray<T> MakeCircularArray(Allocator allocator, int size) {
template <class T>
void Add(CircularArray<T> *arr, T item) {
if (arr->cap == 0) {
arr->allocator = GetSystemAllocator();
arr->cap = 128;
arr->data = AllocArray(arr->allocator, T, arr->cap);
}
int idx = arr->write;
arr->write = (arr->write + 1) % arr->cap;
if (arr->write == 0) arr->buffer_is_full = 1;