• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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                       const EGLPlatformParameters &platformParams,
34                       const ConfigParameters &configParams) override;
35     void destroyGL() override;
36     bool isGLInitialized() const override;
37 
38     bool makeCurrent() override;
39     void swap() override;
40     bool hasError() const override;
41     bool setSwapInterval(EGLint swapInterval) override;
42 
43   private:
44     WGLWindow(int glesMajorVersion, int glesMinorVersion);
45     ~WGLWindow() override;
46 
47     // OS resources.
48     HDC mDeviceContext;
49     HGLRC mWGLContext;
50     HWND mWindow;
51 };
52 
53 #endif  // UTIL_WINDOWS_WGLWINDOW_H_
54