Blender V4.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
10#pragma once
11
12#include "../GHOST_Types.h"
14#include "GHOST_Event.hh"
15#include "GHOST_System.hh"
16#include "GHOST_TimerManager.hh"
17#include "GHOST_WindowSDL.hh"
18
19extern "C" {
20#include "SDL.h"
21}
22
23#if !SDL_VERSION_ATLEAST(2, 0, 0)
24# error "SDL 2.0 or newer is needed to build with Ghost"
25#endif
26
27class GHOST_WindowSDL;
28
30 public:
31 void addDirtyWindow(GHOST_WindowSDL *bad_wind);
32
35
36 bool processEvents(bool waitForEvent) override;
37
39 {
40 return false;
41 }
42
44
45 GHOST_TSuccess getButtons(GHOST_Buttons &buttons) const override;
46
48
49 char *getClipboard(bool selection) const override;
50
51 void putClipboard(const char *buffer, bool selection) const override;
52
53 uint64_t getMilliSeconds() const override;
54
55 uint8_t getNumDisplays() const override;
56
57 GHOST_TSuccess getCursorPosition(int32_t &x, int32_t &y) const override;
58
60
61 void getAllDisplayDimensions(uint32_t &width, uint32_t &height) const override;
62
63 void getMainDisplayDimensions(uint32_t &width, uint32_t &height) const override;
64
66
68
69 private:
70 GHOST_TSuccess init() override;
71
72 GHOST_IWindow *createWindow(const char *title,
73 int32_t left,
74 int32_t top,
75 uint32_t width,
76 uint32_t height,
78 GHOST_GPUSettings gpuSettings,
79 const bool exclusive = false,
80 const bool is_dialog = false,
81 const GHOST_IWindow *parentWindow = nullptr) override;
82
83 /* SDL specific */
84 GHOST_WindowSDL *findGhostWindow(SDL_Window *sdl_win);
85
86 bool generateWindowExposeEvents();
87
88 void processEvent(SDL_Event *sdl_event);
89
91 std::vector<GHOST_WindowSDL *> m_dirty_windows;
92};
GHOST_TWindowState
GHOST_TCapabilityFlag
Definition GHOST_Types.h:96
GHOST_TSuccess
Definition GHOST_Types.h:87
GHOST_TConsoleWindowState
GHOST_IContext * createOffscreenContext(GHOST_GPUSettings gpuSettings) override
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_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
static ulong state[N]
unsigned int uint32_t
Definition stdint.h:80
signed int int32_t
Definition stdint.h:77
unsigned char uint8_t
Definition stdint.h:78
unsigned __int64 uint64_t
Definition stdint.h:90