I am currently using this:
void drawBoundary(sf::RenderWindow &window, sf::Drawable *d, const sf::FloatRect &boundary)
{
GLdouble eq1[] = {1, 0, 0, 0x0};
GLdouble eq2[] = {-1, 0, 0, 0x0};
GLdouble eq3[] = {0, 1, 0, 0x0};
GLdouble eq4[] = {0, -1, 0, 0x0};
eq1[3] = -boundary.Left;
eq2[3] = boundary.Right;
eq3[3] = -boundary.Top;
eq4[3] = boundary.Bottom;
glEnable(GL_CLIP_PLANE0);
glEnable(GL_CLIP_PLANE1);
glEnable(GL_CLIP_PLANE2);
glEnable(GL_CLIP_PLANE3);
glClipPlane(GL_CLIP_PLANE0, eq1);
glClipPlane(GL_CLIP_PLANE1, eq2);
glClipPlane(GL_CLIP_PLANE2, eq3);
glClipPlane(GL_CLIP_PLANE3, eq4);
window.Draw(*d);
glDisable(GL_CLIP_PLANE1);
glDisable(GL_CLIP_PLANE0);
glDisable(GL_CLIP_PLANE2);
glDisable(GL_CLIP_PLANE3);
}
Edit: Fixed the function