Search in sources :

Example 31 with DisplayMode

use of java.awt.DisplayMode in project lionengine by b3dgs.

the class ScreenAwtTest method testFullscreen.

/**
 * Test full screen.
 */
@Test
void testFullscreen() {
    Medias.setLoadFromJar(ScreenAwtTest.class);
    final DisplayMode res = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayModes()[0];
    final Config config = new Config(new Resolution(res.getWidth(), res.getHeight(), res.getRefreshRate()), res.getBitDepth(), false, Medias.create("image.png"));
    try {
        testScreen(config);
    } catch (final LionEngineException exception) {
        // Skip test
        if (!ScreenFullAwt.ERROR_SWITCH.equals(exception.getMessage())) {
            throw exception;
        }
    }
}
Also used : DisplayMode(java.awt.DisplayMode) LionEngineException(com.b3dgs.lionengine.LionEngineException) Config(com.b3dgs.lionengine.Config) Resolution(com.b3dgs.lionengine.Resolution) Test(org.junit.jupiter.api.Test)

Aggregations

DisplayMode (java.awt.DisplayMode)31 GraphicsDevice (java.awt.GraphicsDevice)20 GraphicsEnvironment (java.awt.GraphicsEnvironment)9 Dimension (java.awt.Dimension)6 Frame (java.awt.Frame)4 ArrayList (java.util.ArrayList)4 LionEngineException (com.b3dgs.lionengine.LionEngineException)3 Graphics (java.awt.Graphics)3 Rectangle (java.awt.Rectangle)3 Component (java.awt.Component)2 Point (java.awt.Point)2 Robot (java.awt.Robot)2 Window (java.awt.Window)2 WindowAdapter (java.awt.event.WindowAdapter)2 WindowEvent (java.awt.event.WindowEvent)2 BufferedImage (java.awt.image.BufferedImage)2 Config (com.b3dgs.lionengine.Config)1 Resolution (com.b3dgs.lionengine.Resolution)1 AWTException (java.awt.AWTException)1 Button (java.awt.Button)1