add guMakeBuffer()

This commit is contained in:
Josh Holtrop 2011-05-09 17:33:45 -04:00
parent c51606772f
commit 6ad367812b
2 changed files with 10 additions and 0 deletions

View File

@ -263,3 +263,12 @@ cleanup_shader:
out: out:
return 0; 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;
}

View File

@ -34,6 +34,7 @@ char *guGetShaderLog(GLuint id);
char *guGetProgramLog(GLuint id); char *guGetProgramLog(GLuint id);
GLuint guMakeShaderFromFile(GLenum shaderType, const char *fname); GLuint guMakeShaderFromFile(GLenum shaderType, const char *fname);
GLuint guMakeShader(GLenum shaderType, const char *source); GLuint guMakeShader(GLenum shaderType, const char *source);
GLuint guMakeBuffer(GLenum target, GLenum usage, const void *ptr, size_t sz);
#ifdef __cplusplus #ifdef __cplusplus
} }