Blender V4.5
GHOST_ContextWGL.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2013 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/wgl.h>
14
15#ifndef GHOST_OPENGL_WGL_RESET_NOTIFICATION_STRATEGY
16# define GHOST_OPENGL_WGL_RESET_NOTIFICATION_STRATEGY 0
17#endif
18
20 /* XR code needs low level graphics data to send to OpenXR. */
22
23 public:
27 GHOST_ContextWGL(bool stereoVisual,
28 bool alphaBackground,
29 HWND hWnd,
30 HDC hDC,
31 int contextProfileMask,
32 int contextMajorVersion,
33 int contextMinorVersion,
34 int contextFlags,
35 int contextResetNotificationStrategy);
36
40 ~GHOST_ContextWGL() override;
41
46 GHOST_TSuccess swapBuffers() override;
47
53
59
65
72
78 GHOST_TSuccess setSwapInterval(int interval) override;
79
85 GHOST_TSuccess getSwapInterval(int &intervalOut) override;
86
87 private:
88 int choose_pixel_format_arb(bool stereoVisual, bool needAlpha);
89 int _choose_pixel_format_arb_1(bool stereoVisual, bool needAlpha);
90
91 HWND m_hWnd;
92 HDC m_hDC;
93
94 const int m_contextProfileMask;
95 const int m_contextMajorVersion;
96 const int m_contextMinorVersion;
97 const int m_contextFlags;
98 const bool m_alphaBackground;
99 const int m_contextResetNotificationStrategy;
100
101 HGLRC m_hGLRC;
102
103#ifndef NDEBUG
104 const char *m_dummyVendor;
105 const char *m_dummyRenderer;
106 const char *m_dummyVersion;
107#endif
108
109 static HGLRC s_sharedHGLRC;
110 static int s_sharedCount;
111};
GHOST_TSuccess
Definition GHOST_Types.h:80
friend class GHOST_XrGraphicsBindingOpenGL
GHOST_ContextWGL(bool stereoVisual, bool alphaBackground, HWND hWnd, HDC hDC, int contextProfileMask, int contextMajorVersion, int contextMinorVersion, int contextFlags, int contextResetNotificationStrategy)
GHOST_TSuccess getSwapInterval(int &intervalOut) override
GHOST_TSuccess releaseNativeHandles() override
GHOST_TSuccess releaseDrawingContext() override
GHOST_TSuccess initializeDrawingContext() override
GHOST_TSuccess setSwapInterval(int interval) override
~GHOST_ContextWGL() override
GHOST_TSuccess activateDrawingContext() override
GHOST_TSuccess swapBuffers() override
GHOST_Context(bool stereoVisual)