Skip to main content

FlixelLwjgl3Launcher

View source

class

org.flixelgdx.backend.lwjgl3.FlixelLwjgl3Launcher

public class FlixelLwjgl3Launcher

Launches the desktop (LWJGL3) version of the Flixel game.

Constructors

FlixelLwjgl3Launcher()

public FlixelLwjgl3Launcher()

Methods

launch(FlixelGame)

public static void launch(FlixelGame game)

Launches the LWJGL3 version of the Flixel game in RELEASE mode with a default configuration. This should be called from the main method of the libGDX LWJGL3 launcher class.

Parameters:

NameDescription
gameThe game instance to launch.

launch(FlixelGame, String...)

public static void launch(FlixelGame game, String... icons)

Launches the LWJGL3 version of the Flixel game in RELEASE mode with a default configuration and the given window icons.

Parameters:

NameDescription
gameThe game instance to launch.
iconsWindow icon paths. Make sure your icons actually exist and are valid!

launch(FlixelGame, FlixelRuntimeMode, String...)

public static void launch(FlixelGame game, FlixelRuntimeMode runtimeMode, String... icons)

Launches the LWJGL3 version of the Flixel game with the given runtime mode and a default configuration built from the game's own settings.

Parameters:

NameDescription
gameThe game instance to launch.
runtimeModeThe FlixelRuntimeMode for this session (TEST, DEBUG, or RELEASE).
iconsWindow icon paths. Make sure your icons actually exist and are valid!

launch(FlixelGame, FlixelRuntimeMode, Runnable)

public static void launch(FlixelGame game, FlixelRuntimeMode runtimeMode, Runnable onBeforeInitialize)

Launches the LWJGL3 version of the Flixel game with the given runtime mode, a default configuration, and an optional pre-initialization callback.

Use this when you want to inject custom services (e.g. a custom debug overlay) without supplying a full configuration object. The configuration is built from the game's own settings exactly as FlixelLwjgl3Launcher.buildDefaultConfig(FlixelGame, String...) would produce it.

FlixelLwjgl3Launcher.launch(game, FlixelRuntimeMode.DEBUG, () -> {
Flixel.setDebugOverlay(MyCustomOverlay::new);
});

Parameters:

NameDescription
gameThe game instance to launch.
runtimeModeThe FlixelRuntimeMode for this session (TEST, DEBUG, or RELEASE).
onBeforeInitializeOptional callback invoked just before Flixel.initialize. Pass null to skip.

launch(FlixelGame, FlixelRuntimeMode, FlixelLwjgl3ApplicationConfiguration)

public static void launch(FlixelGame game, FlixelRuntimeMode runtimeMode, FlixelLwjgl3ApplicationConfiguration configuration)

Launches the LWJGL3 version of the Flixel game using the given configuration. Useful when you have an existing libGDX project with an already-made configuration object.

Parameters:

NameDescription
gameThe game instance to launch.
runtimeModeThe FlixelRuntimeMode for this session (TEST, DEBUG, or RELEASE).
configurationThe FlixelLwjgl3ApplicationConfiguration to use. Use this type (not a raw Lwjgl3ApplicationConfiguration) so a custom Lwjgl3WindowListener can be preserved without reflection.

launch(FlixelGame, FlixelRuntimeMode, FlixelLwjgl3ApplicationConfiguration, Runnable)

public static void launch(FlixelGame game, FlixelRuntimeMode runtimeMode, FlixelLwjgl3ApplicationConfiguration configuration, Runnable onBeforeInitialize)

Launches the LWJGL3 version of the Flixel game with full control over both the window configuration and the pre-initialization callback.

onBeforeInitialize fires after all default FlixelGDX backend services (alerter, audio, debug overlay, etc.) have been registered but before Flixel.initialize is called. Use it to override any of those defaults without duplicating the rest of the launcher wiring. Call FlixelLwjgl3Launcher.buildDefaultConfig(FlixelGame, String...) to get the same starting configuration the other overloads would use, then customize it before passing it in:

FlixelLwjgl3ApplicationConfiguration config = FlixelLwjgl3Launcher.buildDefaultConfig(game);
config.setWindowedMode(1920, 1080);
FlixelLwjgl3Launcher.launch(game, FlixelRuntimeMode.DEBUG, config, () -> {
Flixel.setDebugOverlay(MyCustomOverlay::new);
});

Parameters:

NameDescription
gameThe game instance to launch.
runtimeModeThe FlixelRuntimeMode for this session (TEST, DEBUG, or RELEASE).
configurationThe FlixelLwjgl3ApplicationConfiguration to use.
onBeforeInitializeOptional callback invoked just before Flixel.initialize. Pass null to skip.

buildDefaultConfig(FlixelGame, String...)

public static FlixelLwjgl3ApplicationConfiguration buildDefaultConfig(FlixelGame game, String... icons)

Builds the default FlixelLwjgl3ApplicationConfiguration for a game the same way the simple launch overloads would. Use this when you need to customize the configuration before passing it to FlixelLwjgl3Launcher.launch(...).

FlixelLwjgl3ApplicationConfiguration config = FlixelLwjgl3Launcher.buildDefaultConfig(game);
config.setWindowedMode(1920, 1080);
FlixelLwjgl3Launcher.launch(game, FlixelRuntimeMode.RELEASE, config);

Parameters:

NameDescription
gameThe game instance the configuration is built for.
iconsWindow icon paths (may be empty or omitted). Invalid paths are silently skipped.

Returns: A new FlixelLwjgl3ApplicationConfiguration ready to pass to launch.