// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
#pragma once
#if PLATFORM_GDK
#include "Engine/Platform/Base/WindowBase.h"
#include "Engine/Platform/Platform.h"
#include "Engine/Platform/Win32/WindowsMinimal.h"
///
/// Implementation of the window class for GDK platform.
///
class FLAXENGINE_API GDKWindow : public WindowBase
{
friend GDKPlatform;
private:
Windows::HWND _handle;
public:
///
/// Initializes a new instance of the class.
///
/// The initial window settings.
GDKWindow(const CreateWindowSettings& settings);
///
/// Finalizes an instance of the class.
///
~GDKWindow();
public:
///
/// Gets the window handle.
///
FORCE_INLINE Windows::HWND GetHWND() const
{
return _handle;
}
///
/// Checks if the window has valid handle created.
///
FORCE_INLINE bool HasHWND() const
{
return _handle != nullptr;
}
///
/// Gets the information about screen which contains window.
///
/// The x position.
/// The y position.
/// The width.
/// The height.
void GetScreenInfo(int32& x, int32& y, int32& width, int32& height) const;
public:
///
/// The Windows messages procedure.
///
/// The mMessage.
/// The first parameter.
/// The second parameter.
/// The result.
Windows::LRESULT WndProc(Windows::UINT msg, Windows::WPARAM wParam, Windows::LPARAM lParam);
private:
void CheckForWindowResize();
void UpdateCursor() const;
public:
// [WindowBase]
void* GetNativePtr() const override;
void Show() override;
void Hide() override;
void Minimize() override;
void Maximize() override;
void Restore() override;
bool IsClosed() const override;
bool IsForegroundWindow() const override;
void SetIsFullscreen(bool isFullscreen) override;
void SetCursor(CursorType type) override;
};
#endif