绘制的 OpenGL 点消失,绘制调用和交换缓冲区问题
OpenGL points drawn disappear, draw call and swap buffer issue?
我想从已经使用 GL_POINTS 发送到 GPU 的顶点数据中在屏幕上绘制点。此刻,它们被绘制了一瞬间,然后消失了。我正在使用时间相关的循环,因为我希望点按顺序出现......
if (currentTime > insertionRateTime)
{
cout << "insertionRateTime = " << insertionRateTime << "index" << index << endl;
insertionRateTime += insertionRate;
glDrawArrays(GL_POINTS, index, 1);
index += 1;
}
glfwSwapBuffers(window);
glfwPollEvents();
有人能在这里透露什么吗?如果我将 glDrawArray 放在 if 语句之外,那么绘制的点将保留,直到绘制下一个点:(
按照 BDL 在评论中的建议,通过在 glDrawArrays 中增加 'count' 参数来解决此问题!谢谢!
相关文章:
- QuadTree只在窗口的右上角绘制
- 绘制旋转的三角形
- C++嵌套if语句,基本货币交换
- flutter:即使shouldRepaint()返回true,自定义画家也不会重新绘制
- shell排序中的交换和比较
- 排序时无法执行交换操作.我做的时候它会崩溃.为什么
- 如何在QT中的自定义视频小工具t上绘制矩形
- 如何在Visual Basic中使用矩形函数OpenGL绘制矩形
- 通过交换元素使数组相同
- 无法使用VAO和EBO(openGL)绘制多个对象
- 为什么我的点没有在 OpenGL 中绘制鼠标所在的位置?
- 如何使 std::sort 在 std::swap 和我的命名空间的模板化交换之间没有名称冲突?
- 绘制顺时针三角形,重新排序点
- 在顶点着色器中使用 OpenGl 的未声明标识符,我在顶点着色器中绘制三角形时遇到问题
- 交换运算符 + 重载会导致无限递归
- SFML 文本未绘制在窗口上
- 为什么 std::reduce 需要交换性?
- 绘制的 OpenGL 点消失,绘制调用和交换缓冲区问题
- 为什么在开始绘制获取的交换链图像时不需要内存障碍?
- 在xaml项目中使用CoreWindow交换链,为什么没有绘制