diff --git a/glslUtil/glslUtil.c b/glslUtil/glslUtil.c index 16274e1..8fca69d 100644 --- a/glslUtil/glslUtil.c +++ b/glslUtil/glslUtil.c @@ -263,3 +263,12 @@ cleanup_shader: out: return 0; } + +GLuint guMakeBuffer(GLenum target, GLenum usage, const void *ptr, size_t sz) +{ + GLuint id; + glGenBuffers(1, &id); + glBindBuffer(target, id); + glBufferData(target, sz, ptr, usage); + return id; +} diff --git a/glslUtil/glslUtil.h b/glslUtil/glslUtil.h index 90390fd..2fc0a70 100644 --- a/glslUtil/glslUtil.h +++ b/glslUtil/glslUtil.h @@ -34,6 +34,7 @@ char *guGetShaderLog(GLuint id); char *guGetProgramLog(GLuint id); GLuint guMakeShaderFromFile(GLenum shaderType, const char *fname); GLuint guMakeShader(GLenum shaderType, const char *source); +GLuint guMakeBuffer(GLenum target, GLenum usage, const void *ptr, size_t sz); #ifdef __cplusplus }