878 |
throw new IllegalStateException("Window.createBufferStrategy: window is" |
throw new IllegalStateException("Window.createBufferStrategy: window is" |
879 |
+ " not displayable"); |
+ " not displayable"); |
880 |
|
|
881 |
|
BufferStrategy newStrategy = null; |
882 |
|
|
883 |
// try a flipping strategy |
// try a flipping strategy |
884 |
try |
try |
885 |
{ |
{ |
886 |
bufferStrategy = new WindowFlipBufferStrategy(numBuffers); |
newStrategy = new WindowFlipBufferStrategy(numBuffers); |
|
return; |
|
887 |
} |
} |
888 |
catch (AWTException e) |
catch (AWTException e) |
889 |
{ |
{ |
890 |
} |
} |
891 |
|
|
892 |
// try an accelerated blitting strategy |
// fall back to an accelerated blitting strategy |
893 |
try |
if (newStrategy == null) |
894 |
{ |
newStrategy = new WindowBltBufferStrategy(numBuffers, true); |
|
bufferStrategy = new WindowBltBufferStrategy(numBuffers, true); |
|
|
} |
|
|
catch (AWTException e) |
|
|
{ |
|
|
} |
|
895 |
|
|
896 |
// fall back to an unaccelerated blitting strategy |
bufferStrategy = newStrategy; |
|
try |
|
|
{ |
|
|
bufferStrategy = new WindowBltBufferStrategy(numBuffers, false); |
|
|
} |
|
|
catch (AWTException e) |
|
|
{ |
|
|
} |
|
897 |
} |
} |
898 |
|
|
899 |
/** |
/** |