Hello, I've used SFML in the past for 2d projects and decided to use it with OpenGL to learn 3d programming as well.
My goal is to make a program that renders a simple scene in overhead 2d, simple 3d projection using the SFML 2d graphics module and "real" 3d with OpenGL.
I started following the tutorial on
http://www.opengl-tutorial.org/ but I immediately ran into problems.
I dug around on different forums for solutions and while adding
glDisableClientState(GL_COLOR_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
In the code after popGLStates() stopped my program from crashing, I still can't draw anything with the graphics module if I initialize drawing in OpenGL.
I isolated the problem into this piece of code.
GLfloat g_vertex_buffer_data[] = { -1.0f, -1.0f, 0.0f,
1.0f, -1.0f, 0.0f,
0.0f, 1.0f, 0.0f, };
glGenBuffers(1, &vertexbuffer);
glBindBuffer(GL_ARRAY_BUFFER, vertexbuffer);
glBufferData(GL_ARRAY_BUFFER, sizeof(g_vertex_buffer_data), g_vertex_buffer_data, GL_STATIC_DRAW);
If I run this, which apparently generates a VBO, puts some data into it and binds it for use, the graphics module stops doing anything, even if I use pushGLStates().
I'm sorry if this question is silly, but I'm a beginner with using OpenGL and I will appreciate any help you can give me.