I want to plot complex data points to a window to display. I know how to do it all in one go:

void display() {
glColor3f(0.0, 0.0, 0.0);
point graph[M*N];
for (int i = 0; i < M*N; i++) {
    graph[i].x = output[i].x;
    graph[i].y = output[i].y;
    glVertex2f(graph[i].x, graph[i].y);

Then display it with glutDisplayFunc... is there a way to call this multiple times as in fill the array with vertices and write to the window and do it again and again etc. as many batches of vertices as you want. I tried making a large single array of the points but its size of struct{float x; float y;} x^10 elements and seems to cause problems on the GPU and CPU. Is there a way to perform this operation as I've shown but periodically because in between plotting to the window I want to compute the data on the GPU. Alternatively, are there other functions besides glutDisplayFunc(void(*func)(void)) to display pixels in the window?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.