I'm making a 2d game that uses textures for sprites. I want to make some turrets rotate, but they rotate about the lower left hand corner of their texture. I need them to rotate about their center which is also the center of the texture.
here is my initialization code:
int Initialize()
{
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LESS);
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER,0);
glOrtho(0.0, 640.0, 0.0, 480.0, -10.0, 10.0);
glLoadIdentity(); // reset projection matrix
glEnable(GL_TEXTURE_2D);
...
and here is my function that draws the texture: