Blender V4.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
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(bool stereoVisual,
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
51 GHOST_TSuccess swapBuffers() override;
52
58
64
70
77
83 GHOST_TSuccess setSwapInterval(int interval) override;
84
90 GHOST_TSuccess getSwapInterval(int &intervalOut) override;
91
92 private:
93 SDL_Window *m_window;
94 SDL_Window *m_hidden_window;
95
96 const int m_contextProfileMask;
97 const int m_contextMajorVersion;
98 const int m_contextMinorVersion;
99 const int m_contextFlags;
100 const int m_contextResetNotificationStrategy;
101
102 SDL_GLContext m_context; /* m_sdl_glcontext */
103
105 static SDL_GLContext s_sharedContext;
106 static int s_sharedCount;
107};
GHOST_TSuccess
Definition GHOST_Types.h:87
GHOST_TSuccess swapBuffers() override
~GHOST_ContextSDL() override
GHOST_TSuccess releaseDrawingContext() override
GHOST_TSuccess getSwapInterval(int &intervalOut) override
GHOST_TSuccess initializeDrawingContext() override
GHOST_TSuccess activateDrawingContext() override
GHOST_TSuccess releaseNativeHandles() override
GHOST_ContextSDL(bool stereoVisual, SDL_Window *window, int contextProfileMask, int contextMajorVersion, int contextMinorVersion, int contextFlags, int contextResetNotificationStrategy)
GHOST_TSuccess setSwapInterval(int interval) override