GlewInit

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • 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:

      Source Code

      1. if(!glfwInit())
      2. {
      3. fprintf(stderr, "GLFW failed to init, CRITICAL ERROR!\n");
      4. return false;//Have to back out due to severity of error
      5. }
      6. glfwOpenWindowHint(GLFW_FSAA_SAMPLES, 4);
      7. glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3);
      8. glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 3);
      9. glfwOpenWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
      10. if(!glfwOpenWindow(int(m_Dimensions.x), int(m_Dimensions.y), 0,0,0,0, 32,0,GLFW_WINDOW))
      11. {
      12. fprintf(stderr, "GLFW Open Window failed, aborting...\n");
      13. glfwTerminate();
      14. return false;
      15. }
      16. glewExperimental = true;
      17. if(glewInit() != GLEW_OK)
      18. {
      19. fprintf(stderr, "Glew failed to init \n");
      20. return false;
      21. }
      22. glClearColor(0.0f,0.0f,0.4f,0.0f);
      23. glEnable(GL_DEPTH_TEST);
      24. glDepthFunc(GL_LESS);
      25. glfwSetWindowTitle("Render");
      Display All

      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'. It should be noted that I am definitely calling glgenbuffers after glewinit (although I will check this after a break). 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.

      Edit: 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 9.12.0.0"

      The post was edited 1 time, last by olivermd ().