Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


#ActualKhatharr

Posted 17 April 2013 - 11:28 PM

I'll do that occasionally. More often, though, I'll just put the condition into a bool and then run the bool through the if statement.

mode = modeArray[i];

bool resetDisp = 
  (mode.getWidth() == width) &&
  (mode.getHeight() == height) &&
  (mode.getFrequency() == 60) &&
  (mode.getBitsPerPixel() == 32);

if(resetDisp) {
    Display.setDisplayMode(mode);
    break;
}

#2Khatharr

Posted 17 April 2013 - 11:27 PM

I'll do that occasionally. More often, though, I'll just compound the condition into a bool and then run the bool through the if statement.

mode = modeArray[i];

bool resetDisp = (mode.getWidth() == width);
resetDisp = resetDisp && (mode.getHeight() == height);
resetDisp = resetDisp && (mode.getFrequency() == 60);
resetDisp = resetDisp && (mode.getBitsPerPixel() == 32);

if(resetDisp) {
    Display.setDisplayMode(mode);
    break;
}

#1Khatharr

Posted 17 April 2013 - 11:27 PM

I'll do that occasionally. More often, though, I'll just compound the condition into a bool and then run the bool through the if statement.

mode = modeArray[i];

bool resetDisp = (mode.getWidth() == width);
resetDisp = (resetDisp && mode.getHeight() == height);
resetDisp = (resetDisp && mode.getFrequency() == 60);
resetDisp = (resetDisp && mode.getBitsPerPixel() == 32);

if(resetDisp) {
    Display.setDisplayMode(mode);
    break;
}

PARTNERS