I'm displaying a function plot in a OpenGL widget (using QT). It's fully 2D.
Now I'd like to add some function intersections points to the scene (approx. 50 - 1000). Instead of using points as with glBegin(GL_POINTS) I'd like to use small crosses.
The scene will be static, coordinates will be provided by two double vectors.
My approach is:
- Record one cross (basically two lines) to a display list (glNewList())
- Then call translate2f(..) for each point and then glCallList(..)
As far as I understood OpenGL works as a state machine, so after setting the first point, I'll have to reset the translate statement somehow, is that true?
Is this a good way to achieve this, or are there predefined methods I can use which are faster/smarter/easier?
(Another question: How do I convert from OpenGL scene coordinates to pixels and back?)
Thank you for your time,