Basic support for Vulkan Portability on OSX

This commit is contained in:
Dzmitry Malyshau 2018-08-17 21:13:25 -04:00 committed by kd-11
parent eaf20295ac
commit c452b43ebc
8 changed files with 90 additions and 29 deletions

View file

@ -13,6 +13,8 @@
#ifdef _WIN32
#include <windows.h>
#elif defined(__APPLE__)
//nothing
#else
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
#include <QGuiApplication>
@ -200,6 +202,8 @@ display_handle_t gs_frame::handle() const
{
#ifdef _WIN32
return (HWND) this->winId();
#elif defined(__APPLE__)
return (void*) this->winId(); //NSView
#else
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
QPlatformNativeInterface *native = QGuiApplication::platformNativeInterface();
@ -238,7 +242,7 @@ void gs_frame::delete_context(draw_context_t ctx)
int gs_frame::client_width()
{
#ifdef _WIN32
#if defined(_WIN32) || defined(__APPLE__)
return size().width();
#else
return size().width() * devicePixelRatio();
@ -247,7 +251,7 @@ int gs_frame::client_width()
int gs_frame::client_height()
{
#ifdef _WIN32
#if defined(_WIN32) || defined(__APPLE__)
return size().height();
#else
return size().height() * devicePixelRatio();