moved some stuff around to avoid code duplication and finish up gl 2D texture code

This commit is contained in:
jp9000
2013-10-05 00:34:43 -07:00
parent 9f0b7f25f6
commit 5c92f22f0d
6 changed files with 94 additions and 38 deletions

View File

@@ -24,7 +24,7 @@
* make a bunch of helper functions to make it a bit easier to handle errors
*/
static inline bool gl_error_occurred(const char *funcname)
static inline bool gl_success(const char *funcname)
{
GLenum errorcode = glGetError();
if (errorcode != GL_NO_ERROR) {
@@ -39,13 +39,13 @@ static inline bool gl_error_occurred(const char *funcname)
static inline bool gl_gen_textures(GLsizei num_texture, GLuint *textures)
{
glGenTextures(num_texture, textures);
return gl_error_occurred("glGenTextures");
return gl_success("glGenTextures");
}
static inline bool gl_bind_texture(GLenum target, GLuint texture)
{
glBindTexture(target, texture);
return gl_error_occurred("glBindTexture");
return gl_success("glBindTexture");
}
#endif