Access Violation Exception while creating a Shader

-1

I am trying to load a Shader for image based rendering and I'm facing an Exception saying, "Access violation executing location 0x00000000."

//Load IBR logic Vertex and Fragmnet OpenGL shaders
void GLTextureManager::LoadIBRShaders()
{
    m_ShaderProgramID = 0;

    GLint GlewInitResult = glewInit();
    if (GLEW_OK != GlewInitResult) 
    {
        const GLubyte* pResult =glewGetErrorString(GlewInitResult);
        printf("ERROR: %s\n",pResult);
    }

    // Create the shaders
    GLuint VertexShaderID = glCreateShader(GL_VERTEX_SHADER); //Access Violation Exception occured here
    GLuint FragmentShaderID = glCreateShader(GL_FRAGMENT_SHADER);
    //Additional code after creating shader
}

Below are the include files used,

  #include "GL/glew.h"
  #include <GL/glu.h>

I have initialised GLEW before calling glCreateShader and I still face the same issue.

exception
opengl
visual-c++
glew
vertex-shader
asked on Stack Overflow Apr 6, 2020 by SharathKumar_KE • edited Apr 6, 2020 by BDL

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0