Sign in to follow this  
wangdiweilu

about display list index

Recommended Posts

wangdiweilu    122
In order to display many maps, I use display list to transfer map. List index is saved in a mixed array. Only the index value is changed when map is transferred. Six maps are displayed in a time, when map moving away from screen, map is transferred, but the transferred map is ok only in the first time. When the map displays come and forth, the transferred map don’t display .I am puzzled. Millions of thanks. void RenderScene(void) { …. InvertIndex(); ….. for(int i = 0; i < 6; i++) { if(!mapfileHlLoaded[i]) mapfileHlLoaded[i] = drawMap_file_hl(i,*(position[i])); else { for(intj = 0; j < 6; j++) if(hlindexMask[j]) {glCallList(hlindexList[i][j]); } … } } void InvertIndex(void) { if((air_lat>32.0)&&(invertflag[0]==0)&&(yoffs<0))//down { ….. for(i=0;i<6;i++) { position[0][i]=position[6][i]; position[1][i]=position[7][i]; glDeleteLists(3,12); mapfileHlLoaded[0]=drawMap_file_hl(0,*(position[0])); mapfileHlLoaded[1]=drawMap_file_hl(1,*(position[1])); ….. } if((air_lat<32.0)&&(invertflag[1]==0)&&(yoffs>0))//up { … for(int i=0;i<6;i++) { position[0][i]=Index_hl[0][1][i]; position[1][i]=Index_hl[0][2][i]; } glDeleteLists(3,12); mapfileHlLoaded[0]=drawMap_file_hl(0,*(position[0])); mapfileHlLoaded[1]=drawMap_file_hl(1,*(position[1])); ……. } } BOOL drawMap_file_hl(GLuint mapindex,int address) { …… hlindexHeadList[mapindex] = glGenLists(6); …… for(int i = 0; i < 6; i++) { hlindexList[mapindex][i] = hlindexHeadList[mapindex] + i; glNewList(hlindexList[mapindex][i], GL_COMPILE); …… glEndList(); } }

Share this post


Link to post
Share on other sites
zedz    291
a bit unclear what he issue is

i dont think u want to be calling glDeleteLists(..); all to often, ie dont often destroy + recreate display lists, theyre mainly useful for something that u build once but will display often.
try creating all the display lists at program start, + then during runtime choosing which ones to display

Share this post


Link to post
Share on other sites
wangdiweilu    122
A sea of maps need to be displayed, for example, when plane is flying, many maps are required, so it is impossible to create so many display lists at one time, otherwise, memory overflows. I want to depend on the position of plane to decide to the index value of display list is created.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this