Hi All

Can anyone help with some rotation logic. I have the following code:

[pascal]procedure DrawRectangle(x,y,w,h:single); Overload;
begin
glBegin( GL_TRIANGLE_STRIP ); // Drawing Using Triangles
glTexCoord2f(0,0);
glVertex2f( x, y );

glTexCoord2f(0,1);
glVertex2f( x, y+H );

glTexCoord2f(1,0);
glVertex2f( x+W, y );

glTexCoord2f(1,1);
glVertex2f( x+W, y+H );
glEnd; // Finished Drawing The Triangle
end; [/pascal]

Now I would like to add a 'RotateDegrees : Single' parameter and the Image will be drawn rotated by RotateDegrees. If possible I want it rotated around the center of the item.

I have tried glRotatef(45,1,1,0) and it doesnt work properly. It seems the image is rotated but the left bit is clipped off. Also it draws the image offset as per screen rotation instead of the original location with only an image rotated.

Thanks