Asteroids and screenwrapping

well I have got the ship to move around the screen and shoot bullets I just want it to wrap around the screen, I am unsure of how to start.

well I am working on the screen wrap

void drawShip()
{
	glPushMatrix();
	glColor3f(1.0f, 0.0f, 0.0f);
	glTranslatef(50.0f, 0.0f, 0.0f);
	glTranslatef(dx,dy, 0.0f);
	cout << "dx: " << dx << "dy: " << dy << endl;
	if (dx <= -187.0f)
	{
		dx = 88.0f;
	}
	if (dx >= 88.0f)
	{
		dx = -187.0f;
	}
	if (dy >= 105.0f)
	{
		dy = -105.0f;
	}
	if (dy <= -105.0f)
	{
		dy = 105.0f;
	}
	glBegin(GL_LINE_LOOP);
	float offsets[4][2] = { {0.0f, 0.0f}, {-5.0f, -5.0f}, {0.0f, 10.0f}, {5.0f, -5.0f} };
	float cosA = cos(shipAngle);
	float sinA = sin(shipAngle);
	for (int i = 0; i < 4; i++)
		glVertex3f(offsets[i][0] * cosA - offsets[i][1] * sinA, offsets[i][0] * sinA + offsets[i][1] * cosA, 0.0f);
	glEnd();
	glPopMatrix();
}

I solved my problem. thanks for all the help