LukasBanana / LLGL

Low Level Graphics Library (LLGL) is a thin abstraction layer for the modern graphics APIs OpenGL, Direct3D, Vulkan, and Metal
BSD 3-Clause "New" or "Revised" License
2.1k stars 139 forks source link

MacOSDisplay.mm: error: 'CVDisplayLinkRef' was not declared in this scope (and other related errors) #80

Closed barracuda156 closed 2 months ago

barracuda156 commented 1 year ago

Build fails on macOS 10.6.8:

[ 16%] Building CXX object CMakeFiles/LLGL.dir/sources/Renderer/BufferUtils.cpp.o
/opt/local/bin/g++-mp-12 -DGL_SILENCE_DEPRECATION -DLLGL_BUILD_RENDERER_NULL -DLLGL_BUILD_RENDERER_OPENGL -DLLGL_ENABLE_DEBUG_LAYER -DLLGL_ENABLE_UTILITY -DLLGL_EXPORTS -DLLGL_GL_ENABLE_DSA_EXT -DLLGL_GL_ENABLE_EXT_PLACEHOLDERS -DLLGL_GL_ENABLE_VENDOR_EXT -I/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/include -I/opt/local/include/Gauss -I/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/examples/Cpp/ExampleBase -F//System/Library/Frameworks -I/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/external/OpenGL/include -pipe -Os -DNDEBUG -I/opt/local/include -D_GLIBCXX_USE_CXX11_ABI=0 -arch ppc -mmacosx-version-min=10.6 -fPIC -std=gnu++11 -MD -MT CMakeFiles/LLGL.dir/sources/Renderer/BufferUtils.cpp.o -MF CMakeFiles/LLGL.dir/sources/Renderer/BufferUtils.cpp.o.d -o CMakeFiles/LLGL.dir/sources/Renderer/BufferUtils.cpp.o -c /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Renderer/BufferUtils.cpp
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSDisplay.mm: In function 'uint32_t LLGL::GetDisplayModeRefreshRate(CGDisplayModeRef, CGDirectDisplayID)':
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSDisplay.mm:33:9: error: 'CVDisplayLinkRef' was not declared in this scope; did you mean 'CGDisplayModeRef'?
   33 |         CVDisplayLinkRef displayLink = nullptr;
      |         ^~~~~~~~~~~~~~~~
      |         CGDisplayModeRef
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSDisplay.mm:34:54: error: 'displayLink' was not declared in this scope; did you mean 'displayID'?
   34 |         CVDisplayLinkCreateWithCGDisplay(displayID, &displayLink);
      |                                                      ^~~~~~~~~~~
      |                                                      displayID
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSDisplay.mm:34:9: error: 'CVDisplayLinkCreateWithCGDisplay' was not declared in this scope
   34 |         CVDisplayLinkCreateWithCGDisplay(displayID, &displayLink);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSDisplay.mm:36:27: error: 'CVDisplayLinkGetNominalOutputVideoRefreshPeriod' was not declared in this scope
   36 |             CVTime time = CVDisplayLinkGetNominalOutputVideoRefreshPeriod(displayLink);
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSDisplay.mm:40:9: error: 'CVDisplayLinkRelease' was not declared in this scope; did you mean 'CGDisplayRelease'?
   40 |         CVDisplayLinkRelease(displayLink);
      |         ^~~~~~~~~~~~~~~~~~~~
      |         CGDisplayRelease
[ 16%] Building CXX object CMakeFiles/LLGL.dir/sources/Renderer/DescriptorHelper.cpp.o
/opt/local/bin/g++-mp-12 -DGL_SILENCE_DEPRECATION -DLLGL_BUILD_RENDERER_NULL -DLLGL_BUILD_RENDERER_OPENGL -DLLGL_ENABLE_DEBUG_LAYER -DLLGL_ENABLE_UTILITY -DLLGL_EXPORTS -DLLGL_GL_ENABLE_DSA_EXT -DLLGL_GL_ENABLE_EXT_PLACEHOLDERS -DLLGL_GL_ENABLE_VENDOR_EXT -I/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/include -I/opt/local/include/Gauss -I/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/examples/Cpp/ExampleBase -F//System/Library/Frameworks -I/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/external/OpenGL/include -pipe -Os -DNDEBUG -I/opt/local/include -D_GLIBCXX_USE_CXX11_ABI=0 -arch ppc -mmacosx-version-min=10.6 -fPIC -std=gnu++11 -MD -MT CMakeFiles/LLGL.dir/sources/Renderer/DescriptorHelper.cpp.o -MF CMakeFiles/LLGL.dir/sources/Renderer/DescriptorHelper.cpp.o.d -o CMakeFiles/LLGL.dir/sources/Renderer/DescriptorHelper.cpp.o -c /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Renderer/DescriptorHelper.cpp
[ 17%] Building CXX object CMakeFiles/LLGL.dir/sources/Renderer/Format.cpp.o
/opt/local/bin/g++-mp-12 -DGL_SILENCE_DEPRECATION -DLLGL_BUILD_RENDERER_NULL -DLLGL_BUILD_RENDERER_OPENGL -DLLGL_ENABLE_DEBUG_LAYER -DLLGL_ENABLE_UTILITY -DLLGL_EXPORTS -DLLGL_GL_ENABLE_DSA_EXT -DLLGL_GL_ENABLE_EXT_PLACEHOLDERS -DLLGL_GL_ENABLE_VENDOR_EXT -I/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/include -I/opt/local/include/Gauss -I/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/examples/Cpp/ExampleBase -F//System/Library/Frameworks -I/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/external/OpenGL/include -pipe -Os -DNDEBUG -I/opt/local/include -D_GLIBCXX_USE_CXX11_ABI=0 -arch ppc -mmacosx-version-min=10.6 -fPIC -std=gnu++11 -MD -MT CMakeFiles/LLGL.dir/sources/Renderer/Format.cpp.o -MF CMakeFiles/LLGL.dir/sources/Renderer/Format.cpp.o.d -o CMakeFiles/LLGL.dir/sources/Renderer/Format.cpp.o -c /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Renderer/Format.cpp
make[2]: *** [CMakeFiles/LLGL.dir/sources/Platform/MacOS/MacOSDisplay.mm.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:25:51: error: 'NSWindowStyleMaskBorderless' was not declared in this scope; did you mean 'g_WinStyleBorderless'?
   25 | static const auto g_WinStyleBorderless          = NSWindowStyleMaskBorderless;
      |                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                   g_WinStyleBorderless
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:26:51: error: 'NSWindowStyleMaskResizable' was not declared in this scope; did you mean 'g_WinStyleResizable'?
   26 | static const auto g_WinStyleResizable           = NSWindowStyleMaskResizable;
      |                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                   g_WinStyleResizable
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:27:52: error: 'NSWindowStyleMaskTitled' was not declared in this scope
   27 | static const auto g_WinStyleTitleBar            = (NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | NSWindowStyleMaskMiniaturizable);
      |                                                    ^~~~~~~~~~~~~~~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:27:78: error: 'NSWindowStyleMaskClosable' was not declared in this scope
   27 | static const auto g_WinStyleTitleBar            = (NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | NSWindowStyleMaskMiniaturizable);
      |                                                                              ^~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:27:106: error: 'NSWindowStyleMaskMiniaturizable' was not declared in this scope
   27 | static const auto g_WinStyleTitleBar            = (NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | NSWindowStyleMaskMiniaturizable);
      |                                                                                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:30:51: error: 'NSEventMaskAny' was not declared in this scope; did you mean 'g_EventMaskAny'?
   30 | static const auto g_EventMaskAny                = NSEventMaskAny;
      |                                                   ^~~~~~~~~~~~~~
      |                                                   g_EventMaskAny
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:31:51: error: 'NSEventTypeKeyDown' was not declared in this scope; did you mean 'g_EventTypeKeyDown'?
   31 | static const auto g_EventTypeKeyDown            = NSEventTypeKeyDown;
      |                                                   ^~~~~~~~~~~~~~~~~~
      |                                                   g_EventTypeKeyDown
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:32:51: error: 'NSEventTypeKeyUp' was not declared in this scope; did you mean 'g_EventTypeKeyUp'?
   32 | static const auto g_EventTypeKeyUp              = NSEventTypeKeyUp;
      |                                                   ^~~~~~~~~~~~~~~~
      |                                                   g_EventTypeKeyUp
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:33:51: error: 'NSEventTypeMouseMoved' was not declared in this scope; did you mean 'g_EventTypeMouseMoved'?
   33 | static const auto g_EventTypeMouseMoved         = NSEventTypeMouseMoved;
      |                                                   ^~~~~~~~~~~~~~~~~~~~~
      |                                                   g_EventTypeMouseMoved
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:34:51: error: 'NSEventTypeLeftMouseDragged' was not declared in this scope; did you mean 'g_EventTypeLMouseDragged'?
   34 | static const auto g_EventTypeLMouseDragged      = NSEventTypeLeftMouseDragged;
      |                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                   g_EventTypeLMouseDragged
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:35:51: error: 'NSEventTypeLeftMouseDown' was not declared in this scope; did you mean 'g_EventTypeLMouseDown'?
   35 | static const auto g_EventTypeLMouseDown         = NSEventTypeLeftMouseDown;
      |                                                   ^~~~~~~~~~~~~~~~~~~~~~~~
      |                                                   g_EventTypeLMouseDown
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:36:51: error: 'NSEventTypeLeftMouseUp' was not declared in this scope; did you mean 'g_EventTypeLMouseUp'?
   36 | static const auto g_EventTypeLMouseUp           = NSEventTypeLeftMouseUp;
      |                                                   ^~~~~~~~~~~~~~~~~~~~~~
      |                                                   g_EventTypeLMouseUp
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:37:51: error: 'NSEventTypeRightMouseDragged' was not declared in this scope; did you mean 'g_EventTypeRMouseDragged'?
   37 | static const auto g_EventTypeRMouseDragged      = NSEventTypeRightMouseDragged;
      |                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                   g_EventTypeRMouseDragged
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:38:51: error: 'NSEventTypeRightMouseDown' was not declared in this scope; did you mean 'g_EventTypeRMouseDown'?
   38 | static const auto g_EventTypeRMouseDown         = NSEventTypeRightMouseDown;
      |                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                   g_EventTypeRMouseDown
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:39:51: error: 'NSEventTypeRightMouseUp' was not declared in this scope; did you mean 'g_EventTypeRMouseUp'?
   39 | static const auto g_EventTypeRMouseUp           = NSEventTypeRightMouseUp;
      |                                                   ^~~~~~~~~~~~~~~~~~~~~~~
      |                                                   g_EventTypeRMouseUp
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:40:51: error: 'NSEventTypeOtherMouseDragged' was not declared in this scope; did you mean 'g_EventTypeRMouseDragged'?
   40 | static const auto g_EventTypeExtMouseDragged    = NSEventTypeOtherMouseDragged;
      |                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                   g_EventTypeRMouseDragged
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:41:51: error: 'NSEventTypeOtherMouseDown' was not declared in this scope; did you mean 'g_EventTypeRMouseDown'?
   41 | static const auto g_EventTypeExtMouseDown       = NSEventTypeOtherMouseDown;
      |                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                   g_EventTypeRMouseDown
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:42:51: error: 'NSEventTypeOtherMouseUp' was not declared in this scope; did you mean 'g_EventTypeRMouseUp'?
   42 | static const auto g_EventTypeExtMouseUp         = NSEventTypeOtherMouseUp;
      |                                                   ^~~~~~~~~~~~~~~~~~~~~~~
      |                                                   g_EventTypeRMouseUp
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:43:51: error: 'NSEventTypeScrollWheel' was not declared in this scope; did you mean 'g_EventTypeScrollWheel'?
   43 | static const auto g_EventTypeScrollWheel        = NSEventTypeScrollWheel;
      |                                                   ^~~~~~~~~~~~~~~~~~~~~~
      |                                                   g_EventTypeScrollWheel
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:98:1: error: inconsistent instance variable specification
   98 | }
      | ^
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm: In function '-[MacOSWindowDelegate initWithWindow:isResizable:]':
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:104:5: error: 'window_' was not declared in this scope; did you mean 'window'?
  104 |     window_         = window;
      |     ^~~~~~~
      |     window
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:105:5: error: 'resizable_' was not declared in this scope; did you mean 'resizable'?
  105 |     resizable_      = resizable;
      |     ^~~~~~~~~~
      |     resizable
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:106:5: error: 'resizeSignaled_' was not declared in this scope
  106 |     resizeSignaled_ = NO;
      |     ^~~~~~~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:107:5: error: 'fullscreenMode_' was not declared in this scope
  107 |     fullscreenMode_ = NO;
      |     ^~~~~~~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm: In function '-[MacOSWindowDelegate makeResizable:]':
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:114:5: error: 'resizable_' was not declared in this scope; did you mean 'resizable'?
  114 |     resizable_ = resizable;
      |     ^~~~~~~~~~
      |     resizable
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm: In function '-[MacOSWindowDelegate popResizeSignal]':
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:119:9: error: 'resizeSignaled_' was not declared in this scope
  119 |     if (resizeSignaled_)
      |         ^~~~~~~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm: In function '-[MacOSWindowDelegate isFullscreenMode]':
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:129:12: error: 'fullscreenMode_' was not declared in this scope
  129 |     return fullscreenMode_;
      |            ^~~~~~~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm: In function '-[MacOSWindowDelegate windowWillClose:]':
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:134:5: error: 'window_' was not declared in this scope
  134 |     window_->PostQuit();
      |     ^~~~~~~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm: In function '-[MacOSWindowDelegate windowWillResize:toSize:]':
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:139:9: error: 'resizable_' was not declared in this scope
  139 |     if (resizable_)
      |         ^~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm: In function '-[MacOSWindowDelegate windowDidResize:]':
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:159:5: error: 'resizeSignaled_' was not declared in this scope
  159 |     resizeSignaled_ = YES;
      |     ^~~~~~~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm: In function '-[MacOSWindowDelegate window:willUseFullScreenPresentationOptions:]':
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:166:9: error: 'NSApplicationPresentationFullScreen' was not declared in this scope; did you mean 'NSApplicationPresentationOptions'?
  166 |         NSApplicationPresentationFullScreen |
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |         NSApplicationPresentationOptions
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:168:9: error: 'NSApplicationPresentationAutoHideToolbar' was not declared in this scope; did you mean 'NSApplicationPresentationAutoHideMenuBar'?
  168 |         NSApplicationPresentationAutoHideToolbar |
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |         NSApplicationPresentationAutoHideMenuBar
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm: In function '-[MacOSWindowDelegate windowWillEnterFullScreen:]':
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:174:5: error: 'fullscreenMode_' was not declared in this scope
  174 |     fullscreenMode_ = YES;
      |     ^~~~~~~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:176:11: error: 'NSApplicationPresentationFullScreen' was not declared in this scope; did you mean 'NSApplicationPresentationOptions'?
  176 |         ( NSApplicationPresentationFullScreen |
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |           NSApplicationPresentationOptions
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:178:11: error: 'NSApplicationPresentationAutoHideToolbar' was not declared in this scope; did you mean 'NSApplicationPresentationAutoHideMenuBar'?
  178 |           NSApplicationPresentationAutoHideToolbar |
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |           NSApplicationPresentationAutoHideMenuBar
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm: In function '-[MacOSWindowDelegate windowDidEnterFullScreen:]':
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:189:5: error: 'resizeSignaled_' was not declared in this scope
  189 |     resizeSignaled_ = YES;
      |     ^~~~~~~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm: In function '-[MacOSWindowDelegate windowDidExitFullScreen:]':
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:196:5: error: 'fullscreenMode_' was not declared in this scope
  196 |     fullscreenMode_ = NO;
      |     ^~~~~~~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm: In member function 'virtual bool LLGL::MacOSWindow::GetNativeHandle(void*, std::size_t) const':
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:261:36: error: 'NativeHandle' was not declared in this scope; did you mean 'nativeHandle'?
  261 |     if (nativeHandleSize == sizeof(NativeHandle))
      |                                    ^~~~~~~~~~~~
      |                                    nativeHandle
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:263:42: error: 'NativeHandle' does not name a type; did you mean 'NSFileHandle'?
  263 |         auto& handle = *reinterpret_cast<NativeHandle*>(nativeHandle);
      |                                          ^~~~~~~~~~~~
      |                                          NSFileHandle
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:263:54: error: expected '>' before '*' token
  263 |         auto& handle = *reinterpret_cast<NativeHandle*>(nativeHandle);
      |                                                      ^
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:263:54: error: expected '(' before '*' token
  263 |         auto& handle = *reinterpret_cast<NativeHandle*>(nativeHandle);
      |                                                      ^
      |                                                      (
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:263:55: error: expected primary-expression before '>' token
  263 |         auto& handle = *reinterpret_cast<NativeHandle*>(nativeHandle);
      |                                                       ^
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:263:70: error: expected ')' before ';' token
  263 |         auto& handle = *reinterpret_cast<NativeHandle*>(nativeHandle);
      |                                                                      ^
      |                                                                      )
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm: In member function 'virtual void LLGL::MacOSWindow::SetPosition(const LLGL::Offset2D&)':
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:286:39: error: conversion from 'NSSize' to non-scalar type 'CGSize' requested
  286 |     CGSize frameSize = [screen frame].size;
      |                        ~~~~~~~~~~~~~~~^~~~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm: In member function 'virtual LLGL::Offset2D LLGL::MacOSWindow::GetPosition() const':
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:304:39: error: conversion from 'NSSize' to non-scalar type 'CGSize' requested
  304 |     CGSize frameSize = [screen frame].size;
      |                        ~~~~~~~~~~~~~~~^~~~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:311:22: error: conversion from 'NSRect' to non-scalar type 'CGRect' requested
  311 |     CGRect wndRect = [wnd_ frame];
      |                      ^~~~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm: In member function 'virtual LLGL::Extent2D LLGL::MacOSWindow::GetSize(bool) const':
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:342:43: error: no match for 'operator=' (operand types are 'CGSize' and 'NSSize')
  342 |         size = [[wnd_ contentView] frame].size;
      |                                           ^~~~
In file included from /System/Library/Frameworks/Foundation.framework/Headers/NSGeometry.h:16,
                 from /System/Library/Frameworks/Foundation.framework/Headers/NSKeyedArchiver.h:8,
                 from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:34,
                 from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12,
                 from /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:8:
/System/Library/Frameworks/ApplicationServices.framework/Headers/../Frameworks/CoreGraphics.framework/Headers/CGGeometry.h:21:8: note: candidate: 'CGSize& CGSize::operator=(const CGSize&)'
   21 | struct CGSize {
      |        ^~~~~~
/System/Library/Frameworks/ApplicationServices.framework/Headers/../Frameworks/CoreGraphics.framework/Headers/CGGeometry.h:21:8: note:   no known conversion for argument 1 from 'NSSize' to 'const CGSize&'
/System/Library/Frameworks/ApplicationServices.framework/Headers/../Frameworks/CoreGraphics.framework/Headers/CGGeometry.h:21:8: note: candidate: 'CGSize& CGSize::operator=(CGSize&&)'
/System/Library/Frameworks/ApplicationServices.framework/Headers/../Frameworks/CoreGraphics.framework/Headers/CGGeometry.h:21:8: note:   no known conversion for argument 1 from 'NSSize' to 'CGSize&&'
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:344:27: error: no match for 'operator=' (operand types are 'CGSize' and 'NSSize')
  344 |         size = wnd_.frame.size;
      |                           ^~~~
/System/Library/Frameworks/ApplicationServices.framework/Headers/../Frameworks/CoreGraphics.framework/Headers/CGGeometry.h:21:8: note: candidate: 'CGSize& CGSize::operator=(const CGSize&)'
   21 | struct CGSize {
      |        ^~~~~~
/System/Library/Frameworks/ApplicationServices.framework/Headers/../Frameworks/CoreGraphics.framework/Headers/CGGeometry.h:21:8: note:   no known conversion for argument 1 from 'NSSize' to 'const CGSize&'
/System/Library/Frameworks/ApplicationServices.framework/Headers/../Frameworks/CoreGraphics.framework/Headers/CGGeometry.h:21:8: note: candidate: 'CGSize& CGSize::operator=(CGSize&&)'
/System/Library/Frameworks/ApplicationServices.framework/Headers/../Frameworks/CoreGraphics.framework/Headers/CGGeometry.h:21:8: note:   no known conversion for argument 1 from 'NSSize' to 'CGSize&&'
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm: In member function 'virtual void LLGL::MacOSWindow::OnProcessEvents()':
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:493:6: error: 'autoreleasepool' was not declared in this scope; did you mean 'NSAutoreleasePool'?
  493 |     @autoreleasepool
      |      ^~~~~~~~~~~~~~~
      |      NSAutoreleasePool
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm: In function '-[MacOSWindowDelegate windowWillResize:toSize:]':
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:143:1: warning: control reaches end of non-void function [-Wreturn-type]
  143 | }
      | ^
make[2]: *** [CMakeFiles/LLGL.dir/sources/Platform/MacOS/MacOSWindow.mm.o] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/build'
make[1]: *** [CMakeFiles/LLGL.dir/all] Error 2
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/build'
make: *** [all] Error 2

P. S. I understand it is an old system, but if errors are fixable, it would be great to have them fixed.

LukasBanana commented 1 year ago

macOS 10.6.8 is indeed a very old system, but LLGL was intended to support older systems as well, so let's see if we can fix at least some of these errors. First off: Can you please tell me what the values of these macros are on your environment:

MAC_OS_X_VERSION_MIN_ALLOWED
MAC_OS_X_VERSION_MAX_ALLOWED
MAC_OS_X_VERSION_10_12

A simple #error MAC_OS_X_VERSION_MIN_ALLOWED should reveal that. It seems as if the wrong constants are picked such as NSWindowStyleMaskBorderless instead of NSBorderlessWindowMask for older version of macOS or Xcode rather.

Speaking of which: Can you please also share your Xcode version?

Then there are a bunch of invalid conversations from NSRect to CGRect and NSSize to CGSize. Those should be easily fixable.

With things like CVDisplayLinkCreateWithCGDisplay: They are available since macOS 10.4, so there might just be a missing #import directive.

barracuda156 commented 1 year ago

@LukasBanana Thank you for responding!

Xcode 3.2.6 is used on 10.6.8 (Xcode 4.2 also exists for it, but without PPC support in Rosetta), Xcode 3.2 on 10.6 PPC and Xcode 3.1.4 on 10.5.8. (Support for 10.4.11 is not my concern.) I will test LLGL on 10.6 PPC and 10.5.8 to generate error logs tonight.

MAC_OS_X_VERSION_10_12 will not be defined on any OS prior to 10.12, I believe. 10.5.x = 1050, 10.6.x = 1060. So normally we use smth like #if defined(__APPLE__) && __MAC_OS_X_VERSION_MIN_REQUIRED > 1060 to avoid using unsupported function on < 10.7.

barracuda156 commented 1 year ago

Build log on 10.6.8 in Rosetta with Xcode 3.2.6 and gcc 12.2.0:

LLGL_10.6.8_rosetta.txt

barracuda156 commented 1 year ago

@LukasBanana @autoreleasepool is not supported on <10.7 for sure:

:info:build /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSWindow.mm:493:5: error: stray '@' in program
:info:build   493 |     @autoreleasepool
:info:build       |     ^

I had a patch for libsdl2 which dealt with these, but no guarantee it is correct – this is not something I understand well, and solution was borrowed from elsewhere online. But possibly this approach gonna work:

 int
 Cocoa_CreateWindowFrom(_THIS, SDL_Window * window, const void *data)
-{ @autoreleasepool
 {
+    NSAutoreleasePool *pool;
     NSWindow *nswindow = (NSWindow *) data;
     NSString *title;
-
+    pool = [[NSAutoreleasePool alloc] init];
     /* Query the title from the existing window */
     title = [nswindow title];
     if (title) {
         window->title = SDL_strdup([title UTF8String]);
     }
-
+    [pool release];
     return SetupWindowData(_this, window, nswindow, SDL_FALSE);
-}}
+}

 void
 Cocoa_SetWindowTitle(_THIS, SDL_Window * window)
-{ @autoreleasepool
 {
+    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
     const char *title = window->title ? window->title : "";
     NSWindow *nswindow = ((SDL_WindowData *) window->driverdata)->nswindow;
     NSString *string = [[NSString alloc] initWithUTF8String:title];
     [nswindow setTitle:string];
     [string release];
-}}
+    [pool release];
+}

 void
 Cocoa_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon)
-{ @autoreleasepool
 {
+    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
     NSImage *nsimage = Cocoa_CreateImage(icon);
-
     if (nsimage) {
         [NSApp setApplicationIconImage:nsimage];
     }
-}}
+    [pool release];
+}

(This is not the whole patch, just an extract from it.)

barracuda156 commented 1 year ago

#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_12 should be instead:

#include <AvailabilityMacros.h>
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101200

Otherwise earlier OS have no way to know what is MAC_OS_X_VERSION_10_12 :)

This fixes part of errors.

barracuda156 commented 1 year ago

Then there are errors in MacOSDisplay.mm (no OS-based macros there):

/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSDisplay.mm: In function 'uint32_t LLGL::GetDisplayModeRefreshRate(CGDisplayModeRef, CGDirectDisplayID)':
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSDisplay.mm:33:9: error: 'CVDisplayLinkRef' was not declared in this scope; did you mean 'CGDisplayModeRef'?
   33 |         CVDisplayLinkRef displayLink = nullptr;
      |         ^~~~~~~~~~~~~~~~
      |         CGDisplayModeRef
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSDisplay.mm:34:54: error: 'displayLink' was not declared in this scope; did you mean 'displayID'?
   34 |         CVDisplayLinkCreateWithCGDisplay(displayID, &displayLink);
      |                                                      ^~~~~~~~~~~
      |                                                      displayID
[  7%] Building CXX object CMakeFiles/LLGL.dir/sources/Renderer/Shader.cpp.o
/opt/local/bin/g++-mp-12 -DGL_SILENCE_DEPRECATION -DLLGL_BUILD_RENDERER_NULL -DLLGL_BUILD_RENDERER_OPENGL -DLLGL_ENABLE_DEBUG_LAYER -DLLGL_ENABLE_UTILITY -DLLGL_EXPORTS -DLLGL_GL_ENABLE_DSA_EXT -DLLGL_GL_ENABLE_EXT_PLACEHOLDERS -DLLGL_GL_ENABLE_VENDOR_EXT -I/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/include -I/opt/local/include/Gauss -I/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/examples/Cpp/ExampleBase -F//System/Library/Frameworks -I/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/external/OpenGL/include -pipe -Os -DNDEBUG -I/opt/local/include -D_GLIBCXX_USE_CXX11_ABI=0 -arch ppc -mmacosx-version-min=10.6 -fPIC -std=gnu++11 -MD -MT CMakeFiles/LLGL.dir/sources/Renderer/Shader.cpp.o -MF CMakeFiles/LLGL.dir/sources/Renderer/Shader.cpp.o.d -o CMakeFiles/LLGL.dir/sources/Renderer/Shader.cpp.o -c /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Renderer/Shader.cpp
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-d98bcc8ee65d68e757ccae6770aed92f14b22617/sources/Platform/MacOS/MacOSDisplay.mm:34:9: error: 'CVDisplayLinkCreateWithCGDisplay' was not declared in this scope
   34 |         CVDisplayLinkCreateWithCGDisplay(displayID, &displayLink);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
barracuda156 commented 1 year ago

@LukasBanana Once MAC_OS_X_VERSION_MAX_ALLOWED is fixed, here is the new log: LLGL_after_MAC_OS_X_VERSION_MAX_ALLOWED_fixed.txt

LukasBanana commented 1 year ago

With 1e9d62c I addressed most of these issues. There's a new CMake option for Apple platforms that you have to disable (it's enabled by default): LLGL_MACOS_ENABLE_COREVIDEO. This enables/disables the import of CoreVideo framework, which is actually supported since Mac OS X 10.4, but I suspect either some unsupported feature within that framework or invalid conversion between types. All this framework is used for in LLGL is to query the correct refresh rate for built-in displays (i.e. everything MacBook). Let me know if there are any remaining build issues.

barracuda156 commented 1 year ago

@LukasBanana Thank you for such a fast response!

It still fails with some undefined stuff in MacOSWindow.mm. New log attached: LLGL_build_log_v3.txt

LukasBanana commented 1 year ago

I force pushed an appendix with 8c55fbc. I think the only thing remaining is the issue with the NSApplication... constants, but they are only available since Mac OS X 10.7 and I can't immediately see what they replaced: https://developer.apple.com/documentation/appkit/nsapplicationpresentationoptions/nsapplicationpresentationfullscreen

barracuda156 commented 1 year ago

@LukasBanana With Core Video turned on, there are few extra errors:

/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-8c55fbc5b9baae5dbb1202bb15acadeaa2eff440/sources/Platform/MacOS/MacOSDisplay.mm: In function 'uint32_t LLGL::GetDisplayModeRefreshRate(CGDisplayModeRef, CGDirectDisplayID)':
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-8c55fbc5b9baae5dbb1202bb15acadeaa2eff440/sources/Platform/MacOS/MacOSDisplay.mm:36:9: error: 'CVDisplayLinkRef' was not declared in this scope; did you mean 'CGDisplayModeRef'?
   36 |         CVDisplayLinkRef displayLink = nullptr;
      |         ^~~~~~~~~~~~~~~~
      |         CGDisplayModeRef
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-8c55fbc5b9baae5dbb1202bb15acadeaa2eff440/sources/Platform/MacOS/MacOSDisplay.mm:37:54: error: 'displayLink' was not declared in this scope; did you mean 'displayID'?
   37 |         CVDisplayLinkCreateWithCGDisplay(displayID, &displayLink);
      |                                                      ^~~~~~~~~~~
      |                                                      displayID
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-8c55fbc5b9baae5dbb1202bb15acadeaa2eff440/sources/Platform/MacOS/MacOSDisplay.mm:37:9: error: 'CVDisplayLinkCreateWithCGDisplay' was not declared in this scope
   37 |         CVDisplayLinkCreateWithCGDisplay(displayID, &displayLink);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 22%] Building CXX object CMakeFiles/LLGL.dir/sources/Renderer/DescriptorHelper.cpp.o
/opt/local/bin/g++-mp-12 -DGL_SILENCE_DEPRECATION -DLLGL_BUILD_RENDERER_NULL -DLLGL_BUILD_RENDERER_OPENGL -DLLGL_ENABLE_DEBUG_LAYER -DLLGL_ENABLE_UTILITY -DLLGL_EXPORTS -DLLGL_GL_ENABLE_DSA_EXT -DLLGL_GL_ENABLE_EXT_PLACEHOLDERS -DLLGL_GL_ENABLE_VENDOR_EXT -DLLGL_MACOS_ENABLE_COREVIDEO -I/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-8c55fbc5b9baae5dbb1202bb15acadeaa2eff440/include -I/opt/local/include/Gauss -F//System/Library/Frameworks -I/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-8c55fbc5b9baae5dbb1202bb15acadeaa2eff440/external/OpenGL/include -pipe -Os -DNDEBUG -I/opt/local/include -D_GLIBCXX_USE_CXX11_ABI=0 -arch ppc -mmacosx-version-min=10.6 -fPIC -std=gnu++11 -MD -MT CMakeFiles/LLGL.dir/sources/Renderer/DescriptorHelper.cpp.o -MF CMakeFiles/LLGL.dir/sources/Renderer/DescriptorHelper.cpp.o.d -o CMakeFiles/LLGL.dir/sources/Renderer/DescriptorHelper.cpp.o -c /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-8c55fbc5b9baae5dbb1202bb15acadeaa2eff440/sources/Renderer/DescriptorHelper.cpp
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-8c55fbc5b9baae5dbb1202bb15acadeaa2eff440/sources/Platform/MacOS/MacOSDisplay.mm:39:27: error: 'CVDisplayLinkGetNominalOutputVideoRefreshPeriod' was not declared in this scope
   39 |             CVTime time = CVDisplayLinkGetNominalOutputVideoRefreshPeriod(displayLink);
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 22%] Building CXX object CMakeFiles/LLGL.dir/sources/Renderer/Format.cpp.o
/opt/local/bin/g++-mp-12 -DGL_SILENCE_DEPRECATION -DLLGL_BUILD_RENDERER_NULL -DLLGL_BUILD_RENDERER_OPENGL -DLLGL_ENABLE_DEBUG_LAYER -DLLGL_ENABLE_UTILITY -DLLGL_EXPORTS -DLLGL_GL_ENABLE_DSA_EXT -DLLGL_GL_ENABLE_EXT_PLACEHOLDERS -DLLGL_GL_ENABLE_VENDOR_EXT -DLLGL_MACOS_ENABLE_COREVIDEO -I/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-8c55fbc5b9baae5dbb1202bb15acadeaa2eff440/include -I/opt/local/include/Gauss -F//System/Library/Frameworks -I/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-8c55fbc5b9baae5dbb1202bb15acadeaa2eff440/external/OpenGL/include -pipe -Os -DNDEBUG -I/opt/local/include -D_GLIBCXX_USE_CXX11_ABI=0 -arch ppc -mmacosx-version-min=10.6 -fPIC -std=gnu++11 -MD -MT CMakeFiles/LLGL.dir/sources/Renderer/Format.cpp.o -MF CMakeFiles/LLGL.dir/sources/Renderer/Format.cpp.o.d -o CMakeFiles/LLGL.dir/sources/Renderer/Format.cpp.o -c /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-8c55fbc5b9baae5dbb1202bb15acadeaa2eff440/sources/Renderer/Format.cpp
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-8c55fbc5b9baae5dbb1202bb15acadeaa2eff440/sources/Platform/MacOS/MacOSDisplay.mm:43:9: error: 'CVDisplayLinkRelease' was not declared in this scope; did you mean 'CGDisplayRelease'?
   43 |         CVDisplayLinkRelease(displayLink);
      |         ^~~~~~~~~~~~~~~~~~~~
      |         CGDisplayRelease
make[2]: *** [CMakeFiles/LLGL.dir/sources/Platform/MacOS/MacOSDisplay.mm.o] Error 1

With Core video off, apparently just NSApplication* ones:

/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-8c55fbc5b9baae5dbb1202bb15acadeaa2eff440/sources/Platform/MacOS/MacOSWindow.mm: In function '-[MacOSWindowDelegate window:willUseFullScreenPresentationOptions:]':
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-8c55fbc5b9baae5dbb1202bb15acadeaa2eff440/sources/Platform/MacOS/MacOSWindow.mm:141:9: error: 'NSApplicationPresentationFullScreen' was not declared in this scope; did you mean 'NSApplicationPresentationOptions'?
  141 |         NSApplicationPresentationFullScreen |
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |         NSApplicationPresentationOptions
[ 24%] Building CXX object CMakeFiles/LLGL.dir/sources/Renderer/QueryHeap.cpp.o
/opt/local/bin/g++-mp-12 -DGL_SILENCE_DEPRECATION -DLLGL_BUILD_RENDERER_NULL -DLLGL_BUILD_RENDERER_OPENGL -DLLGL_ENABLE_DEBUG_LAYER -DLLGL_ENABLE_UTILITY -DLLGL_EXPORTS -DLLGL_GL_ENABLE_DSA_EXT -DLLGL_GL_ENABLE_EXT_PLACEHOLDERS -DLLGL_GL_ENABLE_VENDOR_EXT -I/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-8c55fbc5b9baae5dbb1202bb15acadeaa2eff440/include -I/opt/local/include/Gauss -F//System/Library/Frameworks -I/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-8c55fbc5b9baae5dbb1202bb15acadeaa2eff440/external/OpenGL/include -pipe -Os -DNDEBUG -I/opt/local/include -D_GLIBCXX_USE_CXX11_ABI=0 -arch ppc -mmacosx-version-min=10.6 -fPIC -std=gnu++11 -MD -MT CMakeFiles/LLGL.dir/sources/Renderer/QueryHeap.cpp.o -MF CMakeFiles/LLGL.dir/sources/Renderer/QueryHeap.cpp.o.d -o CMakeFiles/LLGL.dir/sources/Renderer/QueryHeap.cpp.o -c /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-8c55fbc5b9baae5dbb1202bb15acadeaa2eff440/sources/Renderer/QueryHeap.cpp
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-8c55fbc5b9baae5dbb1202bb15acadeaa2eff440/sources/Platform/MacOS/MacOSWindow.mm:143:9: error: 'NSApplicationPresentationAutoHideToolbar' was not declared in this scope; did you mean 'NSApplicationPresentationAutoHideMenuBar'?
  143 |         NSApplicationPresentationAutoHideToolbar |
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |         NSApplicationPresentationAutoHideMenuBar
barracuda156 commented 1 year ago

@LukasBanana Perhaps solution is just to guard those NSApplication* with macros, like here: https://gist.github.com/miniupnp/a8f474c504eaa3ad9135

LukasBanana commented 1 year ago

Can you try 0d43ba7 and see if that fixes the remaining errors? I don't know what your setup is, but for any remaining errors of this kind, are you able to add those preprocessor guards on your end? This way we could iterate on that faster.

barracuda156 commented 1 year ago

@LukasBanana Thank you for an update! Looks promising, but we need to link to libatomic on 32-bit platforms with GCC:

[ 58%] Linking CXX shared library build/libLLGL_Null.dylib
/opt/local/bin/cmake -E cmake_link_script CMakeFiles/LLGL_Null.dir/link.txt --verbose=ON
/opt/local/bin/g++-mp-12 -pipe -Os -DNDEBUG -I/opt/local/include -D_GLIBCXX_USE_CXX11_ABI=0 -arch ppc -mmacosx-version-min=10.6 -dynamiclib -Wl,-headerpad_max_install_names -L/opt/local/lib -Wl,-headerpad_max_install_names -o build/libLLGL_Null.dylib -install_name /opt/local/lib/libLLGL_Null.dylib CMakeFiles/LLGL_Null.dir/sources/Renderer/Null/NullModuleInterface.cpp.o CMakeFiles/LLGL_Null.dir/sources/Renderer/Null/NullRenderSystem.cpp.o CMakeFiles/LLGL_Null.dir/sources/Renderer/Null/NullSwapChain.cpp.o CMakeFiles/LLGL_Null.dir/sources/Renderer/Null/Buffer/NullBuffer.cpp.o CMakeFiles/LLGL_Null.dir/sources/Renderer/Null/Buffer/NullBufferArray.cpp.o CMakeFiles/LLGL_Null.dir/sources/Renderer/Null/Command/NullCommandBuffer.cpp.o CMakeFiles/LLGL_Null.dir/sources/Renderer/Null/Command/NullCommandExecutor.cpp.o CMakeFiles/LLGL_Null.dir/sources/Renderer/Null/Command/NullCommandQueue.cpp.o CMakeFiles/LLGL_Null.dir/sources/Renderer/Null/RenderState/NullFence.cpp.o CMakeFiles/LLGL_Null.dir/sources/Renderer/Null/RenderState/NullPipelineLayout.cpp.o CMakeFiles/LLGL_Null.dir/sources/Renderer/Null/RenderState/NullPipelineState.cpp.o CMakeFiles/LLGL_Null.dir/sources/Renderer/Null/RenderState/NullQueryHeap.cpp.o CMakeFiles/LLGL_Null.dir/sources/Renderer/Null/RenderState/NullRenderPass.cpp.o CMakeFiles/LLGL_Null.dir/sources/Renderer/Null/RenderState/NullResourceHeap.cpp.o CMakeFiles/LLGL_Null.dir/sources/Renderer/Null/Shader/NullShader.cpp.o CMakeFiles/LLGL_Null.dir/sources/Renderer/Null/Texture/NullRenderTarget.cpp.o CMakeFiles/LLGL_Null.dir/sources/Renderer/Null/Texture/NullSampler.cpp.o CMakeFiles/LLGL_Null.dir/sources/Renderer/Null/Texture/NullTexture.cpp.o  -Wl,-rpath,/opt/local/lib build/libLLGL.dylib -Wl,-framework,Cocoa 
Undefined symbols:
  "___atomic_load_8", referenced from:
      __ZN4LLGL9NullFence13WaitForSignalEy in NullFence.cpp.o
  "___atomic_store_8", referenced from:
      __ZN4LLGL9NullFence6SignalEy in NullFence.cpp.o
ld: symbol(s) not found

(That is, in CMakeLists either check if example compiles without libatomic and link to the latter if not, or check for size of pointer, or just link to it whenever GCC is the compiler being used.)

barracuda156 commented 1 year ago

UPD. One more thing, there is a header problem here:

In file included from /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-0d43ba72ffbaf08928123b7c17fcbe259b5a407e/sources/Renderer/OpenGL/OpenGL.h:13,
                 from /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-0d43ba72ffbaf08928123b7c17fcbe259b5a407e/sources/Renderer/OpenGL/GLCore.h:12,
                 from /opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-0d43ba72ffbaf08928123b7c17fcbe259b5a407e/sources/Renderer/OpenGL/GLCore.cpp:8:
/opt/local/var/macports/build/_opt_PPCRosettaPorts_devel_LLGL/LLGL/work/LLGL-0d43ba72ffbaf08928123b7c17fcbe259b5a407e/sources/Renderer/OpenGL/GLCoreProfile/OpenGLCore.h:25:13: fatal error: OpenGL/gl3.h: No such file or directory
   25 | #   include <OpenGL/gl3.h>
      |             ^~~~~~~~~~~~~~
compilation terminated.
LukasBanana commented 1 year ago

Could you please open a PR for this change? This iteration on the compile errors is quite inconvenient since I don't have access to a Mac with Mac OS X 10.6 and I don't think I can easily install the Xcode deployment SDK for this system on my MacBook.

barracuda156 commented 1 year ago

@LukasBanana Let me try. Linking to libatomic is certainly doable, for the header I will check what options we have (assuming it is needed and cannot be just included conditionally).

barracuda156 commented 1 year ago

@LukasBanana I need to ask you one thing: is it possible to use Mesa includes for OpenGL? https://github.com/Mesa3D/mesa/tree/main/include If not, then the only option would be to disable OpenGL on macOS < 10.7, since it is not there in the OS itself.

barracuda156 commented 1 year ago

Headers Mesa installs:

/opt/local/include/GL/gl.h
/opt/local/include/GL/glcorearb.h
/opt/local/include/GL/glext.h
/opt/local/include/GL/glx.h
/opt/local/include/GL/glxext.h
/opt/local/include/GL/internal/dri_interface.h
/opt/local/include/GL/osmesa.h
/opt/local/include/GLES/egl.h
/opt/local/include/GLES/gl.h
/opt/local/include/GLES/glext.h
/opt/local/include/GLES/glplatform.h
/opt/local/include/GLES2/gl2.h
/opt/local/include/GLES2/gl2ext.h
/opt/local/include/GLES2/gl2platform.h
/opt/local/include/GLES3/gl3.h
/opt/local/include/GLES3/gl31.h
/opt/local/include/GLES3/gl32.h
/opt/local/include/GLES3/gl3ext.h
/opt/local/include/GLES3/gl3platform.h
LukasBanana commented 1 year ago

If it's not there on macOS before 10.7, how would you run OpenGL applications then? If it's just for the headers, they are already included in this repository: https://github.com/LukasBanana/LLGL/tree/master/external/OpenGL/include/GL

Perhaps some more have to be added, but I don't think another library dependency is necessary to support legacy systems.

Update LLGL also supports GL 2.X, though. If it's just a problem of <OpenGL/gl3.h>, but <OpenGL/gl2.h> or the like would be okay, you can enable CMake option LLGL_GL_ENABLE_OPENGL2X to use legacy OpenGL.

barracuda156 commented 1 year ago

I will check what headers are there. It certainly has some support for OpenGL, it was there since Tiger if not earlier, but perhaps not what LLGL expects.

Looking at how Macports handled some related issues, they opted for Mesa and X11 for systems where native implementation is lacking or insufficient. Like: https://github.com/macports/macports-ports/commit/1b5491fea996e493a165b1cae71c2015c758c206 (I did not mean of course that LLGL has to declare an external dependency, rather that we can make a patch in Macports for <10.7, if that is the only way to support those OSs.)

LukasBanana commented 2 months ago

After 1 1/2 years, I finally found the time to revisit this issue. I submitted a few commits into dev-macosx10_6 branch and 18541f9 makes the GL backend fully compatible with OpenGL 2.x and Mac OS X 10.6. You can run $ ./BuildMacOS.command --legacy to build for OSX 10.6.

I can't speak for the PowerPC versions of OSX as I don't have one at hand. These changes also require a Clang compiler from MacPorts (I tested with clang-11 and clang-16). GNU 4 from Xcode 3 will fail with weird linker errors indicating issues with ObjC code generation.

Please let me know if these changes work for you in case this is still of any interested.