我有绘画应用程序。鼠标事件坐标存储到 VertexArray。然后顶点数组被绘制到屏幕上。我的代码结构看起来像这样
// I get mouse event coordinates and store them to VertexArray
glPushMatrix();
//some new matrix settings
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, framebuffer);
glClear(GL_COLOR_BUFFER_BIT);
//now I draw first full size textured quad and later I draw vertexArray
glDrawArrays(.....);
//and now I draw second full size textured quad on top of first quad ant that what have been drawn from vertex array
glPopMatrix();
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
//immediately after that I draw FBO to screen:
glBindTexture(GL_TEXTURE_2D, fbTexture);
//Code for drawing textured quad
glBindTexture(GL_TEXTURE_2D, 0);
因此,每次注册新的鼠标事件坐标时,都会重新绘制所有内容。如果有超过 1000 个坐标,绘图会变得非常慢。我的问题可能在哪里?我认为 OpenGL 的 1000 个顶点并不多