Blender V4.3
GHOST_ContextGLX.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
13#include <epoxy/glx.h>
14
15#ifndef GHOST_OPENGL_GLX_CONTEXT_FLAGS
16/* leave as convenience define for the future */
17# define GHOST_OPENGL_GLX_CONTEXT_FLAGS 0
18#endif
19
20#ifndef GHOST_OPENGL_GLX_RESET_NOTIFICATION_STRATEGY
21# define GHOST_OPENGL_GLX_RESET_NOTIFICATION_STRATEGY 0
22#endif
23
25 /* XR code needs low level graphics data to send to OpenXR. */
27
28 public:
32 GHOST_ContextGLX(bool stereoVisual,
33 Window window,
34 Display *display,
35 GLXFBConfig fbconfig,
36 int contextProfileMask,
37 int contextMajorVersion,
38 int contextMinorVersion,
39 int contextFlags,
40 int contextResetNotificationStrategy);
41
45 ~GHOST_ContextGLX() 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 Display *m_display;
94 GLXFBConfig m_fbconfig;
95 Window m_window;
96
97 const int m_contextProfileMask;
98 const int m_contextMajorVersion;
99 const int m_contextMinorVersion;
100 const int m_contextFlags;
101 const int m_contextResetNotificationStrategy;
102
103 GLXContext m_context;
104
106 static GLXContext s_sharedContext;
107 static int s_sharedCount;
108};
109
110/* used to get GLX info */
112 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:87
GHOST_TSuccess releaseNativeHandles() override
GHOST_TSuccess releaseDrawingContext() override
GHOST_TSuccess getSwapInterval(int &intervalOut) override
GHOST_TSuccess activateDrawingContext() override
GHOST_TSuccess setSwapInterval(int interval) override
GHOST_TSuccess swapBuffers() override
~GHOST_ContextGLX() override
GHOST_ContextGLX(bool stereoVisual, Window window, Display *display, GLXFBConfig fbconfig, int contextProfileMask, int contextMajorVersion, int contextMinorVersion, int contextFlags, int contextResetNotificationStrategy)
GHOST_TSuccess initializeDrawingContext() override