设置OpenGL的剪切矩形? [英] Set clipping rectangle for OpenGL?

查看:358
本文介绍了设置OpenGL的剪切矩形?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用WINAPI和OpenGL绘制应用程序。为了使事情更有效我只重绘所需的区域,所以我invalidatedRect(hwnd,myRect,false)。
我知道OpenGL有自剪裁,但我想这样做我的rect。我想让它剪裁自己的区域我无效,使事情更高效。感谢

I'm making a drawing application with WINAPI and OpenGL. To make things more efficient I only redraw the region needed so I invalidateRect(hwnd,myRect,false). I know OpenGL does self clipping but I want to do that for my rect. I want it to clip itself for the region I invalidated to make things even more efficient. Thanks

推荐答案

如果我理解正确,你想要的是剪刀测试。使用glEnable(GL_SCISSOR_TEST)启用它;并设置剪刀矩形wih glScissor(x,y,width,height);

If i understood correctly, what you want is the scissor test. Enable it with glEnable(GL_SCISSOR_TEST); and set the scissor rectangle wih glScissor(x, y, width, height);

这篇关于设置OpenGL的剪切矩形?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆