If I'm not mistaken the depth buffer itself is created by default unless you specify otherwise. After that it just a matter of enabling it in the standard way:
glEnable(GL_DEPTH_TEST);
Make sure to clear the depth buffer at the start of your render loop:
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Everyone..
Do you guys know how to enable depth testing in glfw? :-)
Thank you
Hi Ankit,
If I'm not mistaken the depth buffer itself is created by default unless you specify otherwise. After that it just a matter of enabling it in the standard way:
glEnable(GL_DEPTH_TEST);
Make sure to clear the depth buffer at the start of your render loop:
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
Thank you Bastiaan! :-)