I have been having problems with tracking my 2d objects in OpenGL using Ajhc.

I don't know how I can keep track of my object and prevent it from leaving the width and height of the device. Can anyone provide assistance?

My code here: