Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move from JOGL to LWJGL #103

Open
wants to merge 60 commits into
base: master
Choose a base branch
from
Open

Move from JOGL to LWJGL #103

wants to merge 60 commits into from

Conversation

tsmock
Copy link
Contributor

@tsmock tsmock commented Feb 15, 2022

This primarily converts the codebase to LWJGL (there is now a LWJGL plugin for JOSM).

This fixes #76, #97, #101, #21273, #21348, and (probably) #16782.

As this moves the plugin off of JOGL, this also fixes #95, #96

Known issues:

  • Roof textures are overridden by roof colours

A good chunk of changes are in https://github.com/kendzi/kendzi3d/pull/103/files/d2db2a26d7955b43eaf1acc7c0993e9fcff41174 -- this is pretty much just a consistency change.

@tsmock tsmock force-pushed the build-fixes branch 3 times, most recently from ddabc80 to 0009311 Compare February 22, 2022 18:43
Signed-off-by: Taylor Smock <[email protected]>
Signed-off-by: Taylor Smock <[email protected]>
Signed-off-by: Taylor Smock <[email protected]>
Signed-off-by: Taylor Smock <[email protected]>
Signed-off-by: Taylor Smock <[email protected]>
This adds a NOTICE file that should be included in binary distributions.

All classes from JOGL have a @deprecated mark -- these should be moved
off of as time allows.

Signed-off-by: Taylor Smock <[email protected]>
tsmock added 16 commits March 16, 2022 14:39
Signed-off-by: Taylor Smock <[email protected]>
Signed-off-by: Taylor Smock <[email protected]>
Also update the excludes for plugin assembly

Signed-off-by: Taylor Smock <[email protected]>
@mikedld
Copy link

mikedld commented Aug 21, 2022

Hi, great work! I was thinking of maybe doing this myself (not that I'm much into Java programming) but then noticed this PR. Tried building and trying it out with current JOSM but it's still crashing, although obviously not the same way as when JOGL was used:

-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Process:               JOSM [88439]
Path:                  /Applications/JOSM.app/Contents/MacOS/JOSM
Identifier:            de.openstreetmap.josm
Version:               18531 (18531)
Code Type:             X86-64 (Translated)
Parent Process:        zsh [75799]
Responsible:           iTerm2 [8092]
User ID:               501

Date/Time:             2022-08-21 03:52:22.8987 +0100
OS Version:            macOS 12.4 (21F79)
Report Version:        12
Anonymous UUID:        B9BAC342-0768-4E92-C422-4CAF908CDDB6

Sleep/Wake UUID:       C432E851-BCB7-422A-AC28-4EA8E6D242C2

Time Awake Since Boot: 2100000 seconds
Time Since Wake:       20399 seconds

System Integrity Protection: enabled

Crashed Thread:        36  Java: AWT-EventQueue-0

Exception Type:        EXC_BAD_ACCESS (SIGABRT)
Exception Codes:       KERN_INVALID_ADDRESS at 0x3f8000003f800000 -> 0xffff80003f800000 (possible pointer authentication failure)
Exception Codes:       0x0000000000000001, 0x3f8000003f800000
Exception Note:        EXC_CORPSE_NOTIFY

VM Region Info: 0xffff80003f800000 is not in any region.  Bytes after previous region: 18446462617715851265  
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      mapped file              7ffba6580000-7ffbd4064000 [730.9M] r-x/r-x SM=COW  ...t_id=2aab273f
--->  
      UNUSED SPACE AT END

Application Specific Information:
-[NSOpenGLContext setView:] must be called from the main thread.

... snip ...

Thread 36 Crashed:: Java: AWT-EventQueue-0
0   ???                           	    0x7ff8a6676940 ???
1   libsystem_kernel.dylib        	    0x7ff8160c700e __pthread_kill + 10
2   libsystem_pthread.dylib       	    0x7ff8160fd1ff pthread_kill + 263
3   libsystem_c.dylib             	    0x7ff816048d24 abort + 123
4   libjvm.dylib                  	       0x10a26d6d1 os::abort(bool, void*, void const*) + 49
5   libjvm.dylib                  	       0x10a4d1de8 VMError::report_and_die(int, char const*, char const*, __va_list_tag*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long) + 2968
6   libjvm.dylib                  	       0x10a4d1225 VMError::report_and_die(Thread*, unsigned int, unsigned char*, void*, void*, char const*, ...) + 149
7   libjvm.dylib                  	       0x10a4d1e91 VMError::report_and_die(Thread*, unsigned int, unsigned char*, void*, void*) + 33
8   libjvm.dylib                  	       0x10a39a6f9 JVM_handle_bsd_signal + 377
9   libsystem_platform.dylib      	    0x7ff816112dfd _sigtramp + 29
10  ???                           	    0x600000f5c581 ???
11  dyld                          	       0x2003935ee dyld4::APIs::setErrorString(char const*, ...) + 378
12  dyld                          	       0x2003717a8 dyld3::ScopedTimer::endTimer() + 46
13  dyld                          	       0x200395008 dyld4::APIs::dlsym(void*, char const*) + 1596
14  libsystem_c.dylib             	    0x7ff8160478be _os_crash + 43
15  AppKit                        	    0x7ff818e7b8f4 -[NSOpenGLContext setView:] + 189
16  AppKit                        	    0x7ff8191eb8b3 -[_NSOpenGLViewBackingLayer display] + 536
17  QuartzCore                    	    0x7ff81d6fd8db CA::Layer::display_if_needed(CA::Transaction*) + 873
18  QuartzCore                    	    0x7ff81d8543ce CA::Context::commit_transaction(CA::Transaction*, double, double*) + 640
19  QuartzCore                    	    0x7ff81d6def51 CA::Transaction::commit() + 777
20  ???                           	       0x11042b365 ???
21  ???                           	       0x11042735c ???
22  ???                           	       0x11042742b ???
23  ???                           	       0x1104277c0 ???
24  ???                           	       0x11042742b ???
25  ???                           	       0x11042742b ???
26  ???                           	       0x110b2099c ???
27  ???                           	       0x11042742b ???
28  ???                           	       0x11042742b ???
29  ???                           	       0x11042742b ???
30  ???                           	       0x11042742b ???
31  ???                           	       0x11041ecc7 ???
32  libjvm.dylib                  	       0x109ed6896 JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*) + 710
33  libjvm.dylib                  	       0x109ed58e7 JavaCalls::call_virtual(JavaValue*, Klass*, Symbol*, Symbol*, JavaCallArguments*, JavaThread*) + 327
34  libjvm.dylib                  	       0x109ed59b3 JavaCalls::call_virtual(JavaValue*, Handle, Klass*, Symbol*, Symbol*, JavaThread*) + 99
35  libjvm.dylib                  	       0x109f820d4 thread_entry(JavaThread*, JavaThread*) + 180
36  libjvm.dylib                  	       0x10a459ebf JavaThread::thread_main_inner() + 335
37  libjvm.dylib                  	       0x10a45823a Thread::call_run() + 282
38  libjvm.dylib                  	       0x10a265688 thread_native_entry(Thread*) + 328
39  libsystem_pthread.dylib       	    0x7ff8160fd4e1 _pthread_start + 125
40  libsystem_pthread.dylib       	    0x7ff8160f8f6b thread_start + 15

... snip ...
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGILL (0x4) at pc=0x00007ff818e7b8f4, pid=88439, tid=89423
#
# JRE version: OpenJDK Runtime Environment Zulu17.36+13-CA (17.0.4+8) (build 17.0.4+8-LTS)
# Java VM: OpenJDK 64-Bit Server VM Zulu17.36+13-CA (17.0.4+8-LTS, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-amd64)
# Problematic frame:
# C  [AppKit+0x3838f4]  -[NSOpenGLContext setView:]+0xbd
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please visit:
#   http://www.azul.com/support/
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

---------------  S U M M A R Y ------------

Command Line: -Djpackage.app-version=18531 --add-modules=java.scripting,java.sql,javafx.controls,javafx.media,javafx.swing,javafx.web --add-exports=java.base/sun.security.action=ALL-UNNAMED --add-exports=java.desktop/com.apple.eawt=ALL-UNNAMED --add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED --add-exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED --add-opens=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens=java.desktop/javax.imageio.spi=ALL-UNNAMED --add-opens=java.desktop/javax.swing.text.html=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED -Djpackage.app-path=/Applications/JOSM.app/Contents/MacOS/JOSM org.openstreetmap.josm.gui.MainApplication

Host: "MacBookPro18,3" x86_64 (EMULATED) 2400 MHz, 10 cores, 16G, Darwin 21.5.0, macOS 10.16 (21F79)
Time: Sun Aug 21 03:52:22 2022 WEST elapsed time: 78.691908 seconds (0d 0h 1m 18s)

---------------  T H R E A D  ---------------

Current thread (0x00007f927ec67000):  JavaThread "AWT-EventQueue-0" [_thread_in_native, id=89423, stack(0x0000000306815000,0x0000000306915000)]

Stack: [0x0000000306815000,0x0000000306915000],  sp=0x00000003069129a0,  free space=1014k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [AppKit+0x3838f4]  -[NSOpenGLContext setView:]+0xbd
C  [AppKit+0x6f38b3]  -[_NSOpenGLViewBackingLayer display]+0x218
C  [QuartzCore+0x208db]  CA::Layer::display_if_needed(CA::Transaction*)+0x369
C  [QuartzCore+0x1773ce]  CA::Context::commit_transaction(CA::Transaction*, double, double*)+0x280
C  [QuartzCore+0x1f51]  CA::Transaction::commit()+0x309
j  org.lwjgl.system.JNI.invokePPP(JJJ)J+0
j  org.lwjgl.opengl.awt.PlatformMacOSXGLCanvas.caFlush()V+11
j  org.lwjgl.opengl.awt.PlatformMacOSXGLCanvas.create(Ljava/awt/Canvas;Lorg/lwjgl/opengl/awt/GLData;Lorg/lwjgl/opengl/awt/GLData;)J+630
j  org.lwjgl.opengl.awt.AWTGLCanvas.beforeRender()V+23
j  org.lwjgl.opengl.awt.AWTGLCanvas.render()V+1
j  kendzi.jogl.animator.FPSAnimator$$Lambda$1294+0x0000000800919768.run()V+4
J 5177 c1 java.awt.event.InvocationEvent.dispatch()V [email protected] (69 bytes) @ 0x0000000110b2099c [0x0000000110b20780+0x000000000000021c]
J 5614 c1 java.awt.EventQueue.dispatchEventImpl(Ljava/awt/AWTEvent;Ljava/lang/Object;)V [email protected] (136 bytes) @ 0x0000000110db996c [0x0000000110db7e80+0x0000000000001aec]
J 5613 c1 java.awt.EventQueue$4.run()Ljava/lang/Void; [email protected] (60 bytes) @ 0x0000000110ec213c [0x0000000110ec2000+0x000000000000013c]
J 11029 c1 java.awt.EventQueue.dispatchEvent(Ljava/awt/AWTEvent;)V [email protected] (80 bytes) @ 0x00000001116b960c [0x00000001116b9060+0x00000000000005ac]
J 11035 c1 java.awt.EventDispatchThread.pumpOneEventForFilters(I)V [email protected] (113 bytes) @ 0x00000001119bbe1c [0x00000001119bb7a0+0x000000000000067c]
j  java.awt.EventDispatchThread.pumpEventsForFilter(ILjava/awt/Conditional;Ljava/awt/EventFilter;)V+35 [email protected]
j  java.awt.EventDispatchThread.pumpEventsForHierarchy(ILjava/awt/Conditional;Ljava/awt/Component;)V+11 [email protected]
j  java.awt.EventDispatchThread.pumpEvents(ILjava/awt/Conditional;)V+4 [email protected]
j  java.awt.EventDispatchThread.pumpEvents(Ljava/awt/Conditional;)V+3 [email protected]
j  java.awt.EventDispatchThread.run()V+9 [email protected]
v  ~StubRoutines::call_stub
V  [libjvm.dylib+0x523896]  JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*)+0x2c6
V  [libjvm.dylib+0x5228e7]  JavaCalls::call_virtual(JavaValue*, Klass*, Symbol*, Symbol*, JavaCallArguments*, JavaThread*)+0x147
V  [libjvm.dylib+0x5229b3]  JavaCalls::call_virtual(JavaValue*, Handle, Klass*, Symbol*, Symbol*, JavaThread*)+0x63
V  [libjvm.dylib+0x5cf0d4]  thread_entry(JavaThread*, JavaThread*)+0xb4
V  [libjvm.dylib+0xaa6ebf]  JavaThread::thread_main_inner()+0x14f
V  [libjvm.dylib+0xaa523a]  Thread::call_run()+0x11a
V  [libjvm.dylib+0x8b2688]  thread_native_entry(Thread*)+0x148
C  [libsystem_pthread.dylib+0x64e1]  _pthread_start+0x7d
C  [libsystem_pthread.dylib+0x1f6b]  thread_start+0xf

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  org.lwjgl.system.JNI.invokePPP(JJJ)J+0
j  org.lwjgl.opengl.awt.PlatformMacOSXGLCanvas.caFlush()V+11
j  org.lwjgl.opengl.awt.PlatformMacOSXGLCanvas.create(Ljava/awt/Canvas;Lorg/lwjgl/opengl/awt/GLData;Lorg/lwjgl/opengl/awt/GLData;)J+630
j  org.lwjgl.opengl.awt.AWTGLCanvas.beforeRender()V+23
j  org.lwjgl.opengl.awt.AWTGLCanvas.render()V+1
j  kendzi.jogl.animator.FPSAnimator$$Lambda$1294+0x0000000800919768.run()V+4
J 5177 c1 java.awt.event.InvocationEvent.dispatch()V [email protected] (69 bytes) @ 0x0000000110b2099c [0x0000000110b20780+0x000000000000021c]
J 5614 c1 java.awt.EventQueue.dispatchEventImpl(Ljava/awt/AWTEvent;Ljava/lang/Object;)V [email protected] (136 bytes) @ 0x0000000110db996c [0x0000000110db7e80+0x0000000000001aec]
J 5613 c1 java.awt.EventQueue$4.run()Ljava/lang/Void; [email protected] (60 bytes) @ 0x0000000110ec213c [0x0000000110ec2000+0x000000000000013c]
J 11029 c1 java.awt.EventQueue.dispatchEvent(Ljava/awt/AWTEvent;)V [email protected] (80 bytes) @ 0x00000001116b960c [0x00000001116b9060+0x00000000000005ac]
J 11035 c1 java.awt.EventDispatchThread.pumpOneEventForFilters(I)V [email protected] (113 bytes) @ 0x00000001119bbe1c [0x00000001119bb7a0+0x000000000000067c]
j  java.awt.EventDispatchThread.pumpEventsForFilter(ILjava/awt/Conditional;Ljava/awt/EventFilter;)V+35 [email protected]
j  java.awt.EventDispatchThread.pumpEventsForHierarchy(ILjava/awt/Conditional;Ljava/awt/Component;)V+11 [email protected]
j  java.awt.EventDispatchThread.pumpEvents(ILjava/awt/Conditional;)V+4 [email protected]
j  java.awt.EventDispatchThread.pumpEvents(Ljava/awt/Conditional;)V+3 [email protected]
j  java.awt.EventDispatchThread.run()V+9 [email protected]
v  ~StubRoutines::call_stub

siginfo: si_signo: 4 (SIGILL), si_code: 1 (ILL_ILLOPC), si_addr: 0x00007ff818e7b8f4

... snip ...

Not sure if I did something wrong. Let me know you need more info.

@tsmock
Copy link
Contributor Author

tsmock commented Aug 22, 2022

I'll see if I can reproduce. I've fiddled around with it a bit since I first opened this PR (I was trying to fix an issue w.r.t. color overriding texture instead of changing the texture color). But I really don't do a bunch with 3d buildings, so it hasn't been at the top of my priority list.

Anyway, I've had to make changes in various dependencies as well (specifically, kendzi-math, IIRC).

@kendzi
Copy link
Owner

kendzi commented Jul 20, 2023

Hello, I did not check status for a while and I just noticed your work. Great job! Especially jogl is so terrible outdated.

I merged already your changes with formatting. But still its a lot. Will try to review it, run it and check what is going with roofs textures.

tsmock and others added 4 commits December 11, 2024 08:22
Signed-off-by: Taylor Smock <[email protected]>
Currently, the only thing actually drawn as a VBO/VAO is the roof height
handle.

Signed-off-by: Taylor Smock <[email protected]>
Also, remove log4j property files, add a MatrixMath class for easier
move from GL11 deprecated functions.

Signed-off-by: Taylor Smock <[email protected]>
@gimse
Copy link

gimse commented Jan 19, 2025

Any status on when this will be published?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Jogl complains about com/jogamp/opengl/GLEventListener when plugin loads Plugin not running on MacOS
4 participants