zoom only a part of texture

Hello,

I would like to zoom only a part of a texture.

So the idea would be :
1°) draw the whole texture
2°) center the view where I want zoom
3°) set clipping to the part of the texture I want to zoom (DON’T KNOW HOW)
4°) scale
5°) draw the texture a second time -> will only zoom the part I want

The best solution I think would be to do a clipping similar than the one done with SDL_setRectClip(surface, rect). Is it possible with opengl ?

I was thinking to do it with huge cubes but maybe there is another way ?

Here is a much simpler way. Let’s take only the center of a texture :

glTexCoord2f(0.25f,0.25f);
glVertex2f (-1.0f,-1.0f );

glTexCoord2f(0.25f,0.75f);
glVertex2f (-1.0f, 1.0f );

glTexCoord2f(0.75f,0.75f);
glVertex2f ( 1.0f, 1.0f );

glTexCoord2f(0.75f,0.25f);
glVertex2f ( 1.0f,-1.0f );

Is that what you need ?

Well, I’ve just realized I don’t need to zoom a part of my texture anymore.

Your solution is a really good idea, indeed. I wonder why I did not think of it…