mirror of
https://github.com/MadeOfJelly/MushMachine.git
synced 2025-07-14 04:56:46 +02:00
initial import, >900commits predate this
This commit is contained in:
35
framework/opengl_primitives/src/mm/opengl/buffer.hpp
Normal file
35
framework/opengl_primitives/src/mm/opengl/buffer.hpp
Normal file
@ -0,0 +1,35 @@
|
||||
//
|
||||
// Created by FlaXxy on 21.05.2018.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef MM_OPENGL_3_GLES
|
||||
#include <GLES3/gl3.h>
|
||||
#else
|
||||
#include <glad/glad.h>
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstddef> // size_t
|
||||
|
||||
namespace MM::OpenGL {
|
||||
/**
|
||||
* A fixed size buffer
|
||||
*/
|
||||
class Buffer {
|
||||
private:
|
||||
GLuint _handle = 0;
|
||||
std::size_t _size = 0;
|
||||
|
||||
public:
|
||||
Buffer(const void* data, std::size_t size, GLenum usage);
|
||||
~Buffer(void);
|
||||
|
||||
void bind(GLenum target) const;
|
||||
void unbind(GLenum target) const;
|
||||
|
||||
std::size_t getSize(void) const;
|
||||
};
|
||||
} // MM::OpenGL
|
||||
|
Reference in New Issue
Block a user