Blender V5.3
GHOST_SystemSDL.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2011-2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9
10#pragma once
11
12#include "../GHOST_Types.hh"
13#include "GHOST_Event.hh"
14#include "GHOST_System.hh"
15#include "GHOST_TimerManager.hh"
16#include "GHOST_WindowSDL.hh"
17
18#include <SDL3/SDL.h>
19
20class GHOST_WindowSDL;
21
23 public:
24 void addDirtyWindow(GHOST_WindowSDL *bad_wind);
25
28
29 bool processEvents(bool waitForEvent) override;
30
32 {
33 return false;
34 }
35
37
38 GHOST_TSuccess getButtons(GHOST_Buttons &buttons) const override;
39
41
42 char *getClipboard(bool selection) const override;
43
44 void putClipboard(const char *buffer, bool selection) const override;
45
46 uint64_t getMilliSeconds() const override;
47
48 uint8_t getNumDisplays() const override;
49
51
53
54 void getAllDisplayDimensions(uint32_t &width, uint32_t &height) const override;
55
56 void getMainDisplayDimensions(uint32_t &width, uint32_t &height) const override;
57
59
61
62 private:
63 GHOST_TSuccess init() override;
64
65 GHOST_IWindow *createWindow(const char *title,
66 int32_t left,
67 int32_t top,
68 uint32_t width,
69 uint32_t height,
71 GHOST_GPUSettings gpu_settings,
72 const bool exclusive = false,
73 const bool is_dialog = false,
74 const GHOST_IWindow *parent_window = nullptr) override;
75
76 /* SDL specific */
77 GHOST_WindowSDL *findGhostWindow(SDL_Window *sdl_win);
78
79 bool generateWindowExposeEvents();
80
81 void processEvent(SDL_Event *sdl_event);
82
84 std::vector<GHOST_WindowSDL *> dirty_windows_;
85};
GHOST_TWindowState
GHOST_TCapabilityFlag
GHOST_TSuccess
GHOST_TConsoleWindowState
void init()
unsigned long long int uint64_t
GHOST_TSuccess getCursorPosition(int32_t &x, int32_t &y) const override
GHOST_TSuccess setCursorPosition(int32_t x, int32_t y) override
bool setConsoleWindowState(GHOST_TConsoleWindowState) override
char * getClipboard(bool selection) const override
void getMainDisplayDimensions(uint32_t &width, uint32_t &height) const override
GHOST_IContext * createOffscreenContext(GHOST_GPUSettings gpu_settings) override
GHOST_TCapabilityFlag getCapabilities() const override
void addDirtyWindow(GHOST_WindowSDL *bad_wind)
void getAllDisplayDimensions(uint32_t &width, uint32_t &height) const override
uint8_t getNumDisplays() const override
GHOST_TSuccess disposeContext(GHOST_IContext *context) override
void putClipboard(const char *buffer, bool selection) const override
GHOST_TSuccess getButtons(GHOST_Buttons &buttons) const override
GHOST_TSuccess getModifierKeys(GHOST_ModifierKeys &keys) const override
uint64_t getMilliSeconds() const override
bool processEvents(bool waitForEvent) override
const int state