Advertisement

Dynamics problem

Started by July 23, 2003 12:47 PM
3 comments, last by TheProx 21 years, 7 months ago
I''m allocating all my loaded data from a file into dynamic arrays, using them in a display list, then deleting the data, does that work? Does the display list need the data used to create it to stay there? If, so, it explains a blank screen...
NARF - Pinky and the Brain
No you don''t need the data afterwards....
Post some of your code, so we can see...
Advertisement
After 6 hrs of expirementing with lists, people asking me to help them find their stylus, and accidently unplugging the computer, ive come to a conclusion, there is something wrong with the generation of the list ... or something .... finally, i caught the problem ... and if these stupid compilers had array bounds checking, I coulda been done hours ago. But hey, I learned a lesson.
NARF - Pinky and the Brain
how did you fix the problem because i have been suffering the same fate.
aye, the problem was stupid me, here is before and after source, see if you can spot the differences

BEFORE:

worldList = glGenLists(1);
glNewList(worldList, GL_COMPILE);
for(i = 0; i < *numPollies; i++)
{
glBindTexture(GL_TEXTURE_2D, textures[room->triangles.theTexture].texture);

glBegin(GL_TRIANGLES);
for(j = 0; j < 3; j++)
{
room->triangles.vertex[j].getNormal();<br> glNormal3fv(room->triangles.vertex->normal);<br> glTexCoord2fv(room->triangles.vertex->.uv);<br> glVertex3fv(room->triangles.vertex->.xyz);<br> }<br> glEnd();<br> }<br> glEndList();<br><br>AND AFTER:<br><br>worldList = glGenLists(1);<br> glNewList(worldList, GL_COMPILE);<br> for(i = 0; i < *numPollies; i++)<br> {<br> glBindTexture(GL_TEXTURE_2D, textures[room->triangles.theTexture].texture);<br><br> glBegin(GL_TRIANGLES);<br> for(j = 0; j < 3; j++)<br> {<br> room->triangles.vertex[j].getNormal();<br> glNormal3fv(room->triangles.vertex[j].normal);<br> glTexCoord2fv(room->triangles.vertex[j].uv);<br> glVertex3fv(room->triangles.vertex[j].xyz);<br> }<br> glEnd();<br> }<br> glEndList();<br><br>as you can see, they are slightly different, hopefully this is your problem too! </i>
NARF - Pinky and the Brain

This topic is closed to new replies.

Advertisement