Hello,

this is a message for the maintainer of SDL3 package.
I discovered that support for OpenGL was not working, so I did a check
on that library.
I found that there were few bugs:
- cmake/macros.cmake was failing because CYGWIN uses DLLs like WIN32
and not .so files.
- the names of the libraries into src/video/SDL_egl.c are wrong, so I
fixed them with an additional test on SDL_PLATFORM_CYGWIN.
- SDL_x11opengl.c uses libGL.so.1 instead of cygGL-1.dll, so a test on
SDL_PLATFORM_CYGWIN is needed again for loading the right library.

I attached the patch that needs to be appended to
SDL3-3.2.28-1.src.patch for fixing these issues.
BTW, I also suggest to add -DSDL_ALSA=OFF to CYGCMAKE_ARGS into
SDL3.cygport, for removing the failure when CMake tries to detect
ALSA.

The fixes have been tested with TRX, an Open source re-implementation
of Tomb Raider I and Tomb Raider II and it worked fine after applying
these changes.

I hope that you will find this useful.
Sincerely,

Carlo Bramini.

--- origsrc/SDL3-3.2.28/cmake/macros.cmake    2025-01-14
01:42:50.000000000 +0100
+++ src/SDL3-3.2.28/cmake/macros.cmake    2025-12-16 16:45:05.815201900 +0100
@@ -261,7 +261,7 @@ function(target_get_dynamic_library DEST
   endif()
   if(result)
     string(TOLOWER "${result}" result_lower)
-    if(WIN32 OR OS2)
+    if(WIN32 OR OS2 OR CYGWIN)
       if(NOT result_lower MATCHES ".*dll")
         message(FATAL_ERROR "\"${result}\" is not a .dll library")
       endif()
--- origsrc/SDL3-3.2.28/src/video/SDL_egl.c    2025-09-22
20:28:46.000000000 +0200
+++ src/SDL3-3.2.28/src/video/SDL_egl.c    2025-12-16 16:29:43.552213400 +0100
@@ -97,6 +97,14 @@
 #define DEFAULT_OGL_ES_PVR "libGLES_CM.so"
 #define DEFAULT_OGL_ES     "libGLESv1_CM.so"

+#elif defined(SDL_PLATFORM_CYGWIN)
+// CYGWIN
+#define DEFAULT_OGL        "cygGL-1.dll"
+#define DEFAULT_EGL        "cygEGL-1.dll"
+#define DEFAULT_OGL_ES2    "cygGLESv2-2.dll"
+#define DEFAULT_OGL_ES_PVR "cygGLES_CM-1.dll"
+#define DEFAULT_OGL_ES     "cygGLESv1_CM-1.dll"
+
--- origsrc/SDL3-3.2.28/src/video/x11/SDL_x11opengl.c    2025-01-01
16:45:52.000000000 +0100
+++ src/SDL3-3.2.28/src/video/x11/SDL_x11opengl.c    2025-12-16
16:20:08.032562900 +0100
@@ -40,6 +40,8 @@
 #define DEFAULT_OPENGL "libGL.so"
 #elif defined(SDL_PLATFORM_MACOS)
 #define DEFAULT_OPENGL "/opt/X11/lib/libGL.1.dylib"
+#elif defined(SDL_PLATFORM_CYGWIN)
+#define DEFAULT_OPENGL "cygGL-1.dll"
 #else
 #define DEFAULT_OPENGL "libGL.so.1"
 #endif

Reply via email to