macOS fixes
This commit is contained in:
parent
cfe136796c
commit
a6dce6861d
|
|
@ -21,7 +21,7 @@ namespace Nz::GL
|
||||||
EGLContextWin32(EGLContextWin32&&) = default;
|
EGLContextWin32(EGLContextWin32&&) = default;
|
||||||
~EGLContextWin32() = default;
|
~EGLContextWin32() = default;
|
||||||
|
|
||||||
bool Create(const ContextParams& params, const EGLContextBase* shareContext = nullptr);
|
bool Create(const ContextParams& params, const EGLContextBase* shareContext = nullptr) override;
|
||||||
bool Create(const ContextParams& params, WindowHandle window, const EGLContextBase* shareContext = nullptr) override;
|
bool Create(const ContextParams& params, WindowHandle window, const EGLContextBase* shareContext = nullptr) override;
|
||||||
void Destroy() override;
|
void Destroy() override;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ namespace Nz
|
||||||
{
|
{
|
||||||
Invalid,
|
Invalid,
|
||||||
|
|
||||||
|
Cocoa,
|
||||||
X11,
|
X11,
|
||||||
Wayland,
|
Wayland,
|
||||||
Windows
|
Windows
|
||||||
|
|
@ -27,6 +28,11 @@ namespace Nz
|
||||||
|
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
void* window; //< NSWindow*
|
||||||
|
} cocoa;
|
||||||
|
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
void* display; //< Display*
|
void* display; //< Display*
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@
|
||||||
#include <Nazara/Platform/SDL2/SDLHelper.hpp>
|
#include <Nazara/Platform/SDL2/SDLHelper.hpp>
|
||||||
#include <Nazara/Utility/Image.hpp>
|
#include <Nazara/Utility/Image.hpp>
|
||||||
#include <SDL2/SDL.h>
|
#include <SDL2/SDL.h>
|
||||||
#include <SDL2/SDL_config.h>
|
|
||||||
#include <SDL2/SDL_syswm.h>
|
#include <SDL2/SDL_syswm.h>
|
||||||
#include <Utfcpp/utf8.h>
|
#include <Utfcpp/utf8.h>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
@ -202,6 +201,14 @@ namespace Nz
|
||||||
|
|
||||||
switch (wmInfo.subsystem)
|
switch (wmInfo.subsystem)
|
||||||
{
|
{
|
||||||
|
#if defined(SDL_VIDEO_DRIVER_COCOA)
|
||||||
|
case SDL_SYSWM_COCOA:
|
||||||
|
{
|
||||||
|
handle.type = WindowManager::Cocoa;
|
||||||
|
handle.cocoa.window = wmInfo.info.cocoa.window;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
#if defined(SDL_VIDEO_DRIVER_X11)
|
#if defined(SDL_VIDEO_DRIVER_X11)
|
||||||
case SDL_SYSWM_X11:
|
case SDL_SYSWM_X11:
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#elif defined(NAZARA_PLATFORM_MACOS)
|
||||||
#else
|
#else
|
||||||
#error This OS is not supported by Vulkan
|
#error This OS is not supported by Vulkan
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,7 @@ local modules = {
|
||||||
add_defines("SDL_VIDEO_DRIVER_WAYLAND=1")
|
add_defines("SDL_VIDEO_DRIVER_WAYLAND=1")
|
||||||
elseif is_plat("macosx") then
|
elseif is_plat("macosx") then
|
||||||
add_defines("SDL_VIDEO_DRIVER_COCOA=1")
|
add_defines("SDL_VIDEO_DRIVER_COCOA=1")
|
||||||
|
add_sysincludedirs("/opt/X11/include")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
|
|
@ -101,7 +102,7 @@ local modules = {
|
||||||
add_defines("VK_USE_PLATFORM_XLIB_KHR")
|
add_defines("VK_USE_PLATFORM_XLIB_KHR")
|
||||||
add_defines("VK_USE_PLATFORM_WAYLAND_KHR")
|
add_defines("VK_USE_PLATFORM_WAYLAND_KHR")
|
||||||
elseif is_plat("macosx") then
|
elseif is_plat("macosx") then
|
||||||
add_defines("VK_USE_PLATFORM_MACOS_MVK")
|
add_defines("VK_USE_PLATFORM_METAL_EXT")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue