Blender V5.0
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.h"
13#include "GHOST_Event.hh"
14#include "GHOST_System.hh"
15#include "GHOST_TimerManager.hh"
16#include "GHOST_WindowSDL.hh"
17
18extern "C" {
19#include "SDL.h"
20}
21
22#if !SDL_VERSION_ATLEAST(2, 0, 0)
23# error "SDL 2.0 or newer is needed to build with Ghost"
24#endif
25
26class GHOST_WindowSDL;
27
29 public:
30 void addDirtyWindow(GHOST_WindowSDL *bad_wind);
31
34
35 bool processEvents(bool waitForEvent) override;
36
38 {
39 return false;
40 }
41
43
44 GHOST_TSuccess getButtons(GHOST_Buttons &buttons) const override;
45
47
48 char *getClipboard(bool selection) const override;
49
50 void putClipboard(const char *buffer, bool selection) const override;
51
52 uint64_t getMilliSeconds() const override;
53
54 uint8_t getNumDisplays() const override;
55
57
59
60 void getAllDisplayDimensions(uint32_t &width, uint32_t &height) const override;
61
62 void getMainDisplayDimensions(uint32_t &width, uint32_t &height) const override;
63
65
67
68 private:
69 GHOST_TSuccess init() override;
70
71 GHOST_IWindow *createWindow(const char *title,
74 uint32_t width,
75 uint32_t height,
77 GHOST_GPUSettings gpu_settings,
78 const bool exclusive = false,
79 const bool is_dialog = false,
80 const GHOST_IWindow *parent_window = nullptr) override;
81
82 /* SDL specific */
83 GHOST_WindowSDL *findGhostWindow(SDL_Window *sdl_win);
84
85 bool generateWindowExposeEvents();
86
87 void processEvent(SDL_Event *sdl_event);
88
90 std::vector<GHOST_WindowSDL *> dirty_windows_;
91};
bool processEvent(GHOST_EventHandle hEvent, GHOST_TUserDataPtr user_data)
GHOST_TWindowState
GHOST_TCapabilityFlag
GHOST_TSuccess
Definition GHOST_Types.h:57
GHOST_TConsoleWindowState
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
GHOST_TSuccess init() override
uint top
static ulong state[N]
static int left