mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-21 13:39:18 +02:00
create generic gl::buffer, rebase gl::ubo onto it
This commit is contained in:
44
gl/buffer.h
Normal file
44
gl/buffer.h
Normal file
@@ -0,0 +1,44 @@
|
||||
#pragma once
|
||||
|
||||
#include "object.h"
|
||||
#include "bindable.h"
|
||||
|
||||
namespace gl
|
||||
{
|
||||
class buffer : public object
|
||||
{
|
||||
static GLuint binding_points[13];
|
||||
|
||||
public:
|
||||
enum targets
|
||||
{
|
||||
ARRAY_BUFFER = 0,
|
||||
ATOMIC_COUNTER_BUFFER,
|
||||
COPY_READ_BUFFER,
|
||||
COPY_WRITE_BUFFER,
|
||||
DISPATCH_INDIRECT_BUFFER,
|
||||
DRAW_INDIRECT_BUFFER,
|
||||
ELEMENT_ARRAY_BUFFER,
|
||||
PIXEL_PACK_BUFFER,
|
||||
PIXEL_UNPACK_BUFFER,
|
||||
SHADER_STORAGE_BUFFER,
|
||||
TEXTURE_BUFFER,
|
||||
TRANSFORM_FEEDBACK_BUFFER,
|
||||
UNIFORM_BUFFER
|
||||
};
|
||||
|
||||
private:
|
||||
static GLenum glenum_target(targets target);
|
||||
|
||||
public:
|
||||
buffer();
|
||||
~buffer();
|
||||
|
||||
void bind(targets target);
|
||||
void bind_base(targets target, GLuint index);
|
||||
static void unbind(targets target);
|
||||
|
||||
void allocate(targets target, int size, GLenum hint);
|
||||
void upload(targets target, const void *data, int offset, int size);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user