Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: GlewInit

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Newbie Newbie
    Join Date
    May 2013


    I've now got around to creating a simplistic rendering system with OpenGL, however while testing I'm encountering an access violation exception which occurs when I try to call glGenBuffers(1, &m_ElementBuffer);.

    My Renderer::Init function has this in it:
    Code :
    		fprintf(stderr, "GLFW failed to init, CRITICAL ERROR!\n");
    		return false;//Have to back out due to severity of error
    	glfwOpenWindowHint(GLFW_FSAA_SAMPLES, 4);
    	glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3);
    	glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 3);
    	if(!glfwOpenWindow(int(m_Dimensions.x), int(m_Dimensions.y), 0,0,0,0, 32,0,GLFW_WINDOW))
    		fprintf(stderr, "GLFW Open Window failed, aborting...\n");
    		return false;
    	glewExperimental = true;
    	if(glewInit() != GLEW_OK)
    		fprintf(stderr, "Glew failed to init \n");
    		return false;
    I then go on to parse an xml file to further initialization.

    The problem I'm getting is when I call a sceneNodes init function which then calls its renderObjects init function which creates the buffers and all OpenGL related 'stuff' for that object. I am fairly sure that I am calling this after glewInit and have double checked numerous times although I will check it when I come back to this after a break away from the computer. I figure that something has gone wrong with glewinit since in my watch list, when I debug, it says that glGenBuffers is undefined however it also says this about glClear() which executes fine.

    I'm sure it's something obvious that I may pick up straight away when I come back to it, but for the moment I am stumped and would appreciate any suggestions.

    Realized some extra information might be needed, I using an AMD Radeon HD7850 Core Edition for XFX, I have used this function successfully in another project without any issues and glGetString(GL_VERSION) returns "3.3.12002 Core Profile Context"

  2. #2
    Newbie Newbie
    Join Date
    May 2013
    Solved, turns out I was being really stupid and it was down to the shared_ptr not being initialized properly :/
    Last edited by OliverMD; 05-07-2013 at 11:56 AM. Reason: spelling

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts