Blender V5.0
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
8
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(const GHOST_ContextParams &context_params,
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
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 Display *display_;
100 GLXFBConfig fbconfig_;
101 Window window_;
102
103 const int context_profile_mask_;
104 const int context_major_version_;
105 const int context_minor_version_;
106 const int context_flags_;
107 const int context_reset_notification_strategy_;
108
109 GLXContext context_;
110
112 static GLXContext s_sharedContext;
113 static int s_sharedCount;
114};
115
116/* used to get GLX info */
118 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)
#define Window
#define Display
GHOST_TSuccess
Definition GHOST_Types.h:57
@ GHOST_kSuccess
Definition GHOST_Types.h:57
GHOST_TSuccess releaseNativeHandles() override
GHOST_ContextGLX(const GHOST_ContextParams &context_params, Window window, Display *display, GLXFBConfig fbconfig, int contextProfileMask, int contextMajorVersion, int contextMinorVersion, int contextFlags, int contextResetNotificationStrategy)
GHOST_TSuccess swapBufferAcquire() override
GHOST_TSuccess releaseDrawingContext() override
friend class GHOST_XrGraphicsBindingOpenGL
GHOST_TSuccess activateDrawingContext() override
GHOST_TSuccess getSwapInterval(int &interval_out) override
GHOST_TSuccess swapBufferRelease() override
GHOST_TSuccess setSwapInterval(int interval) override
~GHOST_ContextGLX() override
GHOST_TSuccess initializeDrawingContext() override
GHOST_Context(const GHOST_ContextParams &context_params)