Blender  V3.3
GHOST_ContextGLX.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 #include <GL/glxew.h>
13 
14 #ifndef GHOST_OPENGL_GLX_CONTEXT_FLAGS
15 /* leave as convenience define for the future */
16 # define GHOST_OPENGL_GLX_CONTEXT_FLAGS 0
17 #endif
18 
19 #ifndef GHOST_OPENGL_GLX_RESET_NOTIFICATION_STRATEGY
20 # define GHOST_OPENGL_GLX_RESET_NOTIFICATION_STRATEGY 0
21 #endif
22 
24  /* XR code needs low level graphics data to send to OpenXR. */
26 
27  public:
31  GHOST_ContextGLX(bool stereoVisual,
32  Window window,
33  Display *display,
34  GLXFBConfig fbconfig,
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  void initContextGLXEW();
93 
94  Display *m_display;
95  GLXFBConfig m_fbconfig;
96  Window m_window;
97 
98  const int m_contextProfileMask;
99  const int m_contextMajorVersion;
100  const int m_contextMinorVersion;
101  const int m_contextFlags;
102  const int m_contextResetNotificationStrategy;
103 
104  GLXContext m_context;
105 
107  static GLXContext s_sharedContext;
108  static int s_sharedCount;
109 };
110 
111 /* used to get GLX info */
113  int *attribs, int attribs_max, bool is_stereo_visual, bool need_alpha, bool for_fb_config);
int GHOST_X11_GL_GetAttributes(int *attribs, int attribs_max, bool is_stereo_visual, bool need_alpha, bool for_fb_config)
GHOST_TSuccess
Definition: GHOST_Types.h:74
GHOST_TSuccess releaseDrawingContext()
GHOST_TSuccess getSwapInterval(int &intervalOut)
GHOST_TSuccess initializeDrawingContext()
GHOST_TSuccess activateDrawingContext()
GHOST_TSuccess setSwapInterval(int interval)
GHOST_TSuccess releaseNativeHandles()
GHOST_TSuccess swapBuffers()
GHOST_ContextGLX(bool stereoVisual, Window window, Display *display, GLXFBConfig fbconfig, int contextProfileMask, int contextMajorVersion, int contextMinorVersion, int contextFlags, int contextResetNotificationStrategy)