Try using glTexCoord2f() instead of glTexCoord2i() and give them value's between 0.0 and 1.0. Like this:

[pascal]
glBegin( GL_QUADS );
//Top-left vertex (corner)
glTexCoord2f( 0, 0 );
glVertex3f( 0, 0, 0.0 );

//Bottom-left vertex (corner)
glTexCoord2f( 0.25, 0 );
glVertex3f( 512, 0, 0 );

//Bottom-right vertex (corner)
glTexCoord2f( 0.25, 0.25 );
glVertex3f( 512, 512, 0 );

//Top-right vertex (corner)
glTexCoord2f( 0, 0.25 );
glVertex3f( 0, 512, 0 );
glEnd();
SDL_GL_SwapBuffers();
[/pascal]

This should display 1/4th of the texture. Hope this helps.