moved some stuff around to avoid code duplication and finish up gl 2D texture code
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user