How can I select and draw a portion of an Image. I have a 1024 x 1024 Image that consists of various buttons and display parts,
Currently I use this code to Draw and Rotate an Image, but I am unsure how to select a section of my image to draw.
Function DrawAndRotateImage(itr:TTexture, Ax:Int, Ay:Int, Sx:Int, Sy:Int, Ir:Float)
glMatrixMode(GL_TEXTURE)
glLoadIdentity()
glTranslatef(0.5,0.5,0)
glRotatef(Ir,0,0,1)
glTranslatef(-0.5,-0.5,0)
glMatrixMode(GL_MODELVIEW)
glEnable itr.Target()
itr.Bind()
itr.Clamp(1,1,1)
DrawRect(Ax,Ay,Sx,Sy)
glDisable(GL_TEXTURE_2D)
glMatrixMode(GL_TEXTURE)
glLoadIdentity()
glMatrixMode(GL_MODELVIEW)
glScalef(1,1,1)
End Function
How can I add to this code to allow me to select a portion of the image.
Thanks for any help.
Eric