Blender V5.0
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(const GHOST_ContextParams &context_params,
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
44 {
45 return GHOST_kSuccess;
46 }
47
53
59
65
71
78
84 GHOST_TSuccess setSwapInterval(int interval) override;
85
91 GHOST_TSuccess getSwapInterval(int &interval_out) override;
92
93 private:
94 int choose_pixel_format_arb(bool stereoVisual, bool needAlpha);
95 int _choose_pixel_format_arb_1(bool stereoVisual, bool needAlpha);
96
97 HWND h_wnd_;
98 HDC h_DC_;
99
100 const int context_profile_mask_;
101 const int context_major_version_;
102 const int context_minor_version_;
103 const int context_flags_;
104 const bool alpha_background_;
105 const int context_reset_notification_strategy_;
106
107 HGLRC h_GLRC_;
108
109#ifndef NDEBUG
110 const char *dummy_vendor_;
111 const char *dummy_renderer_;
112 const char *dummy_version_;
113#endif
114
115 static HGLRC s_sharedHGLRC;
116 static int s_sharedCount;
117};
GHOST_TSuccess
Definition GHOST_Types.h:57
@ GHOST_kSuccess
Definition GHOST_Types.h:57
friend class GHOST_XrGraphicsBindingOpenGL
GHOST_ContextWGL(const GHOST_ContextParams &context_params, bool alphaBackground, HWND hWnd, HDC hDC, int contextProfileMask, int contextMajorVersion, int contextMinorVersion, int contextFlags, int contextResetNotificationStrategy)
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 getSwapInterval(int &interval_out) override
GHOST_TSuccess swapBufferAcquire() override
GHOST_TSuccess swapBufferRelease() override
GHOST_Context(const GHOST_ContextParams &context_params)