Blender  V3.3
GHOST_ContextSDL.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2014 Blender Foundation. All rights reserved. */
3 
8 #pragma once
9 
10 #include "GHOST_Context.h"
11 
12 extern "C" {
13 #include "SDL.h"
14 }
15 
16 #ifndef GHOST_OPENGL_SDL_CONTEXT_FLAGS
17 # ifdef WITH_GPU_DEBUG
18 # define GHOST_OPENGL_SDL_CONTEXT_FLAGS SDL_GL_CONTEXT_DEBUG_FLAG
19 # else
20 # define GHOST_OPENGL_SDL_CONTEXT_FLAGS 0
21 # endif
22 #endif
23 
24 #ifndef GHOST_OPENGL_SDL_RESET_NOTIFICATION_STRATEGY
25 # define GHOST_OPENGL_SDL_RESET_NOTIFICATION_STRATEGY 0
26 #endif
27 
29  public:
33  GHOST_ContextSDL(bool stereoVisual,
34  SDL_Window *window,
35  int contextProfileMask,
36  int contextMajorVersion,
37  int contextMinorVersion,
38  int contextFlags,
39  int contextResetNotificationStrategy);
40 
45 
51 
57 
63 
69 
76 
82  GHOST_TSuccess setSwapInterval(int interval);
83 
89  GHOST_TSuccess getSwapInterval(int &intervalOut);
90 
91  private:
92  SDL_Window *m_window;
93  SDL_Window *m_hidden_window;
94 
95  const int m_contextProfileMask;
96  const int m_contextMajorVersion;
97  const int m_contextMinorVersion;
98  const int m_contextFlags;
99  const int m_contextResetNotificationStrategy;
100 
101  SDL_GLContext m_context; /* m_sdl_glcontext */
102 
104  static SDL_GLContext s_sharedContext;
105  static int s_sharedCount;
106 };
GHOST_TSuccess
Definition: GHOST_Types.h:74
GHOST_TSuccess swapBuffers()
GHOST_TSuccess initializeDrawingContext()
GHOST_TSuccess releaseNativeHandles()
GHOST_TSuccess getSwapInterval(int &intervalOut)
GHOST_ContextSDL(bool stereoVisual, SDL_Window *window, int contextProfileMask, int contextMajorVersion, int contextMinorVersion, int contextFlags, int contextResetNotificationStrategy)
GHOST_TSuccess activateDrawingContext()
GHOST_TSuccess releaseDrawingContext()
GHOST_TSuccess setSwapInterval(int interval)