mirror of
https://github.com/leaningtech/javafiddle.git
synced 2025-09-04 19:32:26 +00:00
removed LWJGL
This commit is contained in:

committed by
Alessandro Pignotti

parent
45e932dc83
commit
a7ce8659f5
@@ -10,7 +10,6 @@
|
||||
async function startCheerpj() {
|
||||
await cheerpjInit({
|
||||
status: 'none',
|
||||
javaProperties: ['java.library.path=/app/cheerpj-natives/natives']
|
||||
});
|
||||
const display = document.getElementById("output");
|
||||
cheerpjCreateDisplay(-1, -1, display);
|
||||
@@ -24,7 +23,7 @@
|
||||
cjConsole.innerHTML = '';
|
||||
cjOutput.innerHTML = '';
|
||||
|
||||
const classPath = '/app/tools.jar:/app/lwjgl-2.9.0.jar:/app/lwjgl_util-2.9.0.jar:/files/';
|
||||
const classPath = '/app/tools.jar:/files/';
|
||||
const sourceFiles = $files.map((file) => '/str/' + file.path);
|
||||
const code = await cheerpjRunMain(
|
||||
'com.sun.tools.javac.Main',
|
||||
|
@@ -5,9 +5,6 @@
|
||||
import Loading from '$lib/Loading.svelte';
|
||||
|
||||
let cjConsole: HTMLPreElement;
|
||||
let lwjglCanvas: HTMLCanvasElement;
|
||||
|
||||
$: if (lwjglCanvas) window.lwjglCanvasElement = lwjglCanvas;
|
||||
</script>
|
||||
|
||||
<div class="w-full h-full" class:hidden={!$isRunning}>
|
||||
@@ -35,7 +32,6 @@
|
||||
<section class="flex flex-col">
|
||||
<div class="p-3 text-stone-500 text-sm select-none">Result</div>
|
||||
<div class="grow relative" id="output">
|
||||
<canvas bind:this={lwjglCanvas} class="absolute inset-0 w-full h-full" />
|
||||
<!-- #cheerpjDisplay will be inserted here -->
|
||||
</div>
|
||||
</section>
|
||||
|
Submodule static/cheerpj-natives deleted from 1b43167084
@@ -1,46 +0,0 @@
|
||||
// Example using LWJGL 2.9.0
|
||||
// Warning: experimental!
|
||||
|
||||
import org.lwjgl.LWJGLException;
|
||||
import org.lwjgl.opengl.Display;
|
||||
import org.lwjgl.opengl.DisplayMode;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
Display.setDisplayMode(new DisplayMode(800, 600));
|
||||
Display.setTitle("Triangle Example");
|
||||
Display.create();
|
||||
} catch (LWJGLException e) {
|
||||
e.printStackTrace();
|
||||
System.exit(1);
|
||||
}
|
||||
|
||||
// Initialize OpenGL
|
||||
GL11.glMatrixMode(GL11.GL_PROJECTION);
|
||||
GL11.glLoadIdentity();
|
||||
GL11.glOrtho(0, 800, 0, 600, 1, -1);
|
||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
|
||||
while (!Display.isCloseRequested()) {
|
||||
// Clear the screen
|
||||
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
// Draw a triangle
|
||||
GL11.glBegin(GL11.GL_TRIANGLES);
|
||||
GL11.glColor3f(1.0f, 0.0f, 0.0f); // Red
|
||||
GL11.glVertex2f(400, 100);
|
||||
GL11.glColor3f(0.0f, 1.0f, 0.0f); // Green
|
||||
GL11.glVertex2f(100, 500);
|
||||
GL11.glColor3f(0.0f, 0.0f, 1.0f); // Blue
|
||||
GL11.glVertex2f(700, 500);
|
||||
GL11.glEnd();
|
||||
|
||||
Display.update();
|
||||
}
|
||||
|
||||
Display.destroy();
|
||||
}
|
||||
|
||||
}
|
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user