I'm writing a program in C++ that acquires 4 dimensional points data over a UDP socket and then plots the data in 6 separate 2D scatter plots. For example if we name the dimensions: A,B,C,D the six 2d plots would be AxB, AxC, AxD, BxC, BxD, and CxD. Over the course of a few hours the program accrues ~50K points.
Currently I plot each point once, using immediate mode. I don't clear the buffer between draw calls so previously plotted points persist until the buffer is cleared. I'm not happy with this method as immediate mode is slow and deprecated. When I have to clear the buffer, as when a window re-sizes, I lose all previously plotted data. I'd like to come up with a solution that allows data persistence after the buffer is cleared. Additionally it would be nice if the plot could be easily scaled with window re-sizes as well.
I've thought about maintaining a vertex array (with 2 dimensions) for each coordinate system but that would require 6 separate arrays and require 3 times the memory of maintaining an array with all 4 dimensions.
Am I thinking about this in the right way? What is the proper solution to this problem?
The end goal is to have an application that displays the data as close to real-time as possible.
Edit Would it be possible to continue plotting the points one by one as they come in, and when I need to resize the screen grab an image of the screen and then display a resized version of that image?