Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM registry.fedoraproject.org/fedora:43

RUN dnf -y update && \
dnf -y install \
git curl unzip which procps-ng psmisc findutils \
java-21-openjdk-devel \
# X + desktop
xorg-x11-server-Xvfb xterm dbus-x11 \
xfce4-session xfce4-panel xfce4-settings xfce4-terminal thunar \
xfwm4 \
feh \
# VNC + web VNC
x11vnc novnc python3-websockify \
# OpenGL (Mesa) + GLVND + tools (glxinfo)
mesa-dri-drivers mesa-libGL mesa-libEGL mesa-libGLU \
libglvnd-glx libglvnd-egl \
glx-utils \
&& dnf clean all


RUN dnf -y install weston xorg-x11-server-Xwayland wayland-utils \
&& dnf clean all


COPY assets/wallpaper.jpg /root/wallpaper.jpg
COPY assets/novnc-index.html /usr/share/novnc/index.html

14 changes: 14 additions & 0 deletions .devcontainer/assets/novnc-index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!doctype html>
<html>

<head>
<meta charset="utf-8" />
<meta http-equiv="refresh" content="15; url=/vnc.html?autoconnect=1&resize=scale&view_clip=1">
<title>noVNC</title>
</head>

<body>
<b>Warming up <a href="/vnc.html?autoconnect=1&resize=scale&view_clip=1">noVNC</a>... </b>
</body>

</html>
Binary file added .devcontainer/assets/wallpaper.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "jME env (SERVER)",
"build": {
"dockerfile": "Dockerfile"
},
"forwardPorts": [6080],
"portsAttributes": {
"6080": {
"label": "jME Desktop",
"onAutoForward": "openPreview"
}
},
"containerEnv": {
"JME_DEV_ENVIRONMENT": "yesReally",
"LIBGL_ALWAYS_SOFTWARE": "1",
"MESA_LOADER_DRIVER_OVERRIDE": "llvmpipe",
"GALLIUM_DRIVER": "llvmpipe",
"WAYLAND_DISPLAY": "",
"WAYLAND_SOCKET": "",
"XDG_RUNTIME_DIR": "",
"GDK_BACKEND": "x11",
"SDL_BACKEND": "x11",
"GLFW_PLATFORM": "x11",
"DISPLAY": ":99"
},
"postCreateCommand": "bash .devcontainer/scripts/setup.sh",
"postStartCommand": "bash .devcontainer/scripts/start-desktop.sh",
"customizations": {
"vscode": {
"settings": {
"workbench.colorTheme": "GitHub Dark Dimmed"
}

}
}
}
25 changes: 25 additions & 0 deletions .devcontainer/gpu-nvidia/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "jME env (NVIDIA)",
"build": {
"dockerfile": "../Dockerfile",
"context": ".."
},
"runArgs": [
"--gpus=all"
],
"containerEnv": {
"LIBGL_ALWAYS_SOFTWARE": "0",
"NVIDIA_VISIBLE_DEVICES": "all",
"NVIDIA_DRIVER_CAPABILITIES": "graphics,utility,compute",
"__GL_THREADED_OPTIMIZATIONS": "0",
"JME3_DIALOGS_FACTORY": ""
},
"postCreateCommand": "bash .devcontainer/scripts/setup.sh",
"customizations": {
"vscode": {
"settings": {
"workbench.colorTheme": "GitHub Dark Dimmed"
}
}
}
}
24 changes: 24 additions & 0 deletions .devcontainer/gup-soft/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "jME env",
"build": {
"dockerfile": "../Dockerfile",
"context": ".."
},
"runArgs": [
"--device=/dev/dri",
"--group-add=video",
"--group-add=render"
],
"containerEnv": {
"LIBGL_ALWAYS_SOFTWARE": "0",
"JME3_DIALOGS_FACTORY": ""
},
"postCreateCommand": "bash .devcontainer/scripts/setup.sh",
"customizations": {
"vscode": {
"settings": {
"workbench.colorTheme": "GitHub Dark Dimmed"
}
}
}
}
8 changes: 8 additions & 0 deletions .devcontainer/scripts/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail


# Optional: warm Gradle wrapper so first run is less painful
if [ -f ./gradlew ]; then
./gradlew --version || true
fi
70 changes: 70 additions & 0 deletions .devcontainer/scripts/start-desktop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/usr/bin/env bash
set -euo pipefail
if [ "$JME_DEV_ENVIRONMENT" != "yesReally" ];
then
echo "Not running! This script is meant to be run in the jMonkeyEngine dev container environment, and may do unexpected things if run elsewhere."
exit 1
fi

export DISPLAY="${DISPLAY:-:99}"
unset WAYLAND_DISPLAY WAYLAND_SOCKET XDG_RUNTIME_DIR
export GDK_BACKEND=x11
export SDL_VIDEODRIVER=x11
export GLFW_PLATFORM=x11

# Fedora noVNC web root path
NOVNC_WEB="/usr/share/novnc"
if [ ! -d "$NOVNC_WEB" ]; then
echo "ERROR: noVNC web root not found at $NOVNC_WEB"
echo "Try checking where novnc installed files are:"
rpm -ql novnc | sed -n '1,120p' || true
exit 1
fi

# Start virtual X server
if ! pgrep -f "Xvfb ${DISPLAY}" >/dev/null 2>&1; then
nohup Xvfb "${DISPLAY}" -screen 0 1440x900x24 +extension GLX +render -noreset >/tmp/xvfb.log 2>&1 &
fi

# Start a dbus session (XFCE wants it)
if ! pgrep -u "$(id -u)" -f "dbus-daemon.*--session" >/dev/null 2>&1; then
# shellcheck disable=SC2046
eval "$(dbus-launch --sh-syntax)"
fi



if [ "$JME_DEV_ENVIRONMENT" != "yesReally" ];
then
echo "Not running! This script is meant to be run in the jMonkeyEngine dev container environment, and may do unexpected things if run elsewhere."
exit 1
fi

# Init home
mkdir -p "$HOME/.config" "$HOME/.cache" "$HOME/.local/share"


# Start window manager
if ! pgrep -u "$(id -u)" -x xfwm4 >/dev/null 2>&1; then
nohup xfwm4 --compositor=off --daemon >/tmp/xfwm4.log 2>&1 &
fi


# Start XFCE session
if ! pgrep -u "$(id -u)" -x xfce4-session >/dev/null 2>&1; then
nohup xfce4-session >/tmp/xfce4-session.log 2>&1 &
fi

# Set wallpaper
feh --no-fehbg --bg-fill "/root/wallpaper.jpg"

# Start VNC server (no password; fine for Codespaces)
if ! pgrep -f "x11vnc.*-rfbport 5900" >/dev/null 2>&1; then
nohup x11vnc -display "${DISPLAY}" -nopw -forever -shared -cursor arrow -rfbport 5900 >/tmp/x11vnc.log 2>&1 &
fi

# Start noVNC (websockify)
if ! pgrep -f "websockify.*6080" >/dev/null 2>&1; then
python3 -m websockify --web="${NOVNC_WEB}" 6080 localhost:5900
fi

21 changes: 0 additions & 21 deletions .github/workflows/format.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,5 @@ javadoc_deploy.pub
!.vscode/settings.json
!.vscode/JME_style.xml
!.vscode/extensions.json
!.vscode/java.code-snippets
joysticks-*.txt
17 changes: 12 additions & 5 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
{
"recommendations": [
"vscjava.vscode-java-pack",
"slevesque.shader"
]
}
"recommendations": [
"vscjava.vscode-java-pack",
"slevesque.shader",
// "github.vscode-github-actions",
"Anthropic.claude-code",
"ms-vscode-remote.remote-containers",
// "GitHub.codespaces",
"GitHub.copilot-chat",
"ms-vscode.remote-server",
// "HarryHopkinson.vim-theme"
]
}
54 changes: 54 additions & 0 deletions .vscode/java.code-snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{

"logger":{
"prefix":"logger",
"body": [
"private static final java.util.logging.Logger logger = java.util.logging.Logger.getLogger(${1:${TM_FILENAME_BASE}}.class.getName());"
],
"description":"Add java.util Logger"
},
"log":{
"prefix": "log",
"body":[
"if(logger.isLoggable(java.util.logging.Level.$1 )){\n\tlogger.log(java.util.logging.Level.$1, \"$2\");\n}"
],

},
"logfinest":{
"prefix": "logfinest",
"body":[
"logger.finest($1);"
]
},
"logfiner":{
"prefix": "logfiner",
"body":[
"logger.finer($1);"
]
},
"logfine":{
"prefix": "logfine",
"body":[
"logger.fine($1);"
]
},
"loginfo":{
"prefix": "loginfo",
"body":[
"logger.info($1);"
]
},
"logwarning":{
"prefix": "logwarning",
"body":[
"logger.warning($1);"
]
},
"logsevere":{
"prefix": "logsevere",
"body":[
"logger.severe($1);"
]
}

}
12 changes: 3 additions & 9 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
{
"java.configuration.updateBuildConfiguration": "automatic",
"java.compile.nullAnalysis.mode": "automatic",
"java.refactor.renameFromFileExplorer": "prompt",
"java.format.settings.url": "./.vscode/JME_style.xml",
"editor.formatOnPaste": true,
"editor.formatOnPaste": false,
"editor.formatOnType": false,
"editor.formatOnSave": true,
"editor.formatOnSaveMode": "modifications" ,

"prettier.tabWidth": 4,
"prettier.printWidth": 110,
"prettier.enable": true,
"prettier.resolveGlobalModules": true
"editor.formatOnSave": false,
"editor.formatOnSaveMode": "modifications",
}
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ private void initOpenAL() {
if (!alc.isCreated()) {
alc.createALC();
}
} catch (UnsatisfiedLinkError ex) {
} catch (Exception ex) {
logger.log(Level.SEVERE, "Failed to load audio library (OpenAL). Audio will be disabled.", ex);
audioDisabled = true;
return;
Expand Down
8 changes: 4 additions & 4 deletions jme3-core/src/main/java/com/jme3/system/AppSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -296,12 +296,12 @@ public final class AppSettings extends HashMap<String, Object> {
static {
defaults.put("Display", 0);
defaults.put("CenterWindow", true);
defaults.put("Width", 640);
defaults.put("Height", 480);
defaults.put("Width", 1440);
defaults.put("Height", 900);
defaults.put("WindowWidth", Integer.MIN_VALUE);
defaults.put("WindowHeight", Integer.MIN_VALUE);
defaults.put("BitsPerPixel", 24);
defaults.put("Frequency", 60);
defaults.put("Frequency", 0);
defaults.put("DepthBits", 24);
defaults.put("StencilBits", 0);
defaults.put("Samples", 0);
Expand All @@ -317,7 +317,7 @@ public final class AppSettings extends HashMap<String, Object> {
defaults.put("MinHeight", 0);
defaults.put("MinWidth", 0);
defaults.put("GammaCorrection", true);
defaults.put("Resizable", false);
defaults.put("Resizable", true);
defaults.put("SwapBuffers", true);
defaults.put("OpenCL", false);
defaults.put("OpenCLPlatformChooser", DefaultPlatformChooser.class.getName());
Expand Down
Loading