public final class Engine
extends java.lang.Object
Standard engine initialization:
public final class AppMinimal { public static void main(String[] args) { // Start engine (name = "First Code", version = "1.0.0", resources directory = "resources") // The engine is initialized with our parameters: // - The name of our program: "First Code" // - The program version: "1.0.0" // - The main resources directory, relative to the execution directory: ./resources/ // This mean that any resources loaded with Media.get(...) will have this directory as prefix. Engine.start("Minimal", Version.create(1, 0, 0), "resources"); // Resolution configuration (output = 640*480 at 60Hz). This is corresponding to the output configuration. // As our native is in 320*240 (described in the Scene), the output will be scaled by 2. // If the current frame rate is lower than the required in the native, // the extrapolation value will allow to compensate any data calculation. final Resolution output = new Resolution(640, 480, 60); // Final configuration (rendering will be scaled by 2 considering source and output resolution). // This is the final configuration container, including color depth and window mode. final Config config = new Config(output, 16, true); // Program starter, setup with our configuration. It just needs one sequence reference to start. final Loader loader = new Loader(config); loader.start(new Scene(loader)); } }
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
AUTHOR
Engine author.
|
static java.lang.String |
BEGIN_DATE
Engine last release date.
|
static java.lang.String |
LAST_RELEASE_DATE
Engine last release date.
|
static java.lang.String |
NAME
Engine name.
|
static java.lang.String |
VERSION
Engine version.
|
static java.lang.String |
WEBSITE
Engine website.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getProgramName()
Get the program name (Engine must have been started).
|
static java.lang.String |
getProgramVersion()
Get the program version (Engine must have been started).
|
static void |
start(java.lang.String name,
Version version,
java.lang.String resourcesDir)
Start engine.
|
static void |
start(java.lang.String name,
Version version,
java.lang.String resourcesDir,
Verbose level)
Start engine.
|
static void |
terminate()
Terminate the engine.
|
public static final java.lang.String NAME
public static final java.lang.String VERSION
public static final java.lang.String BEGIN_DATE
public static final java.lang.String LAST_RELEASE_DATE
public static final java.lang.String AUTHOR
public static final java.lang.String WEBSITE
public static void start(java.lang.String name, Version version, java.lang.String resourcesDir)
name
- The program name (must not be null
).version
- The program version (must not be null
).resourcesDir
- The main resources directory (must not be null
).public static void start(java.lang.String name, Version version, java.lang.String resourcesDir, Verbose level)
name
- The program name (must not be null
).version
- The program version (must not be null
).resourcesDir
- The main resources directory (must not be null
).level
- The verbose level (must not be null
).public static void terminate()
public static java.lang.String getProgramName()
public static java.lang.String getProgramVersion()