I am following some tutorials online regarding the GLSL. I have been implementing the code into my current program. It compiles just fine, but when I debug it, I get an access violation:
First-chance exception at 0x00000000 in Game Engine v0.2a.exe: 0xC0000005: Access violation.
Unhandled exception at 0x00000000 in Game Engine v0.2a.exe: 0xC0000005: Access violation.
I am not sure why. Here is the line it is pointing to:
GLuint v,f,f2,p,ge;
int gw = RESOLUTION_X;
int gh = RESOLUTION_Y;
void setShaders()
{
char *vs = NULL, *fs = NULL, *fs2 = NULL, *gs = NULL;
v = glCreateShader(GL_VERTEX_SHADER); //<-- this line
f = glCreateShader(GL_FRAGMENT_SHADER);
ge = glCreateShader(GL_GEOMETRY_SHADER_EXT);
...
Do I need to provide any additional code? I’m just not sure what is being done wrong here.
Perhaps you forgot to call
SDL_Init? Or maybe calling this function from multiple threads?