Okay so I have been working on this for hours and I simply can not understand what I am doing wrong. All I am trying to do is generate a Triangle in my sfml application and yes I am failing miserably. Can someone explain to me what I am doing wrong?
GLenum err = glewInit();
if (err != GLEW_OK)
{
std::cout << "NOT WORKING" << std::endl;
}
GLuint vertextBuffer;
GLuint vertexArrayID;
glGenVertexArrays(1, &vertexArrayID);
glBindVertexArray(vertexArrayID);
glGenBuffers(1, &vertextBuffer);
glBindBuffer(GL_ARRAY_BUFFER, vertextBuffer);
g_vertex_buffer_data.push_back({ -1.0f, -1.0f, 0.0f });
g_vertex_buffer_data.push_back({1.0f, -1.0f, 0.0f});
g_vertex_buffer_data.push_back({ 0.0f, 1.0f, 0.0f });
glBufferData(GL_ARRAY_BUFFER, sizeof(g_vertex_buffer_data), &g_vertex_buffer_data, GL_STATIC_DRAW);
glDrawArrays(GL_TRIANGLES, 0, 3);
gameWindow.pushGLStates();
gameWindow.popGLStates();
I am not able to get anything to show up even for a simple triangle.
This is all the opengl code I use including the draw functions