is there a different way of doing this maybe using some Video function than this?

1. Store the data as a 2D array and render it as a texture, not as individual points.

2. If you're rendering many primitives, use vertex arrays (glDrawArrays etc) rather than glBegin/glEnd. Modern versions of OpenGL (OpenGL 3, OpenGL ES, WebGL) have either deprecated or removed those operations because they're too inefficient.

glBegin/glEnd are more than capable of being plenty fast enough if you can put them outside a loop rather than inside it. Unfortunately because you're using GL_POLYGON you can't do that. If you can find a way to switch to GL_QUADS or GL_TRIANGLES and move that glBegin/glEnd outside your "for (int i" loop, this will go like a rocket and you won't need a VBO or glDrawArrays/glDrawElements.