Blender V4.3
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
9#pragma once
10
11// #define WIN32_COMPOSITING
12
13#include "GHOST_Context.hh"
14
15#include <epoxy/wgl.h>
16
17#ifndef GHOST_OPENGL_WGL_RESET_NOTIFICATION_STRATEGY
18# define GHOST_OPENGL_WGL_RESET_NOTIFICATION_STRATEGY 0
19#endif
20
22 /* XR code needs low level graphics data to send to OpenXR. */
24
25 public:
29 GHOST_ContextWGL(bool stereoVisual,
30 bool alphaBackground,
31 HWND hWnd,
32 HDC hDC,
33 int contextProfileMask,
34 int contextMajorVersion,
35 int contextMinorVersion,
36 int contextFlags,
37 int contextResetNotificationStrategy);
38
43
49
55
61
67
74
80 GHOST_TSuccess setSwapInterval(int interval);
81
87 GHOST_TSuccess getSwapInterval(int &intervalOut);
88
89 private:
90 int choose_pixel_format_arb(bool stereoVisual, bool needAlpha);
91 int _choose_pixel_format_arb_1(bool stereoVisual, bool needAlpha);
92
93 HWND m_hWnd;
94 HDC m_hDC;
95
96 const int m_contextProfileMask;
97 const int m_contextMajorVersion;
98 const int m_contextMinorVersion;
99 const int m_contextFlags;
100 const bool m_alphaBackground;
101 const int m_contextResetNotificationStrategy;
102
103 HGLRC m_hGLRC;
104
105#ifndef NDEBUG
106 const char *m_dummyVendor;
107 const char *m_dummyRenderer;
108 const char *m_dummyVersion;
109#endif
110
111 static HGLRC s_sharedHGLRC;
112 static int s_sharedCount;
113};
GHOST_TSuccess
Definition GHOST_Types.h:87
GHOST_ContextWGL(bool stereoVisual, bool alphaBackground, HWND hWnd, HDC hDC, int contextProfileMask, int contextMajorVersion, int contextMinorVersion, int contextFlags, int contextResetNotificationStrategy)
GHOST_TSuccess activateDrawingContext()
GHOST_TSuccess getSwapInterval(int &intervalOut)
GHOST_TSuccess swapBuffers()
GHOST_TSuccess releaseNativeHandles()
GHOST_TSuccess initializeDrawingContext()
GHOST_TSuccess releaseDrawingContext()
GHOST_TSuccess setSwapInterval(int interval)