i would factor this out to a function like:
````
enum mode = next_mode(enum current, int step)
{
  enum mode;
  do {
     mode = (mode + step) % RENDER_STEREO_MODE_COUNT;
     if(g_Windowing.SupportsStereo(mode))
        break;
   } while(mode != current);
   return mode;
}
````

The just call as:
````
SetStereoMode(next_mode(current, 1));
````
or
````
SetStereoMode(next_mode(current, RENDER_STEREO_MODE_COUNT - 1));
````