does anyone know an efficient solution for my problem? i want to put textures on a quadstrip, one for each square.
currently, i’m using something like the following code:
First, two vertices won’t make a quad, you mus put glBegin/glEnd outside the for-loop.
Do you mean you want different textures on different quads in the quad strip? That’s not possible, since you are not allowed to change texture while drawing a primitive.
If you want the same texture but repeated, just put a glTexCoord before each glVertex that uses x as counting cariable.
of course, i wrote something wrong last night. glBegin(…) and glEnd() have to be outside the loop…
tnx anyway. very bad thing, that i can’t change my texture.
but wait. is it possible to use one large texture?
look:
//
glBegin(GL_QUAD_STRIP);
for(x=0; x<MAX_X-1; x++){
glTexCoord2f(x/MAX_X,y/MAX_Y);
glVertex3f(x,y,z1)
glTexCoord2f(x/MAX_X,y/MAX_Y);
glVertex3f(x,y+1,z2)
}
glEnd();
//
dependant, on what i need, this should be possible, yes?
btw, do you know about texture max_size and max_number limitations in opengl? or rather in mesa?