I am playing around with reverse engineering the hello_triangle (link) example program that comes with the Pi and I want to add a proper depth buffer. I think I need to modify something in the init_ogl function but I am not exactly sure what to do. I have added calls to the following EGL methods in my set up view function;
Code: Select all
glEnable(GL_DEPTH_TEST);
glDepthMask(GL_TRUE);
glDepthFunc(GL_LEQUAL);
glDepthRange(0.0f, 1.0f);Here is a short video of the problem (link), ignore the mad colours - they're just for testing purposes.
Code: Select all
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glClearDepth(1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); Cheers!
Dave
