My issue is that apparently the normal's of the objects in my OpenGL scene, have inexplicably flipped. Here are some pictures to aid in my explanation.
First screenshot:
Second screenshot:
Is the problem with my code( Which it should not be because I did not change anything there), or is it just something like a graphics card glitch? And if it is my graphics card that was the issue, what can be done to fix it?
Side note, it was working fine before I upgraded my graphics card driver
Your problem is that you are drawing both sides (inside and outside) of the cube without using a depth test. There are two ways to fix this. Typically, you will enable both because they solve different problems, but either technique will solve your problem in this particular case.
Enable the depth test: glEnable(GL_DEPTH_TEST)
. This will make it so that the parts of the cube that are in front get drawn over the parts in back, but not vice versa.
Enable backface culling: glEnable(GL_CULL_FACE)
. This will make it so that the outside of the cube is drawn but not the inside. Note that you will have to make sure that all of your triangles are facing the correct direction in order for this to work correctly. Also note that this is only a complete solution because your model is convex.