08.01.2015 Views

OpenGL viewing notes - Bryn Mawr Computer Science

OpenGL viewing notes - Bryn Mawr Computer Science

OpenGL viewing notes - Bryn Mawr Computer Science

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Depth Buffering<br />

Request a depth buffer<br />

glutInitDisplayMode(GLUT_DEPTH|…);<br />

Enable depth buffering<br />

glEnable(GL_DEPTH_TEST);<br />

Clear color and depth buffers<br />

glClear(GL_COLOR_BUFFER_BIT |<br />

GL_DEPTH_BUFFER_BIT);<br />

Render scene<br />

Swap color buffers

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!