22 using namespace GLFFT;
45 GL_CHECK(glTexStorage2D(GL_TEXTURE_2D, levels, internal_format, width, height));
46 GL_CHECK(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, wrap_s));
47 GL_CHECK(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrap_t));
48 GL_CHECK(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, min_filter));
49 GL_CHECK(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, mag_filter));
50 GL_CHECK(glBindTexture(GL_TEXTURE_2D, 0));
54 unsigned x_off,
unsigned y_off,
unsigned width,
unsigned height)
58 throw logic_error(
"Cannot upload to null-texture.");
60 GL_CHECK(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0));
62 GL_CHECK(glTexSubImage2D(GL_TEXTURE_2D, 0, x_off, y_off, width, height, format, type, data));
63 GL_CHECK(glBindTexture(GL_TEXTURE_2D, 0));
105 GL_CHECK(glBufferData(GL_SHADER_STORAGE_BUFFER, size, data, access));
Buffer & operator=(Buffer &&buffer)
GLint GLsizei GLsizei height
void upload(const void *data, GLenum format, GLenum type, unsigned x_off, unsigned y_off, unsigned width, unsigned height)
void init(unsigned width, unsigned height, unsigned levels, GLenum internal_format, GLenum wrap_s=GL_REPEAT, GLenum wrap_t=GL_REPEAT, GLenum min_filter=GL_NEAREST, GLenum mag_filter=GL_NEAREST)
GLint GLsizei GLsizei GLenum format
Texture & operator=(Texture &&texture)
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
Program & operator=(Program &&prog)
void init(const void *data, size_t size, GLenum access)
GLenum GLuint GLintptr GLsizeiptr size
typedef GLenum(GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSKHRPROC)(void)
typedef GLuint(GL_APIENTRYP PFNGLGETDEBUGMESSAGELOGKHRPROC)(GLuint count