我正在尝试在 OpenGL 和 Visual Studio C++ 中找到一种橡皮筋的方法。我遇到的问题是一些 Win 7 计算机(即我的老板)不允许我读取或绘制到前端缓冲区,从而直接杀死它。
glDrawBuffer( GL_FRONT );
glEnable(GL_COLOR_LOGIC_OP);
glLogicOp( GL_XOR );
glPolygonMode(GL_FRONT, GL_LINE);
glRecti(X0, Y0, X1, Y1);
X1 = X;
Y1 = Y;
glRecti(X0, Y0, X1, Y1);
*//Doesn't draw lines*
或将前缓冲区复制到后缓冲区(重绘到它需要很长时间)调用 swapbuffers 绘图然后交换 agian
glReadBuffer( GL_FRONT );
glDrawBuffer( GL_BACK );
glCopyPixels(0, 0, Width, Height, GL_COLOR);
glEnable(GL_COLOR_LOGIC_OP);
glLogicOp( GL_XOR );
glPolygonMode(GL_BACK, GL_LINE);
SwapBuffers(hdc);
glRecti(X0, Y0, X1, Y1);
X1 = X;
Y1 = Y;
glRecti(X0, Y0, X1, Y1);
SwapBuffers(hdc);
*//Doesn't display original drawing*
有任何想法吗?