Blender V5.3
GHOST_ContextSDL.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2014 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include "GHOST_Context.hh"
12
13#include <SDL3/SDL.h>
14
15#ifndef GHOST_OPENGL_SDL_CONTEXT_FLAGS
16# ifdef WITH_GPU_DEBUG
17# define GHOST_OPENGL_SDL_CONTEXT_FLAGS SDL_GL_CONTEXT_DEBUG_FLAG
18# else
19# define GHOST_OPENGL_SDL_CONTEXT_FLAGS 0
20# endif
21#endif
22
23#ifndef GHOST_OPENGL_SDL_RESET_NOTIFICATION_STRATEGY
24# define GHOST_OPENGL_SDL_RESET_NOTIFICATION_STRATEGY 0
25#endif
26
28 public:
32 GHOST_ContextSDL(const GHOST_ContextParams &context_params,
33 SDL_Window *window,
34 int contextProfileMask,
35 int contextMajorVersion,
36 int contextMinorVersion,
37 int contextFlags,
38 int contextResetNotificationStrategy);
39
43 ~GHOST_ContextSDL() override;
44
47 {
48 return GHOST_kSuccess;
49 }
50
56
62
68
74
81
87 GHOST_TSuccess setSwapInterval(int interval) override;
88
94 GHOST_TSuccess getSwapInterval(int &interval_out) override;
95
96 private:
97 SDL_Window *window_;
98 SDL_Window *hidden_window_;
99
100 const int context_profile_mask_;
101 const int context_major_version_;
102 const int context_minor_version_;
103 const int context_flags_;
104 const int context_reset_notification_strategy_;
105
106 SDL_GLContext context_; /* sdl_glcontext_ */
107
109 static SDL_GLContext s_sharedContext;
110 static int s_sharedCount;
111};
GHOST_TSuccess
@ GHOST_kSuccess
GHOST_TSuccess swapBufferRelease() override
GHOST_TSuccess releaseDrawingContext() override
GHOST_ContextSDL(const GHOST_ContextParams &context_params, SDL_Window *window, int contextProfileMask, int contextMajorVersion, int contextMinorVersion, int contextFlags, int contextResetNotificationStrategy)
GHOST_TSuccess initializeDrawingContext() override
GHOST_TSuccess activateDrawingContext() override
GHOST_TSuccess releaseNativeHandles() override
GHOST_TSuccess setSwapInterval(int interval) override
GHOST_TSuccess getSwapInterval(int &interval_out) override
GHOST_TSuccess swapBufferAcquire() override
GHOST_Context(const GHOST_ContextParams &context_params)