glDrawElements over 255 indices ?

I’m currently using glDrawElements to draw objects on the screen (2d) and have an array of vertices for all objects. I show/hide objects by changing the indices array.

I’ve ran into a problem though. I cannot go over 255 indices with GLubyte. Is there a solution to this?

Err, nevermind. I just realized you can set the data type parameter for the indices from GL_UNSIGNED_BYTE to GL_UNSIGNED_SHORT.