2022-10-03 18:51:34 +05:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "context.hpp"
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
|
|
|
|
namespace hpr::gpu
|
|
|
|
{
|
|
|
|
|
|
|
|
class Buffer : public Context
|
|
|
|
{
|
2022-10-05 21:10:51 +05:00
|
|
|
friend class Device;
|
2022-10-03 18:51:34 +05:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
enum class BufferType
|
|
|
|
{
|
|
|
|
Undefined,
|
|
|
|
Vertex,
|
|
|
|
Index,
|
2022-11-18 21:50:49 +05:00
|
|
|
Uniform,
|
2022-10-03 18:51:34 +05:00
|
|
|
BufferTypeCount
|
|
|
|
};
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
BufferType p_type;
|
|
|
|
int p_size;
|
|
|
|
int p_stride;
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
// Constructors
|
|
|
|
|
|
|
|
Buffer();
|
|
|
|
|
2022-11-18 21:50:49 +05:00
|
|
|
explicit
|
2022-10-03 18:51:34 +05:00
|
|
|
Buffer(DeviceAPI api);
|
|
|
|
|
2022-11-18 21:50:49 +05:00
|
|
|
~Buffer() override;
|
2022-10-03 18:51:34 +05:00
|
|
|
|
|
|
|
// Member functions
|
|
|
|
|
2022-11-18 21:50:49 +05:00
|
|
|
[[nodiscard]]
|
2022-10-05 21:10:51 +05:00
|
|
|
int size() const;
|
2022-10-03 18:51:34 +05:00
|
|
|
|
2022-11-18 21:50:49 +05:00
|
|
|
[[nodiscard]]
|
2022-10-05 21:10:51 +05:00
|
|
|
BufferType type() const;
|
2022-10-03 18:51:34 +05:00
|
|
|
};
|
|
|
|
|
|
|
|
} // end namespace hpr::gpu
|