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

SWTDemo sample issue on Mac OS Aarch64: Cannot invoke "org.eclipse.swt.internal.cocoa.NSGraphicsContext.saveGraphicsState()" because "context" is null #1029

Open
bolivaro opened this issue Dec 16, 2024 · 0 comments

Comments

@bolivaro
Copy link

bolivaro commented Dec 16, 2024

Version

3.3.5, 3.3.4

Platform

macOS arm64

JDK

Zulu 17

Module

OpenGL

Bug description

I am trying to intregrete an OpenGL Canvas in SWT on a Mac M2 Aarch64 with Java 17.

I initially try to embedded the GLcanvas into SWT context from a hand made snippet, then I got this null pointer exception from the context object.
To make sure I was doing everything the right way, I took one of your provided examples about OpenGL integration in SWT, the SWTDemo one, but I still got the same exception.

Has anyone encoutered this issue, and hopefully knows how to deal/get around with this.

Thank you

Stacktrace or crash log output

Exception in thread "main" java.lang.NullPointerException: Cannot invoke "org.eclipse.swt.internal.cocoa.NSGraphicsContext.saveGraphicsState()" because "context" is null
	at org.eclipse.swt.widgets.Widget.drawRect(Widget.java:763)
	at org.eclipse.swt.widgets.Canvas.drawRect(Canvas.java:170)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:6124)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Display.applicationNextEventMatchingMask(Display.java:5398)
	at org.eclipse.swt.widgets.Display.applicationProc(Display.java:5802)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
	at org.eclipse.swt.internal.cocoa.NSApplication.nextEventMatchingMask(NSApplication.java:92)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3877)
	at com.afp.iris.mpvlab.SwtDemo.main(SwtDemo.java:158)
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

No branches or pull requests

1 participant