NickM13 NickM13 - 1 year ago 108
C++ Question

How to clip rendering to a given box

How to clip rendering to a given box/rectangle in OpenGL?

E.g. instead of rendering it unclipped/cropped like this

unclipped

I want to make it clipped like this

clipped

Answer Source

By using a combination of appropriately setting the viewport (glViewport), the scissor box (glScissor) and enable scissor testing (glEnable(GL_SCISSOR_TEST)).

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download