GithubHelp home page GithubHelp logo

lwjgl / lwjgl3-www Goto Github PK

View Code? Open in Web Editor NEW
105.0 105.0 23.0 14.55 MB

The LWJGL 3 website.

Home Page: https://www.lwjgl.org

License: BSD 3-Clause "New" or "Revised" License

HTML 2.84% JavaScript 15.34% Dockerfile 0.38% TypeScript 77.11% Java 0.53% Shell 0.45% SCSS 3.00% Pug 0.35%
babel lwjgl react stitches typescript webpack

lwjgl3-www's Introduction

[LEGACY] LWJGL - Lightweight Java Game Library

WARNING

This is the repository of the original LWJGL, which is no longer actively maintained. Unless you have released a product that uses LWJGL 2.x, you should probably be looking at LWJGL 3.

The Lightweight Java Game Library (LWJGL) is a solution aimed directly at professional and amateur Java programmers alike to enable commercial quality games to be written in Java. LWJGL provides developers access to high performance crossplatform libraries such as OpenGL (Open Graphics Library), OpenCL (Open Computing Language) and OpenAL (Open Audio Library) allowing for state of the art 3D games and 3D sound. Additionally LWJGL provides access to controllers such as Gamepads, Steering wheel and Joysticks. All in a simple and straight forward API.

Website: http://legacy.lwjgl.org Forum: http://forum.lwjgl.org Bugs/Suggestions: https://github.com/LWJGL/lwjgl/issues

Compilation

LWJGL requires a JDK and Ant installed to compile, as well as your platforms native compiler to compile the JNI.

  • ant generate-all
  • ant compile
  • ant compile_native

lwjgl3-www's People

Contributors

apostolos avatar dependabot[bot] avatar elect86 avatar erievs avatar fabiitch avatar flyme2bluemoon avatar fortressbuilder avatar freso avatar httpdigest avatar landis22b avatar renovate-bot avatar renovate[bot] avatar silvertiger avatar sixcorners avatar spasi avatar themrmilchmann avatar zackmurry avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lwjgl3-www's Issues

Provide an option to generate a complete pom.xml/build.gradle

Every once in a while, people are tripped over by the fact that the customizer https://www.lwjgl.org/customize (when in Maven or Gradle mode) does not generate a complete script that would work out of the box. Those generated scripts are rather meant to be pasted into an existing skeleton pom.xml/build.gradle file.

However, people new to both LWJGL and Maven/Gradle who simply want to try things out, would probably prefer a complete/working pom.xml/build.gradle file.

This issue is related to: LWJGL/lwjgl3-wiki#7

OpenVR bindings for Windows x86

When I tried to generate a build.gradle for file using OpenVR bindings on Windows x86 with the build configurator (https://www.lwjgl.org/customize), the OpenVR checkbox got disabled when I selected the Windows x86 natives (see the screenshot I made).
openvrx86

But why is that? It seems that such natives for Windows x86 are just available when I manually add it to the build.gradle and build it (the natives are just in the produced jar when I open it with an archive manager).

Questionable customized Gradle build script with Windows

In the customize page with Gradle mode and both Windows x64 and Windows arm64 natives selected, we get:

switch (OperatingSystem.current()) {
	case OperatingSystem.WINDOWS:
		def osArch = System.getProperty("os.arch")
		project.ext.lwjglNatives = osArch.contains("64")
			? "natives-windows${osArch.startsWith("aarch64") ? "-arm64" : ""}"
			: "natives-windows-x86"
		break
}

Why the last branch contains "natives-windows-x86"? Shouldn't it be just "natives-windows"?

Prompt to update service worker

Service worker updating behavior is not appropriate for a project like LWJGL. Library users usually visit the site whenever a new update comes out. Therefore it is highly likely that on their repeat visit an old version of the site will still be active (SW only updates the site after the last tab closes or with a hard-refresh).

We need to prompt the user to force installation of the new SW version and update the page immediately.

Replace the dyncall 'feature' text

When 3.2.3 arrives, it deprecates dyncall in favor of libffi. A simple text replacement would do. Putting this here so it's not forgotten.

Customization & Utilities
Use dyncall to call functions from any native library, use jemalloc for efficient and tunable memory management, use the stb collection of libraries for texture loading, font rendering and much more.

lwjgl.org displays "Loading..." on Safari

The page currently looks like this:

image

The problem seems to be the compiled javascript code:

image

I'm currently using Safari 13.0.5 on MacOS Mojave:

image

I have already deleted cache, and tried lading the page on incognito mode for better measure

build.gradle.kts generation creates a script that puts natives-linux on the windows classpath

When you generate a kts gradle build file the lwjglNatives script gives windows people linux binaries.

\t\t\t"natives-linux\${if (it.startsWith("aarch64")) "-arm64" else ""}"

val lwjglNatives = when (OperatingSystem.current()) {
	OperatingSystem.LINUX   -> System.getProperty("os.arch").let {
		if (it.startsWith("arm") || it.startsWith("aarch64"))
			"natives-linux-${if (it.contains("64") || it.startsWith("armv8")) "arm64" else "arm32"}"
		else
			"natives-linux"
	}
	OperatingSystem.MAC_OS  -> "natives-macos"
	OperatingSystem.WINDOWS -> System.getProperty("os.arch").let {
		if (it.contains("64"))
			"natives-linux${if (it.startsWith("aarch64")) "-arm64" else ""}"
		else
			"natives-linux-x86"
	}
	else -> throw Error("Unrecognized or unsupported Operating system. Please set \"lwjglNatives\" manually")
}

Include natives for all platforms in generated build files

When using the build configurator to create a gradle build file with only the core of LWJGL, it will generate the following file:

import org.gradle.internal.os.OperatingSystem

project.ext.lwjglVersion = "3.2.3"

switch (OperatingSystem.current()) {
	case OperatingSystem.LINUX:
		def osArch = System.getProperty("os.arch")
		project.ext.lwjglNatives = osArch.startsWith("arm") || osArch.startsWith("aarch64")
			? "natives-linux-${osArch.contains("64") || osArch.startsWith("armv8") ? "arm64" : "arm32"}"
			: "natives-linux"
		break
	case OperatingSystem.MAC_OS:
		project.ext.lwjglNatives = "natives-macos"
		break
	case OperatingSystem.WINDOWS:
		project.ext.lwjglNatives = System.getProperty("os.arch").contains("64") ? "natives-windows" : "natives-windows-x86"
		break
}

repositories {
	mavenCentral()
}

dependencies {
	implementation platform("org.lwjgl:lwjgl-bom:$lwjglVersion")

	implementation "org.lwjgl:lwjgl"
	runtimeOnly "org.lwjgl:lwjgl::$lwjglNatives"
}

This uses a big switch statement to pick the natives for the current operating system. This is nice for development runs, but horrible when distributing with something like shadowJar: it will generate a fat jar file containing only the natives of the operating system that built it. This would cause the jar to work very well on the machine of the developer, but fail on any machine with a different operating system or architecture due to missing natives. If the developer doesn't open it up with an archive manager or tests on a different machine, he wouldn't even find out.

I would instead generate a file like this:

project.ext.lwjglVersion = "3.2.3"

repositories {
	mavenCentral()
}

dependencies {
	implementation platform("org.lwjgl:lwjgl-bom:$lwjglVersion")

	implementation "org.lwjgl:lwjgl"
	runtimeOnly "org.lwjgl:lwjgl::natives-windows"
	runtimeOnly "org.lwjgl:lwjgl::natives-windows-x86"
	runtimeOnly "org.lwjgl:lwjgl::natives-linux"
	runtimeOnly "org.lwjgl:lwjgl::natives-linux-arm32"
	runtimeOnly "org.lwjgl:lwjgl::natives-linux-arm64"
	runtimeOnly "org.lwjgl:lwjgl::natives-macos"
}

With this file, the natives for all operating systems will always be included, regardless on which operating system it is built. If shadowJar would be used on such a build file, the produced jar file will contain all natives and therefor work on all supported platforms. I would consider this more the Java way to do things.

This example was just for gradle, but similar arguments should hold for the other supported build systems as well. Note: If there is a better than way than shadowJar to distribute lwjgl applications, please let me know!

Remember previously selected configuration

should store previous selection and restore automatically on subsequent visits.

We could use localStorage to save selection as JSON. However, because localStorage is synchronous (has to flush to the disk), it may add unnecessary UI lag. Investigate alternatives.

Download customize form unexpected behaviour

Browser: Firefox Quantum (64-bit) 58.0.1

To reproduce:
On website, go 'download' page > 'customize LWJGL 3' > Enable 'Gradle' > Enable 'Custom'. Add any of the libraries/frameworks.

Expected Behavior:
The library/framework checkbox should be highlighted

Actual Behavior:
The checkbox does not highlight. The preset jumps from 'custom' to 'getting started' (Or whatever it was set at before 'custom').

Here is a GIF showing the problem.

ZIP generation is broken

Uncaught (in promise) TypeError: Object(...) is not a function
    at n.<anonymous> (route-customize.e765c99cd71304b187eb8f910ff31fc3.js:1)

Possibly incompatible Gradle script: No signature of method

Copying the Gradle code provided on the customize page I get the following error:

No signature of method: static org.gradle.nativeplatform.platform.OperatingSystem.current() is applicable for argument types: () values: []

As the error states, this happens in the first line of the switch statement generating the name of the native files.

My environment:

  • Java 17.0.2 (from Adoptium.net)
  • Gradle 7.3.3
  • IntelliJ IDEA Ultimate 2021.1.1

What If I enable mangling process?

Do you know what causes the following error when I enable mangling? Won't it be possible to accomplish mangling with a specific options? I'm asking because after your webpack and process-manifest.js updates, my total bundle size increased by 30Kb (gzipped).

screen shot 2017-09-08 at 11 25 15 am

https://github.com/LWJGL/lwjgl3-www/blob/master/scripts/process-manifest.js#L121-L133

Additinal Question: Should I open another issue about that I can't see the exact location of the errors even if I define devtool prop in webpack config (sourcemap)? I'm also trying to figure out that case. I may send pr If I can.

Mention "-XstartOnFirstThread" requirement for macOS in "Get Started"

On macOS the JVM must be started with the -XstartOnFirstThread argument for GLFW to work. This is necessary because most GLFW functions must be called on the main thread and the Cocoa API on macOS requires that thread to be the first thread in the process. For this reason, on-screen GLFW windows and the GLFW event loop are incompatible with other window toolkits (such as AWT/Swing or JavaFX) on macOS. Off-screen GLFW windows can be used with other window toolkits, but only if the window toolkit is initialized before GLFW.

https://javadoc.lwjgl.org/org/lwjgl/glfw/package-summary.html

Issues in which the -XstartOnFirstThread flag is missing and consequently the JVM crashing are commonly raised in the forum, StackOverflow and on GitHub. While the requirement is documented in many places, the "Get Started" section on the website does not mention the flag at all. In my opinion, it is reasonable to expect users to read a bit of documentation but I doubt that added visibility could inflict any harm.

It is also worth noting that there are some existing checks for this in LWJGL. (See EventLoop.) However, as recent reports have shown they are somewhat unreliable and may break on some macOS versions, leaving the user clueless. [lwjgl3#538]

Add 'Unsupported Platforms' note to some bindings

As LWJGL begins to support macOS ARM64 and Windows ARM64 (and potentially more in the future), listing supported platforms for a binding can be unhelpful. It becomes too long if it supports most platforms. Making a note of unsupported platforms would make it easier to read.

Eg. bgfx:
image
becomes
image

Eg. Meow hash:
image
becomes
image

Shorter lists of supported platforms would remain:
image

Generator dependency issue with gradle

Using the generator from https://www.lwjgl.org/download to create a build.gradle file i get this configuration:

import org.gradle.internal.os.OperatingSystem

switch ( OperatingSystem.current() ) {
	case OperatingSystem.WINDOWS:
		project.ext.lwjglNatives = "natives-windows"
		break
	case OperatingSystem.LINUX:
		project.ext.lwjglNatives = "natives-linux"
	break
	case OperatingSystem.MAC_OS:
		project.ext.lwjglNatives = "natives-macos"
		break
}

project.ext.lwjglVersion = "3.1.2"

repositories {
	mavenCentral()
}

dependencies {
	compile "org.lwjgl:lwjgl:${lwjglVersion}"
	compile "org.lwjgl:lwjgl-assimp:${lwjglVersion}"
	compile "org.lwjgl:lwjgl-bgfx:${lwjglVersion}"
	compile "org.lwjgl:lwjgl-egl:${lwjglVersion}"
	compile "org.lwjgl:lwjgl-glfw:${lwjglVersion}"
	compile "org.lwjgl:lwjgl-jawt:${lwjglVersion}"
	compile "org.lwjgl:lwjgl-jemalloc:${lwjglVersion}"
	compile "org.lwjgl:lwjgl-lmdb:${lwjglVersion}"
	compile "org.lwjgl:lwjgl-nanovg:${lwjglVersion}"
	compile "org.lwjgl:lwjgl-nfd:${lwjglVersion}"
	compile "org.lwjgl:lwjgl-nuklear:${lwjglVersion}"
	compile "org.lwjgl:lwjgl-openal:${lwjglVersion}"
	compile "org.lwjgl:lwjgl-opencl:${lwjglVersion}"
	compile "org.lwjgl:lwjgl-opengl:${lwjglVersion}"
	compile "org.lwjgl:lwjgl-opengles:${lwjglVersion}"
	compile "org.lwjgl:lwjgl-openvr:${lwjglVersion}"
	compile "org.lwjgl:lwjgl-ovr:${lwjglVersion}"
	compile "org.lwjgl:lwjgl-par:${lwjglVersion}"
	compile "org.lwjgl:lwjgl-sse:${lwjglVersion}"
	compile "org.lwjgl:lwjgl-stb:${lwjglVersion}"
	compile "org.lwjgl:lwjgl-tinyexr:${lwjglVersion}"
	compile "org.lwjgl:lwjgl-tinyfd:${lwjglVersion}"
	compile "org.lwjgl:lwjgl-vulkan:${lwjglVersion}"
	compile "org.lwjgl:lwjgl-xxhash:${lwjglVersion}"
	compile "org.lwjgl:lwjgl-yoga:${lwjglVersion}"
	runtime "org.lwjgl:lwjgl:${lwjglVersion}:${lwjglNatives}"
	runtime "org.lwjgl:lwjgl-assimp:${lwjglVersion}:${lwjglNatives}"
	runtime "org.lwjgl:lwjgl-bgfx:${lwjglVersion}:${lwjglNatives}"
	runtime "org.lwjgl:lwjgl-glfw:${lwjglVersion}:${lwjglNatives}"
	runtime "org.lwjgl:lwjgl-jemalloc:${lwjglVersion}:${lwjglNatives}"
	runtime "org.lwjgl:lwjgl-lmdb:${lwjglVersion}:${lwjglNatives}"
	runtime "org.lwjgl:lwjgl-nanovg:${lwjglVersion}:${lwjglNatives}"
	runtime "org.lwjgl:lwjgl-nfd:${lwjglVersion}:${lwjglNatives}"
	runtime "org.lwjgl:lwjgl-nuklear:${lwjglVersion}:${lwjglNatives}"
	runtime "org.lwjgl:lwjgl-openal:${lwjglVersion}:${lwjglNatives}"
	runtime "org.lwjgl:lwjgl-opengl:${lwjglVersion}:${lwjglNatives}"
	runtime "org.lwjgl:lwjgl-opengles:${lwjglVersion}:${lwjglNatives}"
	runtime "org.lwjgl:lwjgl-openvr:${lwjglVersion}:${lwjglNatives}"
	runtime "org.lwjgl:lwjgl-ovr:${lwjglVersion}:${lwjglNatives}"
	runtime "org.lwjgl:lwjgl-par:${lwjglVersion}:${lwjglNatives}"
	runtime "org.lwjgl:lwjgl-sse:${lwjglVersion}:${lwjglNatives}"
	runtime "org.lwjgl:lwjgl-stb:${lwjglVersion}:${lwjglNatives}"
	runtime "org.lwjgl:lwjgl-tinyexr:${lwjglVersion}:${lwjglNatives}"
	runtime "org.lwjgl:lwjgl-tinyfd:${lwjglVersion}:${lwjglNatives}"
	runtime "org.lwjgl:lwjgl-xxhash:${lwjglVersion}:${lwjglNatives}"
	runtime "org.lwjgl:lwjgl-yoga:${lwjglVersion}:${lwjglNatives}"
}

running gradle build I get the following error:

Could not resolve all files for configuration ':runtimeClasspath'.
> Could not find lwjgl-ovr-natives-linux.jar (org.lwjgl:lwjgl-ovr:3.1.2).
  Searched in the following locations:
      https://repo1.maven.org/maven2/org/lwjgl/lwjgl-ovr/3.1.2/lwjgl-ovr-3.1.2-natives-linux.jar

I can make the build successful changing runtime "org.lwjgl:lwjgl-ovr:${lwjglVersion}:${lwjglNatives}" to runtime "org.lwjgl:lwjgl-ovr:${lwjglVersion}".
Is this the correct dependency?

Option to download a single merged JAR file instead of ZIP file with many JARs

  • Investigate using JSZIP to read the dir/file structure of each downloaded jar and extract the contents
  • Merge dir/file structure to a single tree
  • Merge should ignore META-INF folders
    • Other potential conflicts?
  • ZIP the final bundle and download as .jar
  • Potential output:
    • A single JAR file with everything
    • A ZIP file with two JAR files inside it. One for classes and one for natives
    • A ZIP file with a JAR for classes and one JAR per platform for natives

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.