/** * Crates a window and its associated OpenGL context, by taking into account the resolution of the screen and the * monitor that the window should be made full screen on, and another window if you want to share the context of the * other window. * * @param width The desired width, in screen coordinates, of the window. This must be greater than zero. * @param height The desired height, in screen coordinates, of the window. This must be greater than zero. * @param monitor The monitor to use for full screen mode, or {@code null} to use windowed mode. * @param share The window whose context to share resources with, or {@code null} to not share resources. */ public Window(int width, int height, Monitor monitor, Window share) { this(width, height, "SilenceEngine Window | SilenceEngine " + SilenceEngine.getVersionString(), monitor, share); }
public static void start(Game game) { SilenceEngine.log = new GwtLogDevice(); SilenceEngine.display = new GwtDisplayDevice(); SilenceEngine.input = new GwtInputDevice(); SilenceEngine.io = new GwtIODevice(); SilenceEngine.graphics = new GwtGraphicsDevice(); SilenceEngine.audio = new GwtAudioDevice(); SilenceEngine.display.setTitle("SilenceEngine " + SilenceEngine.getVersionString()); SilenceEngine.display.setIcon(FilePath.getResourceFile("engine_resources/icon.png")); SilenceEngine.init(() -> { game.init(); // Prevent fullscreen requests in init SilenceEngine.display.setFullscreen(false); AnimationScheduler.get().requestAnimationFrame(GwtRuntime::frameLoop); }); }