PDA

View Full Version : help with basic concept of opengl data storage and use



tpb
12-19-2003, 08:42 AM
I would like to read in from the harddisk, lots of 2D vectors (map data) and then zoom and pan through the map.
All of the examples seem to recreate or reload the data in the glutDisplayFunc().
Is it possible to load all the vetors into ram on the videoboard once, and then pan and zoom using changes to the projection matrix alone? Am I missing something obvious?

12-19-2003, 09:27 AM
With basic data as is found on many simple glut tutorial, it does not really slows down to re-specify everything for each frame.

With large static data, the best is to use display lists. It is easy and fast.

Read the docs for :
glGenList glNewList glEndList glCallList

Basically, when you define a bunch of gl commands enclosed between glNewList and glEndList, it is stored on the card. Then you can change the projection matrix and simply use glCallList to render what was defined.

If you really have a LOT of data (I know real map data can be huge), you can segment in several display lists, and do basic culling by hand. Well, it will still be slow when you see the whole map.