Browse Source

Fix macOS build, adjust cairo include

pull/321/head
falkTX 2 years ago
parent
commit
bbe215891b
2 changed files with 6 additions and 7 deletions
  1. +2
    -7
      dgl/src/pugl.cpp
  2. +4
    -0
      dgl/src/pugl.hpp

+ 2
- 7
dgl/src/pugl.cpp View File

@@ -20,7 +20,7 @@
// include base headers // include base headers


#ifdef DGL_CAIRO #ifdef DGL_CAIRO
# include <cairo/cairo.h>
# include <cairo.h>
#endif #endif
#ifdef DGL_OPENGL #ifdef DGL_OPENGL
# include "../OpenGL-include.hpp" # include "../OpenGL-include.hpp"
@@ -42,7 +42,6 @@
# include <dlfcn.h> # include <dlfcn.h>
# include <mach/mach_time.h> # include <mach/mach_time.h>
# ifdef DGL_CAIRO # ifdef DGL_CAIRO
# include <cairo.h>
# include <cairo-quartz.h> # include <cairo-quartz.h>
# endif # endif
# ifdef DGL_OPENGL # ifdef DGL_OPENGL
@@ -50,7 +49,6 @@
# endif # endif
# ifdef DGL_VULKAN # ifdef DGL_VULKAN
# import <QuartzCore/CAMetalLayer.h> # import <QuartzCore/CAMetalLayer.h>
# include <vulkan/vulkan_core.h>
# include <vulkan/vulkan_macos.h> # include <vulkan/vulkan_macos.h>
# endif # endif
#elif defined(DISTRHO_OS_WINDOWS) #elif defined(DISTRHO_OS_WINDOWS)
@@ -59,7 +57,6 @@
# include <windows.h> # include <windows.h>
# include <windowsx.h> # include <windowsx.h>
# ifdef DGL_CAIRO # ifdef DGL_CAIRO
# include <cairo.h>
# include <cairo-win32.h> # include <cairo-win32.h>
# endif # endif
# ifdef DGL_OPENGL # ifdef DGL_OPENGL
@@ -113,8 +110,6 @@


#ifndef DISTRHO_OS_MAC #ifndef DISTRHO_OS_MAC
START_NAMESPACE_DGL START_NAMESPACE_DGL
#else
USE_NAMESPACE_DGL
#endif #endif


// -------------------------------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------------------------------
@@ -237,7 +232,7 @@ double puglGetScaleFactorFromParent(const PuglView* const view)
const PuglNativeView parent = view->parent ? view->parent : view->transientParent ? view->transientParent : 0; const PuglNativeView parent = view->parent ? view->parent : view->transientParent ? view->transientParent : 0;
#if defined(DISTRHO_OS_MAC) #if defined(DISTRHO_OS_MAC)
NSWindow* const window = parent != 0 ? [(NSView*)parent window] NSWindow* const window = parent != 0 ? [(NSView*)parent window]
: view->impl->window ? view->impl->window : [view->impl->wrapperView window]);
: view->impl->window ? view->impl->window : [view->impl->wrapperView window];
NSScreen* const screen = window != nullptr ? [window screen] : [NSScreen mainScreen]; NSScreen* const screen = window != nullptr ? [window screen] : [NSScreen mainScreen];
return [screen backingScaleFactor]; return [screen backingScaleFactor];
#elif defined(DISTRHO_OS_WINDOWS) #elif defined(DISTRHO_OS_WINDOWS)


+ 4
- 0
dgl/src/pugl.hpp View File

@@ -35,7 +35,9 @@
#define PUGL_NO_INCLUDE_GL_H #define PUGL_NO_INCLUDE_GL_H
#define PUGL_NO_INCLUDE_GLU_H #define PUGL_NO_INCLUDE_GLU_H


#ifndef DISTRHO_OS_MAC
START_NAMESPACE_DGL START_NAMESPACE_DGL
#endif


#include "pugl-upstream/include/pugl/pugl.h" #include "pugl-upstream/include/pugl/pugl.h"


@@ -105,6 +107,8 @@ void puglX11SetWindowTypeAndPID(const PuglView* view, bool isStandalone);


// -------------------------------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------------------------------


#ifndef DISTRHO_OS_MAC
END_NAMESPACE_DGL END_NAMESPACE_DGL
#endif


#endif // DGL_PUGL_HPP_INCLUDED #endif // DGL_PUGL_HPP_INCLUDED

Loading…
Cancel
Save