Hey everybody! How can i do to calculate the center of the viewport independent of the resolution of the game?

PS: I've tried using screen_size, but without success... ¬¬

Code:
video_mode = 8;

int centrox = screen_size.x * 0.5;

if(centrox == 512)
{
   "do it"
}