Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/angle
Path: blob/main_old/util/windows/WGLWindow.h
1693 views
1
//
2
// Copyright 2018 The ANGLE Project Authors. All rights reserved.
3
// Use of this source code is governed by a BSD-style license that can be
4
// found in the LICENSE file.
5
//
6
// WGLWindow:
7
// Implements initializing a WGL rendering context.
8
//
9
10
#ifndef UTIL_WINDOWS_WGLWINDOW_H_
11
#define UTIL_WINDOWS_WGLWINDOW_H_
12
13
#include "common/angleutils.h"
14
#include "export.h"
15
#include "util/EGLWindow.h"
16
17
class OSWindow;
18
19
namespace angle
20
{
21
class Library;
22
} // namespace angle
23
24
class ANGLE_UTIL_EXPORT WGLWindow : public GLWindowBase
25
{
26
public:
27
static WGLWindow *New(int glesMajorVersion, int glesMinorVersion);
28
static void Delete(WGLWindow **window);
29
30
// Internally initializes GL resources.
31
bool initializeGL(OSWindow *osWindow,
32
angle::Library *glWindowingLibrary,
33
angle::GLESDriverType driverType,
34
const EGLPlatformParameters &platformParams,
35
const ConfigParameters &configParams) override;
36
void destroyGL() override;
37
bool isGLInitialized() const override;
38
bool makeCurrent() override;
39
void swap() override;
40
bool hasError() const override;
41
bool setSwapInterval(EGLint swapInterval) override;
42
angle::GenericProc getProcAddress(const char *name) override;
43
// Initializes WGL resources.
44
GLWindowContext getCurrentContextGeneric() override;
45
GLWindowContext createContextGeneric(GLWindowContext share) override;
46
bool makeCurrentGeneric(GLWindowContext context) override;
47
48
// Create a WGL context with this window's configuration
49
HGLRC createContext(const ConfigParameters &configParams, HGLRC shareContext);
50
// Make the WGL context current
51
bool makeCurrent(HGLRC context);
52
53
private:
54
WGLWindow(int glesMajorVersion, int glesMinorVersion);
55
~WGLWindow() override;
56
57
// OS resources.
58
HDC mDeviceContext;
59
HGLRC mWGLContext;
60
HWND mWindow;
61
};
62
63
#endif // UTIL_WINDOWS_WGLWINDOW_H_
64
65