Compare commits
5 Commits
a38cc4d5cb
...
sdl_wip
| Author | SHA1 | Date | |
|---|---|---|---|
| 3554747a67 | |||
| 62968dd437 | |||
| c660fac524 | |||
| 431a69e357 | |||
| f4fcc07288 |
@@ -75,7 +75,7 @@ namespace FlaxEditor.GUI.Docking
|
||||
settings.MaximumSize = Float2.Zero; // Unlimited size
|
||||
settings.Fullscreen = false;
|
||||
settings.HasBorder = true;
|
||||
settings.SupportsTransparency = false;
|
||||
settings.SupportsTransparency = true;
|
||||
settings.ActivateWhenFirstShown = true;
|
||||
settings.AllowInput = true;
|
||||
settings.AllowMinimize = true;
|
||||
|
||||
@@ -84,13 +84,15 @@ namespace FlaxEditor.GUI
|
||||
|
||||
ScriptsBuilder.GetBinariesConfiguration(out _, out _, out _, out var configuration);
|
||||
|
||||
var driver = Platform.DisplayServer;
|
||||
|
||||
_icon = new Image
|
||||
{
|
||||
Margin = new Margin(6, 6, 6, 6),
|
||||
Brush = new TextureBrush(windowIcon),
|
||||
Color = Style.Current.Foreground,
|
||||
KeepAspectRatio = false,
|
||||
TooltipText = string.Format("{0}\nVersion {1}\nConfiguration {3}\nGraphics {2}", _window.Title, Globals.EngineVersion, GPUDevice.Instance.RendererType, configuration),
|
||||
TooltipText = string.Format("{0}\nVersion {1}\nConfiguration {3}\nGraphics {2} {4}", _window.Title, Globals.EngineVersion, GPUDevice.Instance.RendererType, configuration, driver),
|
||||
Parent = this,
|
||||
};
|
||||
|
||||
|
||||
@@ -374,7 +374,9 @@ bool GPUSwapChainVulkan::CreateSwapChain(int32 width, int32 height)
|
||||
swapChainInfo.presentMode = presentMode;
|
||||
swapChainInfo.clipped = VK_TRUE;
|
||||
swapChainInfo.compositeAlpha = VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR;
|
||||
if (surfProperties.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR)
|
||||
if (_window->GetSettings().SupportsTransparency && surfProperties.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR)
|
||||
swapChainInfo.compositeAlpha = VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR;
|
||||
else if (surfProperties.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR)
|
||||
swapChainInfo.compositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR;
|
||||
|
||||
// Create swap chain
|
||||
|
||||
@@ -249,6 +249,15 @@ PlatformType PlatformBase::GetPlatformType()
|
||||
return PLATFORM_TYPE;
|
||||
}
|
||||
|
||||
#if !PLATFORM_SDL
|
||||
|
||||
String PlatformBase::GetDisplayServer()
|
||||
{
|
||||
return String::Empty;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
bool PlatformBase::Is64BitApp()
|
||||
{
|
||||
#if PLATFORM_64BITS
|
||||
|
||||
@@ -345,6 +345,11 @@ public:
|
||||
/// </summary>
|
||||
API_PROPERTY() static PlatformType GetPlatformType();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the display server name on Linux.
|
||||
/// </summary>
|
||||
API_PROPERTY() static String GetDisplayServer() = delete;
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if is running 64 bit application (otherwise 32 bit). It's compile-time constant.
|
||||
/// </summary>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved.
|
||||
|
||||
#if USE_EDITOR && PLATFORM_LINUX
|
||||
#if PLATFORM_LINUX
|
||||
|
||||
#include "Engine/Platform/Types.h"
|
||||
#include "Engine/Platform/ScreenUtilities.h"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#if USE_EDITOR && PLATFORM_LINUX
|
||||
#if PLATFORM_LINUX
|
||||
|
||||
#include "Engine/Platform/Base/ScreenUtilitiesBase.h"
|
||||
#include "Engine/Core/Types/BaseTypes.h"
|
||||
|
||||
@@ -310,7 +310,7 @@ namespace WaylandImpl
|
||||
LOG(Warning, "wl_display_roundtrip_queue failed, errno: {}", errno);
|
||||
|
||||
// Wait until window has showed up
|
||||
if (wrappedToplevel == nullptr && dragWindow && Platform::AtomicRead(&WaitFlag) != 0)
|
||||
if (DragManager != nullptr && wrappedToplevel == nullptr && dragWindow && Platform::AtomicRead(&WaitFlag) != 0)
|
||||
{
|
||||
auto toplevel = static_cast<xdg_toplevel*>(SDL_GetPointerProperty(SDL_GetWindowProperties(draggedWindow), SDL_PROP_WINDOW_WAYLAND_XDG_TOPLEVEL_POINTER, nullptr));
|
||||
if (toplevel != nullptr)
|
||||
@@ -1431,7 +1431,11 @@ DragDropEffect SDLWindow::DoDragDrop(const StringView& data, const Float2& offse
|
||||
else
|
||||
SDL_ShowWindow(_window);
|
||||
}
|
||||
WindowBase::Show();
|
||||
// Only show the window if toplevel dragging is supported
|
||||
if (WaylandImpl::DragManager != nullptr)
|
||||
WindowBase::Show();
|
||||
else
|
||||
Hide();
|
||||
|
||||
WaylandImpl::DraggingWindow = true;
|
||||
DoDragDropWayland(String(""), dragSourceWindow, dragOffset);
|
||||
|
||||
@@ -166,6 +166,18 @@ bool SDLPlatform::HandleEvent(SDL_Event& event)
|
||||
return true;
|
||||
}
|
||||
|
||||
String SDLPlatform::GetDisplayServer()
|
||||
{
|
||||
#if PLATFORM_LINUX
|
||||
String driver(SDL_GetCurrentVideoDriver());
|
||||
if (driver.Length() > 0)
|
||||
driver[0] = StringUtils::ToUpper(driver[0]);
|
||||
return driver;
|
||||
#else
|
||||
return String::Empty;
|
||||
#endif
|
||||
}
|
||||
|
||||
BatteryInfo SDLPlatform::GetBatteryInfo()
|
||||
{
|
||||
BatteryInfo info;
|
||||
|
||||
@@ -63,6 +63,7 @@ public:
|
||||
static bool Init();
|
||||
static void LogInfo();
|
||||
static void Tick();
|
||||
static String GetDisplayServer();
|
||||
static void SetHighDpiAwarenessEnabled(bool enable);
|
||||
static BatteryInfo GetBatteryInfo();
|
||||
static int32 GetDpi();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved.
|
||||
|
||||
#if USE_EDITOR && PLATFORM_WINDOWS
|
||||
#if PLATFORM_WINDOWS
|
||||
|
||||
#include "Engine/Platform/Types.h"
|
||||
#include "Engine/Platform/ScreenUtilities.h"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#if USE_EDITOR && PLATFORM_WINDOWS
|
||||
#if PLATFORM_WINDOWS
|
||||
|
||||
#include "Engine/Platform/Base/ScreenUtilitiesBase.h"
|
||||
#include "Engine/Core/Types/BaseTypes.h"
|
||||
|
||||
Reference in New Issue
Block a user