Create windows with SDL_WINDOW_METAL on macOS

This prevents the window from being recreated when initializing a Metal renderer.
This commit is contained in:
Cameron Gutman
2020-09-05 14:06:56 -07:00
parent 62b296cf85
commit 3e9781033a
4 changed files with 62 additions and 21 deletions

View File

@@ -6,6 +6,15 @@
#include <ApplicationServices/ApplicationServices.h>
#endif
Uint32 StreamUtils::getPlatformWindowFlags()
{
#ifdef Q_OS_DARWIN
return SDL_WINDOW_METAL;
#else
return 0;
#endif
}
void StreamUtils::scaleSourceToDestinationSurface(SDL_Rect* src, SDL_Rect* dst)
{
int dstH = dst->w * src->h / src->w;