Pyrogenesis
HEAD
Pyrogenesis, a RTS Engine
Buffer.h
Go to the documentation of this file.
1
/* Copyright (C) 2024 Wildfire Games.
2
* This file is part of 0 A.D.
3
*
4
* 0 A.D. is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation, either version 2 of the License, or
7
* (at your option) any later version.
8
*
9
* 0 A.D. is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
16
*/
17
18
#ifndef INCLUDED_RENDERER_BACKEND_GL_BUFFER
19
#define INCLUDED_RENDERER_BACKEND_GL_BUFFER
20
21
#include "
lib/ogl.h
"
22
#include "
renderer/backend/IBuffer.h
"
23
24
#include <cstdint>
25
#include <memory>
26
27
namespace
Renderer
28
{
29
30
namespace
Backend
31
{
32
33
namespace
GL
34
{
35
36
class
CDevice;
37
38
class
CBuffer
final :
public
IBuffer
39
{
40
public
:
41
~CBuffer
()
override
;
42
43
IDevice
*
GetDevice
()
override
;
44
45
Type
GetType
()
const override
{
return
m_Type
; }
46
uint32_t
GetSize
()
const override
{
return
m_Size
; }
47
uint32_t
GetUsage
()
const override
{
return
m_Usage
; }
48
49
GLuint
GetHandle
() {
return
m_Handle
; }
50
51
private
:
52
friend
class
CDevice
;
53
54
static
std::unique_ptr<CBuffer>
Create
(
55
CDevice
* device,
const
char
* name,
56
const
Type
type,
const
uint32_t
size,
const
uint32_t
usage);
57
58
CBuffer
();
59
60
CDevice
*
m_Device
=
nullptr
;
61
Type
m_Type
=
Type::VERTEX
;
62
uint32_t
m_Size
= 0;
63
uint32_t
m_Usage
= 0;
64
65
GLuint
m_Handle
= 0;
66
};
67
68
}
// namespace GL
69
70
}
// namespace Backend
71
72
}
// namespace Renderer
73
74
#endif
// INCLUDED_RENDERER_BACKEND_GL_BUFFER
IBuffer.h
Renderer::Backend::GL::CBuffer
Definition:
Buffer.h:39
Renderer::Backend::GL::CBuffer::~CBuffer
~CBuffer() override
Definition:
Buffer.cpp:67
Renderer::Backend::GL::CBuffer::m_Handle
GLuint m_Handle
Definition:
Buffer.h:65
Renderer::Backend::GL::CBuffer::GetType
Type GetType() const override
Definition:
Buffer.h:45
Renderer::Backend::GL::CBuffer::GetHandle
GLuint GetHandle()
Definition:
Buffer.h:49
Renderer::Backend::GL::CBuffer::m_Usage
uint32_t m_Usage
Definition:
Buffer.h:63
Renderer::Backend::GL::CBuffer::CBuffer
CBuffer()
Renderer::Backend::GL::CBuffer::m_Size
uint32_t m_Size
Definition:
Buffer.h:62
Renderer::Backend::GL::CBuffer::GetUsage
uint32_t GetUsage() const override
Definition:
Buffer.h:47
Renderer::Backend::GL::CBuffer::Create
static std::unique_ptr< CBuffer > Create(CDevice *device, const char *name, const Type type, const uint32_t size, const uint32_t usage)
Definition:
Buffer.cpp:39
Renderer::Backend::GL::CBuffer::m_Type
Type m_Type
Definition:
Buffer.h:61
Renderer::Backend::GL::CBuffer::GetDevice
IDevice * GetDevice() override
Definition:
Buffer.cpp:73
Renderer::Backend::GL::CBuffer::GetSize
uint32_t GetSize() const override
Definition:
Buffer.h:46
Renderer::Backend::GL::CBuffer::m_Device
CDevice * m_Device
Definition:
Buffer.h:60
Renderer::Backend::GL::CDevice
Definition:
Device.h:51
Renderer::Backend::IBuffer
Definition:
IBuffer.h:32
Renderer::Backend::IBuffer::Type
Type
Definition:
IBuffer.h:35
Renderer::Backend::IBuffer::Type::VERTEX
@ VERTEX
Renderer::Backend::IDevice
Definition:
IDevice.h:48
Renderer::Backend::Backend
Backend
Definition:
Backend.h:28
Renderer::Backend::Backend::GL
@ GL
Renderer
Definition:
VideoMode.h:29
ogl.h
uint32_t
unsigned int uint32_t
Definition:
wposix_types.h:53
source
renderer
backend
gl
Buffer.h
Generated by
1.9.4