diff options
author | Phil Jones <philj56@gmail.com> | 2021-11-15 19:37:48 +0000 |
---|---|---|
committer | Phil Jones <philj56@gmail.com> | 2021-11-15 19:37:48 +0000 |
commit | 49c7405b6a88e56bb69e12189adb719927343e07 (patch) | |
tree | 72c7691e746563cc1396c5b555659c813572c12e /src/gl.c | |
parent | 108df42e561b7e81ba09a8c278a562129e651bb6 (diff) |
Multiple smaller changes.
- Remove the background image and libpng dependency
- Add a prompt
- Add xmalloc with out-of-memory handling
- Add beginnings of a rofi-like run cache
Diffstat (limited to 'src/gl.c')
-rw-r--r-- | src/gl.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -5,6 +5,7 @@ #include <string.h> #include "gl.h" #include "log.h" +#include "xmalloc.h" #define max(a, b) ((a) > (b) ? (a) : (b)) @@ -197,7 +198,7 @@ void load_shader(GLuint shader, const char *filename) exit(EXIT_FAILURE); } unsigned long usize = (unsigned long) size; - GLchar *source = malloc(usize + 1); + GLchar *source = xmalloc(usize + 1); rewind(fp); if (fread(source, 1, usize, fp) != usize) { log_error("Failed to load shader %s: %s.\n", @@ -220,7 +221,7 @@ void load_shader(GLuint shader, const char *filename) GLint info_length = 0; glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &info_length); if (info_length > 1) { - char *log = malloc((unsigned)info_length * sizeof(*log)); + char *log = xmalloc((unsigned)info_length * sizeof(*log)); glGetShaderInfoLog(shader, info_length, NULL, log); log_error("\t%s\n", log); free(log); |