glShaderSource Make the application crush
I've written a little OpenGL library in c++ and now I'm trying to replicate it using dart. Everything sims to work fine but whenever i call glShaderSource the application closes with "Exited (3221225477)". This is the function that I've used to compile all my shaders in c++ rewritten in dart:
static int _compileShader(int type, String source) {
int id = glCreateShader(type);
glShaderSource(id, 1, NativeString.fromString(source), nullptr);
glCompileShader(id);
Pointer<Uint32> result = allocate<Uint32>();
glGetShaderiv(id, GL_COMPILE_STATUS, result);
if(result.value == GL_FALSE) {
Pointer<Uint32> length = allocate<Uint32>();
glGetShaderiv(id, GL_INFO_LOG_LENGTH, length);
Pointer<Utf8> message = allocate<Utf8>(count: length.value);
glGetShaderInfoLog(id, length.value, length, message);
glDeleteShader(id);
print("Failed to compile ${type == GL_VERTEX_SHADER ? "vertex" : "fragment"} shader");
return 0;
}
return id;
}
So when the second line is execute it crushes. What can i do to solve this problem?
PS: Don't know if is relevant but this is the versions that i use:
GLFW: 3.3.2 Win32 WGL EGL OSMesa MinGW DLL
OpenGL: 4.6.14736 Compatibility Profile Context 20.7.1 27.20.2001.8002
I am on windows 10
Edited by Bonfra04