Aeon Engine c550894
AeonGames Open Source Game Engine
Loading...
Searching...
No Matches
OpenGLMemoryPoolBuffer.hpp
1/*
2Copyright (C) 2019,2021,2025,2026 Rodrigo Jose Hernandez Cordoba
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16#ifndef AEONGAMES_OPENGLMEMORYPOOLBUFFER_HPP
17#define AEONGAMES_OPENGLMEMORYPOOLBUFFER_HPP
18#include <cstdint>
19#include <string>
20#include <vector>
21#include <tuple>
22#include <initializer_list>
23#include "OpenGLFunctions.hpp"
24#include "OpenGLBuffer.hpp"
25#include "aeongames/MemoryPoolBuffer.hpp"
26
27namespace AeonGames
28{
29 class OpenGLRenderer;
32 {
33 public:
35 OpenGLMemoryPoolBuffer ( const OpenGLRenderer& aOpenGLRenderer, GLsizei aStackSize );
37 OpenGLMemoryPoolBuffer ( const OpenGLRenderer& aOpenGLRenderer );
41 OpenGLMemoryPoolBuffer& operator= ( const OpenGLMemoryPoolBuffer& ) = delete;
42 OpenGLMemoryPoolBuffer& operator = ( OpenGLMemoryPoolBuffer&& ) = delete;
44 BufferAccessor Allocate ( size_t aSize ) final;
45 void Reset() final;
46 const Buffer & GetBuffer() const final;
48 void Initialize ( GLsizei aStackSize );
50 void Finalize();
51 private:
52 const OpenGLRenderer& mOpenGLRenderer;
53 size_t mOffset{0};
54 OpenGLBuffer mUniformBuffer;
55 };
56}
57#endif
Provides access to a region within a memory pool buffer.
Abstract interface for GPU/memory buffer operations.
Definition Buffer.hpp:24
Abstract interface for a pool-based buffer allocator.
OpenGL GPU buffer wrapper implementing the Buffer interface.
void Reset() final
Reset the pool, freeing all previous allocations.
void Initialize(GLsizei aStackSize)
Initialize the pool buffer with the given size.
const Buffer & GetBuffer() const final
Get a reference to the underlying Buffer.
BufferAccessor Allocate(size_t aSize) final
Allocate a sub-region from the memory pool.
void Finalize()
Release pool buffer resources.
OpenGLMemoryPoolBuffer(const OpenGLRenderer &aOpenGLRenderer, GLsizei aStackSize)
Construct with a renderer and initial pool size.
OpenGL rendering backend implementing the Renderer interface.
<- This is here just for the literals
Definition AABB.hpp:31