chore(engine): switch to libGDX
For real
This commit is contained in:
@ -1,25 +0,0 @@
|
||||
package org.vibecoders.moongazer;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.layout.StackPane;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class App extends Application {
|
||||
|
||||
@Override
|
||||
public void start(Stage stage) {
|
||||
String javaVersion = System.getProperty("java.version");
|
||||
String javafxVersion = System.getProperty("javafx.version");
|
||||
Label l = new Label("Hello, JavaFX " + javafxVersion + ", running on Java " + javaVersion + ".");
|
||||
Scene scene = new Scene(new StackPane(l), 640, 480);
|
||||
stage.setScene(scene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
launch();
|
||||
}
|
||||
|
||||
}
|
||||
15
app/src/main/java/org/vibecoders/moongazer/Constants.java
Normal file
15
app/src/main/java/org/vibecoders/moongazer/Constants.java
Normal file
@ -0,0 +1,15 @@
|
||||
package org.vibecoders.moongazer;
|
||||
|
||||
/**
|
||||
* Client configuration constants and default values
|
||||
* used throughout the Moongazer client application.
|
||||
*/
|
||||
public class Constants {
|
||||
|
||||
/**
|
||||
* Window configuration.
|
||||
*/
|
||||
public static final int WINDOW_WIDTH = 1280;
|
||||
public static final int WINDOW_HEIGHT = 720;
|
||||
public static final String WINDOW_TITLE = "Moongazer";
|
||||
}
|
||||
29
app/src/main/java/org/vibecoders/moongazer/Game.java
Normal file
29
app/src/main/java/org/vibecoders/moongazer/Game.java
Normal file
@ -0,0 +1,29 @@
|
||||
package org.vibecoders.moongazer;
|
||||
|
||||
import com.badlogic.gdx.ApplicationAdapter;
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.graphics.GL20;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import static org.vibecoders.moongazer.Constants.*;
|
||||
|
||||
public class Game extends ApplicationAdapter {
|
||||
private static final Logger log = LoggerFactory.getLogger(Game.class);
|
||||
|
||||
@Override
|
||||
public void create() {
|
||||
log.debug("create stub");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render() {
|
||||
Gdx.gl.glClearColor(0, 0, 0, 1);
|
||||
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
log.debug("stub");
|
||||
}
|
||||
}
|
||||
|
||||
23
app/src/main/java/org/vibecoders/moongazer/Main.java
Normal file
23
app/src/main/java/org/vibecoders/moongazer/Main.java
Normal file
@ -0,0 +1,23 @@
|
||||
package org.vibecoders.moongazer;
|
||||
|
||||
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application;
|
||||
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import static org.vibecoders.moongazer.Constants.*;
|
||||
|
||||
public class Main {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(Main.class);
|
||||
|
||||
public static void main(String[] args) {
|
||||
Lwjgl3ApplicationConfiguration cfg = new Lwjgl3ApplicationConfiguration();
|
||||
cfg.setTitle(WINDOW_TITLE);
|
||||
cfg.setWindowedMode(WINDOW_WIDTH, WINDOW_HEIGHT);
|
||||
cfg.useVsync(true);
|
||||
cfg.setIdleFPS(10);
|
||||
cfg.setWindowIcon("icons/logo.png");
|
||||
log.info("Starting game client");
|
||||
new Lwjgl3Application(new Game(), cfg);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user