50 GLuint id = glCreateShader(type); |
50 GLuint id = glCreateShader(type); |
51 if (id == 0) { |
51 if (id == 0) { |
52 asc_error("glCreateShader failed: %s", glGetError()); |
52 asc_error("glCreateShader failed: %s", glGetError()); |
53 return 0; |
53 return 0; |
54 } |
54 } |
|
55 |
|
56 // some drivers don't like NULL strings, even when length is zero |
|
57 if (code_pp == NULL) code_pp = ""; |
55 |
58 |
56 GLint success; |
59 GLint success; |
57 const char *code_array[4]; |
60 const char *code_array[4]; |
58 GLint length_array[4]; |
61 GLint length_array[4]; |
59 #define store_str(i, s) do {cxstring cxs = cx_str(s); code_array[i] = cxs.ptr; length_array[i] = (GLint) cxs.length;} while(0) |
62 #define store_str(i, s) do {cxstring cxs = cx_str(s); code_array[i] = cxs.ptr; length_array[i] = (GLint) cxs.length;} while(0) |