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:
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"
My Renderer::Init function has this in it:
Source Code
- if(!glfwInit())
- {
- 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);
- glfwOpenWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
- 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");
- glfwTerminate();
- return false;
- }
- glewExperimental = true;
- if(glewInit() != GLEW_OK)
- {
- fprintf(stderr, "Glew failed to init \n");
- return false;
- }
- glClearColor(0.0f,0.0f,0.4f,0.0f);
- glEnable(GL_DEPTH_TEST);
- glDepthFunc(GL_LESS);
- glfwSetWindowTitle("Render");
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 ().