Code style formatting and minor tweaks

#2800
This commit is contained in:
Wojtek Figat
2026-02-11 17:15:15 +01:00
parent 0bea701a83
commit 273b110db4
41 changed files with 108 additions and 116 deletions

View File

@@ -4,7 +4,7 @@
"Major": 1,
"Minor": 12,
"Revision": 0,
"Build": 6904
"Build": 6905
},
"Company": "Flax",
"Copyright": "Copyright (c) 2012-2026 Wojciech Figat. All rights reserved.",

View File

@@ -188,7 +188,7 @@
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_FIELD_ATTRIBUTE_ON_SAME_LINE/@EntryValue">False</s:Boolean>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_FIELD_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">NEVER</s:String>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_SIMPLE_ACCESSOR_ATTRIBUTE_ON_SAME_LINE/@EntryValue">False</s:Boolean>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_SIMPLE_CASE_STATEMENT_ON_SAME_LINE/@EntryValue">ALWAYS</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_SIMPLE_EMBEDDED_STATEMENT_ON_SAME_LINE/@EntryValue">NEVER</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SIMPLE_CASE_STATEMENT_STYLE/@EntryValue">ON_SINGLE_LINE</s:String>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_AFTER_TYPECAST_PARENTHESES/@EntryValue">False</s:Boolean>

View File

@@ -195,7 +195,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
filesCount += files.Length;
foreach (var file in files)
FindNewKeysCpp(file, newKeys, allKeys);
files = Directory.GetFiles(Globals.ProjectSourceFolder, "*.h", SearchOption.AllDirectories).Concat(Directory.GetFiles(Globals.ProjectSourceFolder, "*.hpp", SearchOption.AllDirectories)).ToArray();;
files = Directory.GetFiles(Globals.ProjectSourceFolder, "*.h", SearchOption.AllDirectories).Concat(Directory.GetFiles(Globals.ProjectSourceFolder, "*.hpp", SearchOption.AllDirectories)).ToArray();
filesCount += files.Length;
foreach (var file in files)
FindNewKeysCpp(file, newKeys, allKeys);

View File

@@ -279,7 +279,7 @@ namespace FlaxEditor.GUI.ContextMenu
_window.GotFocus += OnWindowGotFocus;
_window.LostFocus += OnWindowLostFocus;
}
#if USE_IS_FOREGROUND && USE_SDL_WORKAROUNDS
// The focus between popup and parent windows doesn't change, force hide the popup when clicked on parent
parentWin.Window.MouseDown += OnWindowMouseDown;

View File

@@ -50,7 +50,7 @@ namespace FlaxEditor.GUI.Docking
/// The mouse position.
/// </summary>
public Float2 MousePosition = Float2.Minimum;
/// <summary>
/// The mouse position.
/// </summary>

View File

@@ -193,6 +193,7 @@ namespace FlaxEditor.GUI.Docking
{
CreateFloating(Float2.Zero, Float2.Zero);
}
/// <summary>
/// Creates the window in a floating state.
/// </summary>

View File

@@ -14,13 +14,13 @@ namespace FlaxEditor.GUI.Docking
private class FloatWindowDecorations : WindowDecorations
{
private FloatWindowDockPanel _panel;
public FloatWindowDecorations(FloatWindowDockPanel panel)
: base(panel.RootWindow)
{
_panel = panel;
}
/// <inheritdoc />
public override bool OnMouseDown(Float2 location, MouseButton button)
{
@@ -76,19 +76,19 @@ namespace FlaxEditor.GUI.Docking
Parent = window;
_window.Window.Closing += OnClosing;
_window.Window.LeftButtonHit += OnLeftButtonHit;
if (Utilities.Utils.UseCustomWindowDecorations())
{
var decorations = Parent.AddChild(new FloatWindowDecorations(this));
decorations.SetAnchorPreset(AnchorPresets.HorizontalStretchTop, false);
}
}
/// <inheritdoc />
protected override void PerformLayoutBeforeChildren()
{
base.PerformLayoutBeforeChildren();
var decorations = Parent.GetChild<FloatWindowDecorations>();
if (decorations != null)
{
@@ -143,7 +143,7 @@ namespace FlaxEditor.GUI.Docking
settings.ShowAfterFirstPaint = false;
settings.ShowInTaskbar = true;
settings.StartPosition = startPosition;
if (Utilities.Utils.UseCustomWindowDecorations())
{
settings.HasBorder = false;

View File

@@ -322,7 +322,7 @@ namespace FlaxEditor.GUI.Input
#else
/// <inheritdoc />
public override void OnMouseMoveRelative(Float2 mouseMotion)
public override void OnMouseMoveRelative(Float2 motion)
{
var location = Root.TrackingMouseOffset;
if (_isSliding)
@@ -344,7 +344,7 @@ namespace FlaxEditor.GUI.Input
_cursorChanged = false;
}
base.OnMouseMoveRelative(mouseMotion);
base.OnMouseMoveRelative(motion);
}
#endif

View File

@@ -1,8 +1,5 @@
// Copyright (c) Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.GUI.Docking;
using FlaxEditor.Options;
using FlaxEngine;
using FlaxEngine.GUI;
@@ -26,12 +23,12 @@ public class WindowDecorations : ContainerControl
/// The title label in the title bar.
/// </summary>
public Label Title => _title;
/// <summary>
/// The icon used in the title bar.
/// </summary>
public Image Icon => _icon;
/// <summary>
/// The tooltip shown when hovering over the icon.
/// </summary>
@@ -54,7 +51,7 @@ public class WindowDecorations : ContainerControl
: base(0, 0, 0, 20)
{
_window = window.RootWindow.Window;
AutoFocus = false;
AnchorPreset = AnchorPresets.HorizontalStretchTop;
BackgroundColor = Color.Transparent;
@@ -75,13 +72,13 @@ public class WindowDecorations : ContainerControl
{
_icon.Margin = new Margin(6, 6, 6, 6);
Height = 28;
_window.HitTest += OnHitTest;
_window.Closed += OnWindowClosed;
FontAsset windowIconsFont = FlaxEngine.Content.LoadAsyncInternal<FontAsset>(EditorAssets.WindowIconsFont);
Font iconFont = windowIconsFont?.CreateFont(9);
_title = new Label(0, 0, Width, Height)
{
Text = _window.Title,
@@ -150,7 +147,7 @@ public class WindowDecorations : ContainerControl
_charChromeMaximize = ((char)EditorAssets.SegMDL2Icons.ChromeMaximize).ToString();
}
}
/// <inheritdoc />
public override void Update(float deltaTime)
{
@@ -216,20 +213,20 @@ public class WindowDecorations : ContainerControl
if (pos.Y > winSize.Y - distance)
return WindowHitCodes.Bottom;
}
var controlUnderMouse = GetChildAt(pos, control => control != _title);
if (_title.Bounds.Contains(pos) && controlUnderMouse == null)
return WindowHitCodes.Caption;
return WindowHitCodes.Client;
}
/// <inheritdoc />
public override bool OnMouseDoubleClick(Float2 location, MouseButton button)
{
// These may not work with main window due to SDL not passing mouse events
// when interacting with hit tests on caption area...
if (Title.Bounds.Contains(location) && button == MouseButton.Left)
{
if (_window.IsMaximized)
@@ -251,7 +248,7 @@ public class WindowDecorations : ContainerControl
{
// Calculate extents for title bounds area excluding the icon and main menu area
float x = 0;
// Icon
if (_icon != null)
{
@@ -273,7 +270,7 @@ public class WindowDecorations : ContainerControl
}
}
}
// Buttons
float rightMostButtonX = Width;
if (_closeButton != null)
@@ -302,7 +299,7 @@ public class WindowDecorations : ContainerControl
_title.Bounds = new Rectangle(x, 0, rightMostButtonX - x, Height);
}
}
/// <inheritdoc />
public override void Draw()
{
@@ -321,7 +318,7 @@ public class WindowDecorations : ContainerControl
if (Editor.Instance.UI.StatusBar == null)
return;
const float thickness = 1.0f;
Color color = Editor.Instance.UI.StatusBar.StatusColor;
Rectangle rect = new Rectangle(thickness * 0.5f, thickness * 0.5f, Parent.Width - thickness, Parent.Height - thickness);

View File

@@ -30,7 +30,7 @@ namespace FlaxEditor.Modules
{
private class MainWindowDecorations : WindowDecorations
{
public MainWindowDecorations(RootControl window, bool iconOnly)
public MainWindowDecorations(RootControl window, bool iconOnly)
: base(window, iconOnly)
{
}
@@ -45,7 +45,7 @@ namespace FlaxEditor.Modules
var editor = Editor.Instance;
return editor.Windows.EditWin.InputActions.Process(editor, this, key);
}
/// <inheritdoc />
public override void DrawBorders()
{
@@ -61,7 +61,7 @@ namespace FlaxEditor.Modules
Render2D.DrawLine(rect.UpperRight, rect.BottomRight, color);
}
}
private struct Status
{
public int ID;
@@ -78,7 +78,7 @@ namespace FlaxEditor.Modules
private bool _progressFailed;
ContextMenuSingleSelectGroup<int> _numberOfClientsGroup = new ContextMenuSingleSelectGroup<int>();
/// <summary>
/// Defines a viewport scaling option.
/// </summary>
@@ -99,7 +99,7 @@ namespace FlaxEditor.Modules
/// </summary>
Aspect = 1,
}
/// <summary>
/// The name.
/// </summary>
@@ -115,7 +115,7 @@ namespace FlaxEditor.Modules
/// </summary>
public Int2 Size;
}
/// <summary>
/// The default viewport scaling options.
/// </summary>
@@ -486,7 +486,7 @@ namespace FlaxEditor.Modules
// Update window background
mainWindow.BackgroundColor = Style.Current.Background;
InitViewportScaleOptions();
InitSharedMenus();
@@ -497,7 +497,7 @@ namespace FlaxEditor.Modules
InitWindowDecorations(mainWindow);
Editor.Options.OptionsChanged += OnOptionsChanged;
mainWindow.PerformLayout(true);
}
@@ -536,7 +536,7 @@ namespace FlaxEditor.Modules
Size = new Int2(2560, 1440),
});
}
if (Editor.Instance.ProjectCache.TryGetCustomData("CustomViewportScalingOptions", out string data))
{
CustomViewportScaleOptions = JsonSerializer.Deserialize<List<ViewportScaleOption>>(data);
@@ -549,7 +549,7 @@ namespace FlaxEditor.Modules
public void SaveCustomViewportScalingOptions()
{
var customOptions = JsonSerializer.Serialize(CustomViewportScaleOptions);
Editor.Instance.ProjectCache.SetCustomData("CustomViewportScalingOptions", customOptions);
Editor.Instance.ProjectCache.SetCustomData("CustomViewportScalingOptions", customOptions);
}
/// <inheritdoc />
@@ -778,7 +778,7 @@ namespace FlaxEditor.Modules
MenuWindow = MainMenu.AddButton("Window");
cm = MenuWindow.ContextMenu;
cm.VisibleChanged += OnMenuWindowVisibleChanged;
cm.AddButton("Content", inputOptions.ContentWindow,Editor.Windows.ContentWin.FocusOrShow);
cm.AddButton("Content", inputOptions.ContentWindow, Editor.Windows.ContentWin.FocusOrShow);
cm.AddButton("Scene", inputOptions.SceneWindow, Editor.Windows.SceneWin.FocusOrShow);
cm.AddButton("Toolbox", inputOptions.ToolboxWindow, Editor.Windows.ToolboxWin.FocusOrShow);
cm.AddButton("Properties", inputOptions.PropertiesWindow, Editor.Windows.PropertiesWin.FocusOrShow);
@@ -817,14 +817,14 @@ namespace FlaxEditor.Modules
var driver = Platform.DisplayServer;
if (!string.IsNullOrEmpty(driver))
driver = $" ({driver})";
WindowDecorations = new MainWindowDecorations(mainWindow, !Utilities.Utils.UseCustomWindowDecorations(isMainWindow: true))
{
Parent = mainWindow,
IconTooltipText = $"{mainWindow.RootWindow.Title}\nVersion {Globals.EngineVersion}\nConfiguration {configuration}\nGraphics {GPUDevice.Instance.RendererType}{driver}",
};
}
private void OnOptionsChanged(EditorOptions options)
{
var inputOptions = options.Input;

View File

@@ -85,10 +85,12 @@ namespace FlaxEditor.Options
/// Never show the close button.
/// </summary>
Never,
/// <summary>
/// Show the close button on tabs that are currently selected.
/// </summary>
SelectedTab,
/// <summary>
/// Show the close button on all tabs that can be closed.
/// </summary>
@@ -188,18 +190,18 @@ namespace FlaxEditor.Options
/// Determined automatically based on the system and any known compatibility issues with native decorations.
/// </summary>
Auto,
/// <summary>
/// Automatically choose most compatible window decorations for child windows, prefer custom decorations on main window.
/// </summary>
[EditorDisplay(Name = "Auto (Child Only)")]
AutoChildOnly,
/// <summary>
/// Use native system window decorations on all windows.
/// </summary>
Native,
/// <summary>
/// Use custom client-side window decorations on all windows.
/// </summary>
@@ -322,7 +324,7 @@ namespace FlaxEditor.Options
#endif
/// <summary>
/// Gets or sets a value indicating wether the minum tab width should be used. Editor restart required.
/// Gets or sets a value indicating whether the minimum tab width should be used. Editor restart required.
/// </summary>
[DefaultValue(false)]
[EditorDisplay("Tabs & Windows"), EditorOrder(99)]
@@ -518,7 +520,7 @@ namespace FlaxEditor.Options
[DefaultValue(1), Range(1, 4)]
[EditorDisplay("Cook & Run"), EditorOrder(600)]
public int NumberOfGameClientsToLaunch = 1;
/// <summary>
/// Gets or sets the build configuration to use when using Cook and Run option in the editor.
/// </summary>
@@ -533,7 +535,7 @@ namespace FlaxEditor.Options
public float ConnectionCurvature { get; set; } = 1.0f;
/// <summary>
/// Gets or sets a value that indicates wether the context menu description panel is shown or not.
/// Gets or sets a value that indicates whether the context menu description panel is shown or not.
/// </summary>
[DefaultValue(true)]
[EditorDisplay("Visject"), EditorOrder(550), Tooltip("Shows/hides the description panel in visual scripting context menu.")]

View File

@@ -2,4 +2,5 @@
#pragma once
// [Deprecated in v1.12]
#include "Engine/Platform/ScreenUtilities.h"

View File

@@ -1586,6 +1586,7 @@ namespace FlaxEditor.Utilities
internal static bool UseCustomWindowDecorations(bool isMainWindow = false)
{
#if PLATFORM_SDL
return Editor.Instance.Options.Options.Interface.WindowDecorations switch
{
Options.InterfaceOptions.WindowDecorationsType.Auto => !Platform.SupportsNativeDecorations,
@@ -1594,6 +1595,11 @@ namespace FlaxEditor.Utilities
Options.InterfaceOptions.WindowDecorationsType.ClientSide => true,
_ => throw new ArgumentOutOfRangeException()
};
#elif PLATFORM_WINDOWS
return !Editor.Instance.Options.Options.Interface.UseNativeWindowSystem;
#else
return false;
#endif
}
internal static bool HideSingleTabWindowTabBars()

View File

@@ -1923,10 +1923,9 @@ namespace FlaxEditor.Viewport
_input.MouseWheelDelta = 0;
}
/// <inheritdoc />
public void OnMouseMoveRelative(ref Float2 mouseMotion)
private void OnMouseMoveRelative(ref Float2 motion)
{
_mouseDelta += mouseMotion;
_mouseDelta += motion;
}
/// <inheritdoc />

View File

@@ -9,8 +9,6 @@
// Support more backbuffers in case driver decides to use more
#define VULKAN_BACK_BUFFERS_COUNT_MAX 8
class GPUDeviceVulkan;
/// <summary>
/// The implementation for the Vulkan API support for Android platform.
/// </summary>

View File

@@ -5,7 +5,6 @@
#include "LinuxVulkanPlatform.h"
#include "../RenderToolsVulkan.h"
#include "Engine/Platform/Window.h"
#include "Engine/Platform/Linux/IncludeX11.h"
#define Display X11::Display
#define Window X11::Window
@@ -14,7 +13,6 @@
#undef Display
#undef Window
#undef VisualID
#include "vulkan/vulkan_wayland.h"
// Export extension from volk

View File

@@ -12,8 +12,6 @@
// Prevent wierd error 'Invalid VkValidationCacheEXT Object'
#define VULKAN_USE_VALIDATION_CACHE 0
class GPUDeviceVulkan;
/// <summary>
/// The implementation for the Vulkan API support for Linux platform.
/// </summary>

View File

@@ -11,8 +11,6 @@
// General/Validation Error:0 VK_ERROR_INITIALIZATION_FAILED: Could not create MTLCounterSampleBuffer for query pool of type VK_QUERY_TYPE_TIMESTAMP. Reverting to emulated behavior. (Error code 0): Cannot allocate sample buffer
#define VULKAN_USE_TIMER_QUERIES 0
class GPUDeviceVulkan;
/// <summary>
/// The implementation for the Vulkan API support for Mac platform.
/// </summary>

View File

@@ -17,6 +17,8 @@ enum class VulkanValidationLevel
All = 5,
};
class GPUDeviceVulkan;
/// <summary>
/// The base implementation for the Vulkan API platform support.
/// </summary>

View File

@@ -16,11 +16,10 @@ void Win32VulkanPlatform::GetInstanceExtensions(Array<const char*>& extensions,
void Win32VulkanPlatform::CreateSurface(Window* window, GPUDeviceVulkan* device, VkInstance instance, VkSurfaceKHR* surface)
{
void* windowHandle = window->GetNativePtr();
VkWin32SurfaceCreateInfoKHR surfaceCreateInfo;
RenderToolsVulkan::ZeroStruct(surfaceCreateInfo, VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR);
surfaceCreateInfo.hinstance = GetModuleHandle(nullptr);
surfaceCreateInfo.hwnd = static_cast<HWND>(windowHandle);
surfaceCreateInfo.hwnd = static_cast<HWND>(window->GetNativePtr());
VALIDATE_VULKAN_RESULT(vkCreateWin32SurfaceKHR(instance, &surfaceCreateInfo, nullptr, surface));
}

View File

@@ -10,8 +10,6 @@
#define VULKAN_USE_PLATFORM_WIN32_KHX 1
#define VULKAN_USE_CREATE_WIN32_SURFACE 1
class GPUDeviceVulkan;
/// <summary>
/// The implementation for the Vulkan API support for Win32 platform.
/// </summary>

View File

@@ -17,6 +17,7 @@ void iOSVulkanPlatform::GetInstanceExtensions(Array<const char*>& extensions, Ar
void iOSVulkanPlatform::CreateSurface(Window* window, GPUDeviceVulkan* device, VkInstance instance, VkSurfaceKHR* surface)
{
void* windowHandle = window->GetNativePtr();
// Create surface on a main UI Thread
Function<void()> func = [&windowHandle, &instance, &surface]()
{

View File

@@ -11,8 +11,6 @@
// General/Validation Error:0 VK_ERROR_INITIALIZATION_FAILED: Could not create MTLCounterSampleBuffer for query pool of type VK_QUERY_TYPE_TIMESTAMP. Reverting to emulated behavior. (Error code 0): Cannot allocate sample buffer
#define VULKAN_USE_TIMER_QUERIES 0
class GPUDeviceVulkan;
/// <summary>
/// The implementation for the Vulkan API support for iOS platform.
/// </summary>

View File

@@ -117,7 +117,7 @@ public:
}
/// <summary>
/// Gets the current state of mouse relative mode.
/// Gets the current state of mouse relative mode.
/// </summary>
/// <param name="window">The window to check against, or null to check for any window.</param>
/// <returns>True if mouse is in relative mode, otherwise false.</returns>

View File

@@ -599,6 +599,11 @@ void WindowBase::Close(ClosingReason reason)
OnClosed();
}
bool WindowBase::IsClosed() const
{
return _isClosing || EnumHasAnyFlags(Flags, ObjectFlags::WasMarkedToDelete);
}
bool WindowBase::IsForegroundWindow() const
{
return _focused;

View File

@@ -242,10 +242,7 @@ public:
/// <summary>
/// Checks if window is closed.
/// </summary>
API_PROPERTY() virtual bool IsClosed() const
{
return _isClosing;
}
API_PROPERTY() virtual bool IsClosed() const;
/// <summary>
/// Checks if window is foreground (the window with which the user is currently working).

View File

@@ -146,6 +146,7 @@ DECLARE_SCRIPTING_TYPE_MINIMAL(CreateWindowSettings);
/// <summary>
/// True if it's a regular window, false for tooltips, context menu and other utility windows.
/// [Deprecated in v1.12]
/// </summary>
API_FIELD() DEPRECATED("Use Type instead") bool IsRegularWindow = true;

View File

@@ -374,11 +374,6 @@ void LinuxWindow::BringToFront(bool force)
X11::XFlush(display);
}
bool LinuxWindow::IsClosed() const
{
return _isClosing;
}
bool LinuxWindow::IsForegroundWindow() const
{
return _focused || _focusOnMapped;

View File

@@ -72,7 +72,6 @@ public:
void Minimize() override;
void Maximize() override;
void Restore() override;
bool IsClosed() const override;
bool IsForegroundWindow() const override;
void BringToFront(bool force = false) override;
void SetClientBounds(const Rectangle& clientArea) override;

View File

@@ -364,11 +364,6 @@ void UWPWindow::Restore()
// Not supported
}
bool UWPWindow::IsClosed() const
{
return _isClosing;
}
void UWPWindow::BringToFront(bool force)
{
Focus();

View File

@@ -160,7 +160,6 @@ public:
void Minimize() override;
void Maximize() override;
void Restore() override;
bool IsClosed() const override;
void BringToFront(bool force = false) override;
void SetClientBounds(const Rectangle& clientArea) override;
void SetPosition(const Float2& position) override;

View File

@@ -34,12 +34,12 @@ namespace FlaxEngine
/// </summary>
/// <param name="mousePosition">The mouse position.</param>
public delegate void MouseMoveDelegate(ref Float2 mousePosition);
/// <summary>
/// Perform mouse move action in relative mode.
/// </summary>
/// <param name="mouseMotion">The relative mouse motion.</param>
public delegate void MouseMoveRelativeDelegate(ref Float2 mouseMotion);
/// <param name="motion">The relative mouse motion.</param>
public delegate void MouseMoveRelativeDelegate(ref Float2 motion);
/// <summary>
/// Perform mouse wheel action.
@@ -285,10 +285,10 @@ namespace FlaxEngine
GUI.OnMouseMove(pos);
}
internal void Internal_OnMouseMoveRelative(ref Float2 mouseMotion)
internal void Internal_OnMouseMoveRelative(ref Float2 motion)
{
MouseMoveRelative?.Invoke(ref mouseMotion);
GUI.OnMouseMoveRelative(mouseMotion);
MouseMoveRelative?.Invoke(ref motion);
GUI.OnMouseMoveRelative(motion);
}
internal void Internal_OnMouseLeave()

View File

@@ -352,7 +352,7 @@ void WindowsWindow::Restore()
bool WindowsWindow::IsClosed() const
{
return !HasHWND();
return !HasHWND() || EnumHasAnyFlags(Flags, ObjectFlags::WasMarkedToDelete);
}
bool WindowsWindow::IsForegroundWindow() const

View File

@@ -773,13 +773,13 @@ namespace FlaxEngine.GUI
Tooltip?.OnMouseLeaveControl(this);
}
}
/// <summary>
/// When mouse moves over control's area while mouse is in relative mode
/// </summary>
/// <param name="mouseMotion">Mouse relative motion</param>
/// <param name="motion">Mouse relative motion</param>
[NoAnimate]
public virtual void OnMouseMoveRelative(Float2 mouseMotion)
public virtual void OnMouseMoveRelative(Float2 motion)
{
}

View File

@@ -213,7 +213,7 @@ namespace FlaxEngine.GUI
var rightBottomLocationSS = locationSS + dpiSize;
// Prioritize tooltip placement within parent window, fall back to virtual desktop
/*if (rightBottomMonitorBounds.Y < rightBottomLocationSS.Y)
if (rightBottomMonitorBounds.Y < rightBottomLocationSS.Y)
{
// Direction: up
locationSS.Y -= dpiSize.Y + flipOffset;
@@ -222,7 +222,7 @@ namespace FlaxEngine.GUI
{
// Direction: left
locationSS.X -= dpiSize.X + flipOffset * 2;
}*/
}
}
/// <inheritdoc />

View File

@@ -340,15 +340,15 @@ namespace FlaxEngine.GUI
}
/// <inheritdoc />
public override void OnMouseMoveRelative(Float2 mouseMotion)
public override void OnMouseMoveRelative(Float2 motion)
{
if (_trackingControl != null)
{
_trackingControl.OnMouseMoveRelative(mouseMotion);
_trackingControl.OnMouseMoveRelative(motion);
return;
}
base.OnMouseMoveRelative(mouseMotion);
base.OnMouseMoveRelative(motion);
}
}
}

View File

@@ -288,6 +288,7 @@ namespace Flax.Build
[CommandLine("useLogInRelease", "Can be used to disable logging in Release game builds")]
public static bool UseLogInRelease = true;
/// <summary>
/// True if SDL support should be enabled.
/// </summary>
[CommandLine("useSdl", "1 to enable SDL support in build")]
@@ -311,10 +312,14 @@ namespace Flax.Build
public static bool WithSDL(NativeCpp.BuildOptions options)
{
bool supportedPlatform = options.Platform.Target == TargetPlatform.Windows ||
options.Platform.Target == TargetPlatform.Linux ||
options.Platform.Target == TargetPlatform.Mac;
return UseSDL && supportedPlatform;
switch (options.Platform.Target)
{
case TargetPlatform.Windows:
case TargetPlatform.Linux:
case TargetPlatform.Mac:
return UseSDL;
default: return false;
}
}
}
}

View File

@@ -175,7 +175,7 @@ namespace Flax.Deps.Dependencies
RunCmake(cmakeFolder, platform, architecture, " -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF " + cmakeArgs, envVars);
// Run build
BuildCmake(cmakeFolder, envVars: envVars);
BuildCmake(cmakeFolder, envVars);
// Deploy binaries
var libs = new[]

View File

@@ -3,15 +3,12 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Linq;
using Flax.Build;
using Flax.Build.Platforms;
namespace Flax.Deps.Dependencies
{
/// <summary>
///
/// Simple DirectMedia Layer (SDL for short) is a cross-platform library designed to make it easy to write multi-media software, such as games and emulators.
/// </summary>
/// <seealso cref="Flax.Deps.Dependency" />
class SDL : Dependency

View File

@@ -53,13 +53,16 @@ namespace Flax.Build.Platforms
options.LinkEnv.InputLibraries.Add("QuartzCore.framework");
options.LinkEnv.InputLibraries.Add("AVFoundation.framework");
// SDL3 requires the following frameworks:
options.LinkEnv.InputLibraries.Add("Foundation.framework");
options.LinkEnv.InputLibraries.Add("GameController.framework");
options.LinkEnv.InputLibraries.Add("Carbon.framework");
options.LinkEnv.InputLibraries.Add("ForceFeedback.framework");
options.LinkEnv.InputLibraries.Add("UniformTypeIdentifiers.framework");
options.LinkEnv.InputLibraries.Add("CoreHaptics.framework");
if (EngineConfiguration.WithSDL(options))
{
// SDL3 requires the following frameworks:
options.LinkEnv.InputLibraries.Add("Foundation.framework");
options.LinkEnv.InputLibraries.Add("GameController.framework");
options.LinkEnv.InputLibraries.Add("Carbon.framework");
options.LinkEnv.InputLibraries.Add("ForceFeedback.framework");
options.LinkEnv.InputLibraries.Add("UniformTypeIdentifiers.framework");
options.LinkEnv.InputLibraries.Add("CoreHaptics.framework");
}
}
protected override void AddArgsCommon(BuildOptions options, List<string> args)

View File

@@ -411,7 +411,7 @@ namespace Flax.Build.Platforms
// Use shared arguments
args.Clear();
args.AddRange(commonArgs);
// Language for the file
args.Add("-x");
if (Path.GetExtension(sourceFile).Equals(".c", StringComparison.OrdinalIgnoreCase))
@@ -419,7 +419,7 @@ namespace Flax.Build.Platforms
else
{
args.Add("c++");
// C++ version
switch (compileEnvironment.CppVersion)
{