FreeRDP
Loading...
Searching...
No Matches
SDL3/sdl_window.hpp
1
20#pragma once
21
22#include <string>
23#include <SDL3/SDL.h>
24
25#include <freerdp/settings_types.h>
26
27class SdlWindow
28{
29 public:
30 SdlWindow(const std::string& title, Sint32 startupX, Sint32 startupY, Sint32 width,
31 Sint32 height, Uint32 flags);
32 SdlWindow(SdlWindow&& other) noexcept;
33 SdlWindow(const SdlWindow& other) = delete;
34 ~SdlWindow();
35
36 SdlWindow& operator=(const SdlWindow& other) = delete;
37 SdlWindow& operator=(SdlWindow&& other) = delete;
38
39 [[nodiscard]] Uint32 id() const;
40 [[nodiscard]] SDL_DisplayID displayIndex() const;
41 [[nodiscard]] SDL_Rect rect() const;
42 [[nodiscard]] SDL_Window* window() const;
43
44 [[nodiscard]] Sint32 offsetX() const;
45 void setOffsetX(Sint32 x);
46
47 void setOffsetY(Sint32 y);
48 [[nodiscard]] Sint32 offsetY() const;
49
50 [[nodiscard]] rdpMonitor monitor() const;
51
52 bool grabKeyboard(bool enable);
53 bool grabMouse(bool enable);
54 void setBordered(bool bordered);
55 void raise();
56 void resizeable(bool use);
57 void fullscreen(bool enter);
58 void minimize();
59
60 bool fill(Uint8 r = 0x00, Uint8 g = 0x00, Uint8 b = 0x00, Uint8 a = 0xff);
61 bool blit(SDL_Surface* surface, const SDL_Rect& src, SDL_Rect& dst);
62 void updateSurface();
63
64 private:
65 static UINT32 orientaion_to_rdp(SDL_DisplayOrientation orientation);
66
67 private:
68 SDL_Window* _window = nullptr;
69 Sint32 _offset_x = 0;
70 Sint32 _offset_y = 0;
71};