Hmm, this is moving off-topic and into how pointers, memory, and object life time in C++ work and I really think you'd make your life easier if you'd review those issues outside of your concrete problem. Graphics programming is to a good extent about managing the memory for your assets.
The front() function for std::vector returns (a reference to) the first element in the vector which you then assign to the local variable verteciesFront. You then pass the address of that local variable to glVertexPointer, which is very different from passing the address of the first element in the vector.
Last edited by doctorzeus; 08-09-2013 at 07:03 AM.
Hi Alfonse Reinheart...could you help me please! I've been stuck on this for hours...I'm having the same access violation when calling glGenbuffers. I made sure I followed these steps exactly (initializing glfw, setting window properties, then creating the window before glew calls) and what I've done is in line with everything else I've found online. I'm rather new to openGL so I'm really lost as to what could be going wrong.
This is how I've written it:
glewExperimental = GL_TRUE;
GLFWwindow* window = glfwCreateWindow(1200, 800, "Game", nullptr, nullptr); // Windowed
typedef void(*GENBUFFERS) (GLsizei, GLuint*);
// Load address of function and assign it to a function pointer
GENBUFFERS glGenBuffers = (GENBUFFERS)wglGetProcAddress("glGenBuffers");
// Call function as normal
Any help would be greatly appreciated!