husker-dev / openglfx

OpenGL implementation for JavaFX
Apache License 2.0
80 stars 10 forks source link

Buf fixes and improvements #59

Closed streamingdv closed 7 months ago

streamingdv commented 7 months ago

+) Fix NVDXInteropCanvasImpl +) Make dispose boolean volatile

Fix for point 1) and 2) mentioned here https://github.com/husker-dev/openglfx/discussions/55#discussioncomment-7647419

husker-dev commented 7 months ago

Is context.makeCurrent() necessary? It worked without them.

husker-dev commented 7 months ago

Thanks for volatile, I completely forgot about it

streamingdv commented 7 months ago

@husker-dev yes it's necessary as otherwise resizing the canvas or disposing it will result in a black screen forever.

streamingdv commented 7 months ago

It fixes point 2) mentioned here

https://github.com/husker-dev/openglfx/discussions/55#discussioncomment-7647419

husker-dev commented 7 months ago

It's strange that this works on my PC. Although I added this line because it didn't work before.

Then let's leave it

husker-dev commented 7 months ago

I'll now make a big commit that will include your changes.

husker-dev commented 7 months ago

These are not final changes, now I’ll test them on macOS

streamingdv commented 7 months ago

@husker-dev i tested all other canvas elements (asynchronous and standard ones) except MacOS. The issue with context.makeCurrent() only happens when with NVDXInteropCanvasImpl but when I include this line again it will work as before. Not sure why though. If you include my commits in your next one that's fine for me as well.