Blender V5.0
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
13extern "C" {
14#include "SDL.h"
15}
16
17#ifndef GHOST_OPENGL_SDL_CONTEXT_FLAGS
18# ifdef WITH_GPU_DEBUG
19# define GHOST_OPENGL_SDL_CONTEXT_FLAGS SDL_GL_CONTEXT_DEBUG_FLAG
20# else
21# define GHOST_OPENGL_SDL_CONTEXT_FLAGS 0
22# endif
23#endif
24
25#ifndef GHOST_OPENGL_SDL_RESET_NOTIFICATION_STRATEGY
26# define GHOST_OPENGL_SDL_RESET_NOTIFICATION_STRATEGY 0
27#endif
28
30 public:
34 GHOST_ContextSDL(const GHOST_ContextParams &context_params,
35 SDL_Window *window,
36 int contextProfileMask,
37 int contextMajorVersion,
38 int contextMinorVersion,
39 int contextFlags,
40 int contextResetNotificationStrategy);
41
45 ~GHOST_ContextSDL() override;
46
49 {
50 return GHOST_kSuccess;
51 }
52
58
64
70
76
83
89 GHOST_TSuccess setSwapInterval(int interval) override;
90
96 GHOST_TSuccess getSwapInterval(int &interval_out) override;
97
98 private:
99 SDL_Window *window_;
100 SDL_Window *hidden_window_;
101
102 const int context_profile_mask_;
103 const int context_major_version_;
104 const int context_minor_version_;
105 const int context_flags_;
106 const int context_reset_notification_strategy_;
107
108 SDL_GLContext context_; /* sdl_glcontext_ */
109
111 static SDL_GLContext s_sharedContext;
112 static int s_sharedCount;
113};
GHOST_TSuccess
Definition GHOST_Types.h:57
@ GHOST_kSuccess
Definition GHOST_Types.h:57
~GHOST_ContextSDL() override
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)