textures + DLs

is it possible to map a texture on a portio of a DL. i have a huge terrain DL. now i want to map an image onto the terrain, but not the whole terrain, just a part of it. is it possible or do i have to skip using DLs in this case?
thank u.

Split up your displaylist into several glBegin…glEnd-Blocks like this :

glNewList(MyList, GL_COMPILE);
 glBindTexture(TexA);
 glBegin(PrimitiveType)
  ...
 glEnd;

 glBindTexture(TexB);
 glBegin(PrimitiveType)
  ...
 glEnd;
glEndList

If you have a texture which should only be mapped once, you can change the outmost pixel rows and columns to have an alpha == 0 (fully transparent) and use GL_CLAMP_TO_EDGE so that texcoord outside the 0 to 1 range sample the edge pixels only.
Figure out the correct texenv mode (formula) which results in transparent texels and you can place that texture on any place on your terrain by adjusting the texcoords only. BTW, this also works for a single quad if you want to map only a part of it.

If that is done in a display list and it will never change dynamically it’s better to split the geometry and texture only the one you want.

is it not possible to make it dynamic. i want the user to choose a texture and put it anywher he/she wants it. if i have to break up the DL into smaller parts, it would still restrict the user to a certain degree.
thank u.

Then compile the DL everytime the user changes the texture or don’t use one at all and go for VAs or better VBOs instead.

Right, sounds like a terrain editor. Just forget display lists for dynamic user interactions on geometry and vertex attributes. Display list are not intended for this.

Originally posted by Relic:
Right, sounds like a terrain editor. Just forget display lists for dynamic user interactions on geometry and vertex attributes. Display list are not intended for this.

thank u. i have never used VAs or VBOs. any good place to start from?

Forget var, they are propietray Nvidia, and have been completely supplanted by vertex buffer objects.
http://oss.sgi.com/projects/ogl-sample/registry/ARB/vertex_buffer_object.txt

Skim it, at the very end is an example.

Search nvidia, they have a whitepaper on vbo as well.