Blender V5.3
GHOST_WindowSDL.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_SystemSDL.hh"
13#include "GHOST_Window.hh"
14
15#include <map>
16
17#include <SDL3/SDL.h>
18
19class GHOST_SystemSDL;
20
22 private:
23 GHOST_SystemSDL *system_;
24 bool valid_setup_;
25 bool invalid_window_;
26
27 SDL_Window *sdl_win_;
28 SDL_Cursor *sdl_custom_cursor_;
29 GHOST_GPUDevice preferred_device_;
30
31 public:
33 const char *title,
34 int32_t left,
35 int32_t top,
36 uint32_t width,
37 uint32_t height,
40 const GHOST_ContextParams &context_params,
41 const GHOST_GPUDevice &preferred_device,
42 const bool exclusive = false,
43 const GHOST_IWindow *parent_window = nullptr);
44
46
47 /* SDL specific */
48 SDL_Window *getSDLWindow()
49 {
50 return sdl_win_;
51 }
52
53 GHOST_TSuccess invalidate() override;
54
59
60 void validate()
61 {
62 invalid_window_ = false;
63 }
64
65 bool getValid() const override;
66
67 void getWindowBounds(GHOST_Rect &bounds) const override;
68 void getClientBounds(GHOST_Rect &bounds) const override;
69
70 protected:
76
78
81
82 GHOST_TSuccess setWindowCustomCursorShape(const uint8_t *bitmap,
83 const uint8_t *mask,
84 const int size[2],
85 const int hot_spot[2],
86 bool can_invert_color) override;
87
88 GHOST_TSuccess setWindowCursorVisibility(bool visible) override;
89
90 void setTitle(const char *title) override;
91
92 std::string getTitle() const override;
93
94 GHOST_TSuccess setClientWidth(uint32_t width) override;
95
96 GHOST_TSuccess setClientHeight(uint32_t height) override;
97
98 GHOST_TSuccess setClientSize(uint32_t width, uint32_t height) override;
99
100 void screenToClient(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const override;
101
102 void clientToScreen(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const override;
103
105
106 GHOST_TWindowState getState() const override;
107
109 {
110 // TODO
111 return GHOST_kSuccess;
112 }
113
114 uint16_t getDPIHint() override;
115};
GHOST_TWindowState
GHOST_TStandardCursor
GHOST_TDrawingContextType
GHOST_TWindowOrder
GHOST_TSuccess
@ GHOST_kSuccess
GHOST_TGrabCursorMode
SIMD_FORCE_INLINE void invalidate()
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition btDbvt.cpp:52
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
Definition btDbvt.cpp:299
GHOST_WindowSDL(GHOST_SystemSDL *system, const char *title, int32_t left, int32_t top, uint32_t width, uint32_t height, GHOST_TWindowState state, GHOST_TDrawingContextType type, const GHOST_ContextParams &context_params, const GHOST_GPUDevice &preferred_device, const bool exclusive=false, const GHOST_IWindow *parent_window=nullptr)
GHOST_TSuccess setWindowCursorGrab(GHOST_TGrabCursorMode mode) override
std::string getTitle() const override
GHOST_TWindowState getState() const override
void clientToScreen(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const override
GHOST_TSuccess setWindowCursorShape(GHOST_TStandardCursor shape) override
GHOST_TSuccess setOrder(GHOST_TWindowOrder) override
GHOST_TSuccess setClientHeight(uint32_t height) override
SDL_Window * getSDLWindow()
GHOST_Context * newDrawingContext(GHOST_TDrawingContextType type) override
void getClientBounds(GHOST_Rect &bounds) const override
GHOST_TSuccess setWindowCursorVisibility(bool visible) override
GHOST_TSuccess setClientWidth(uint32_t width) override
GHOST_TSuccess setWindowCustomCursorShape(const uint8_t *bitmap, const uint8_t *mask, const int size[2], const int hot_spot[2], bool can_invert_color) override
GHOST_TSuccess setState(GHOST_TWindowState state) override
GHOST_TSuccess setClientSize(uint32_t width, uint32_t height) override
void getWindowBounds(GHOST_Rect &bounds) const override
uint16_t getDPIHint() override
bool getValid() const override
void setTitle(const char *title) override
GHOST_TSuccess hasCursorShape(GHOST_TStandardCursor shape) override
void screenToClient(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const override
GHOST_Window(uint32_t width, uint32_t height, GHOST_TWindowState state, const GHOST_ContextParams &context_params, const bool exclusive=false)
const int state
ccl_device_inline float2 mask(const MaskType mask, const float2 a)