bool getCompileResult(unsigned int *shader, const char *src) { glShaderSource(*shader, 1, &src, nullptr); //the error is in glShaderSource! (error is GL_INVALID_VALUE) //etc....}const char *vertexShaderSource = "#version 330 core\n""layout (location = 0) in vec3 aPos;\n""void main()\n""{\n"" gl_Position = vec4(aPos.x, aPos.y, aPos.z, 1.0);\n""}\0";int main() { //some stuff unsigned int vertexShader = glCreateShader(GL_VERTEX_SHADER); if(!getCompileResult(&vertexShader, vertexShaderSource)) return -1;}
typedef signed char i8; // Alternatively s8typedef signed short i16; // Alternatively s16typedef signed int i32; // Alternatively s32typedef signed long long i64; // Alternatively s64typedef unsigned char u8;typedef unsigned short u16;typedef unsigned int u32;typedef unsigned long long u64;