RSGL icon indicating copy to clipboard operation
RSGL copied to clipboard

Google Angle macOS: Black screen issue

Open webfolderio opened this issue 1 year ago • 5 comments

I Compiled latest Angle version on macOS and linked with RSGL. Examples run without an error but display only a black screen.

Has Angle been tested on macOS, and is there official support for Angle?

Thanks

webfolderio avatar Sep 22 '24 23:09 webfolderio

I've not tested with Angle and I'm not sure how to. I currently run macOS on a VM.

This behavior makes sense because RSGL_gl.h has no Angle-specific code, which I think is required.

ColleagueRiley avatar Sep 22 '24 23:09 ColleagueRiley

I believe I've identified the cause of the problem. When compiled with default settings, RGFW uses system OpenGL. However, to use RGFW with Angle, I need to use EGL instead of system OpenGL. The issue is that on macOS, RGFW only supports system OpenGL.

When I have time, I'll test it on Windows and Linux and report back. I think Angle might work for Windows and Linux because raylib, which also only supports OpenGL, can use Metal or DX11 through Angle. My guess is that RGFW will work with Angle on Windows and Linux.

#ifdef RGFW_EGL
	#if defined(__APPLE__)
		#warning  EGL is not supported for Cocoa, switching back to the native opengl api
		#undef RGFW_EGL
	#endif
#endif

https://medium.com/@grplyler/building-and-linking-googles-angle-with-raylib-on-macos-67b07cd380a3

webfolderio avatar Sep 26 '24 17:09 webfolderio

I figured that EGL was not supported on macOS after searching for the binaries. I have no idea why but it seems super difficult to find bindings for EGL on every platform but Linux. Could you make a separate issues on RGFW regarding EGL support for macOS so I don't forget to get to it?

ColleagueRiley avatar Sep 26 '24 18:09 ColleagueRiley

The article says how to get EGL bindings for macOS! :)

ColleagueRiley avatar Sep 26 '24 18:09 ColleagueRiley

Update: RGFW's EGL support for macOS is now a WIP

ColleagueRiley avatar Oct 21 '24 19:10 ColleagueRiley

it seems super difficult to find bindings for EGL on every platform but Linux.

A few years ago I contributed to https://github.com/McNopper/EGL making it comply to EGL 1.5, works on Windows (impl with WGL), Linux (impl with X11) and behaves as a passthrough on platforms where EGL is present. Me and @devshgraphicsprogramming were running it on chromebook on ANGLE.

Maybe it will be of use for you as well @ColleagueRiley :) List of features is in contribution PR: https://github.com/McNopper/EGL/pull/13

edit: the passthrough wasnt pushed into original repo, it's on my fork: https://github.com/Crisspl/EGL/commit/227767f8dfcdb5e276e70591f8abdb7a587f766e Sorry, dont remember much apparently

Crisspl avatar Nov 29 '25 16:11 Crisspl

From what I've seen special code has to be added to RGFW for it to comply with Angle. It's definitely something I would like to try but it's not a high priority considering it would be cooler if RSGL had native Vulkan, DirectX and metal support.

Thanks for sharing, I'll look into the repo later. I found EGL bindings in windows a while back on mesa's page I think. I believe a lot of people prefer to steal the EGL binary from Google chrome.

ColleagueRiley avatar Nov 29 '25 17:11 ColleagueRiley