1 //
2 // Copyright 2015 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 
7 // FunctionsWGL.h: Defines the FuntionsWGL class to contain loaded WGL functions
8 
9 #ifndef LIBANGLE_RENDERER_GL_WGL_FUNCTIONS_WGL
10 #define LIBANGLE_RENDERER_GL_WGL_FUNCTIONS_WGL
11 
12 #include "common/angleutils.h"
13 #include "libANGLE/renderer/gl/wgl/functionswgl_typedefs.h"
14 
15 namespace rx
16 {
17 
18 class FunctionsWGL : angle::NonCopyable
19 {
20   public:
21     FunctionsWGL();
22     ~FunctionsWGL();
23 
24     // Loads all available wgl functions, may be called multiple times
25     void initialize(HMODULE glModule, HDC context);
26 
27     // Extension information
28     std::vector<std::string> extensions;
29     bool hasExtension(const std::string &ext) const;
30 
31     // Base WGL functions
32     PFNWGLCOPYCONTEXTPROC copyContext;
33     PFNWGLCREATECONTEXTPROC createContext;
34     PFNWGLCREATELAYERCONTEXTPROC createLayerContext;
35     PFNWGLDELETECONTEXTPROC deleteContext;
36     PFNWGLGETCURRENTCONTEXTPROC getCurrentContext;
37     PFNWGLGETCURRENTDCPROC getCurrentDC;
38     PFNWGLGETPROCADDRESSPROC getProcAddress;
39     PFNWGLMAKECURRENTPROC makeCurrent;
40     PFNWGLSHARELISTSPROC shareLists;
41     PFNWGLUSEFONTBITMAPSAPROC useFontBitmapsA;
42     PFNWGLUSEFONTBITMAPSWPROC useFontBitmapsW;
43     PFNSWAPBUFFERSPROC swapBuffers;
44     PFNWGLUSEFONTOUTLINESAPROC useFontOutlinesA;
45     PFNWGLUSEFONTOUTLINESWPROC useFontOutlinesW;
46     PFNWGLDESCRIBELAYERPLANEPROC describeLayerPlane;
47     PFNWGLSETLAYERPALETTEENTRIESPROC setLayerPaletteEntries;
48     PFNWGLGETLAYERPALETTEENTRIESPROC getLayerPaletteEntries;
49     PFNWGLREALIZELAYERPALETTEPROC realizeLayerPalette;
50     PFNWGLSWAPLAYERBUFFERSPROC swapLayerBuffers;
51     PFNWGLSWAPMULTIPLEBUFFERSPROC swapMultipleBuffers;
52 
53     // WGL_EXT_extensions_string
54     PFNWGLGETEXTENSIONSSTRINGEXTPROC getExtensionStringEXT;
55 
56     // WGL_ARB_extensions_string
57     PFNWGLGETEXTENSIONSSTRINGARBPROC getExtensionStringARB;
58 
59     // WGL_ARB_create_context
60     PFNWGLCREATECONTEXTATTRIBSARBPROC createContextAttribsARB;
61 
62     // WGL_ARB_pixel_format
63     PFNWGLGETPIXELFORMATATTRIBIVARBPROC getPixelFormatAttribivARB;
64     PFNWGLGETPIXELFORMATATTRIBFVARBPROC getPixelFormatAttribfvARB;
65     PFNWGLCHOOSEPIXELFORMATARBPROC choosePixelFormatARB;
66 
67     // WGL_EXT_swap_control
68     PFNWGLSWAPINTERVALEXTPROC swapIntervalEXT;
69 
70     // WGL_ARB_pbuffer
71     PFNWGLCREATEPBUFFERARBPROC createPbufferARB;
72     PFNWGLGETPBUFFERDCARBPROC getPbufferDCARB;
73     PFNWGLRELEASEPBUFFERDCARBPROC releasePbufferDCARB;
74     PFNWGLDESTROYPBUFFERARBPROC destroyPbufferARB;
75     PFNWGLQUERYPBUFFERARBPROC queryPbufferARB;
76 
77     // WGL_ARB_render_texture
78     PFNWGLBINDTEXIMAGEARBPROC bindTexImageARB;
79     PFNWGLRELEASETEXIMAGEARBPROC releaseTexImageARB;
80     PFNWGLSETPBUFFERATTRIBARBPROC setPbufferAttribARB;
81 
82     // WGL_NV_DX_interop
83     PFNWGLDXSETRESOURCESHAREHANDLENVPROC dxSetResourceShareHandleNV;
84     PFNWGLDXOPENDEVICENVPROC dxOpenDeviceNV;
85     PFNWGLDXCLOSEDEVICENVPROC dxCloseDeviceNV;
86     PFNWGLDXREGISTEROBJECTNVPROC dxRegisterObjectNV;
87     PFNWGLDXUNREGISTEROBJECTNVPROC dxUnregisterObjectNV;
88     PFNWGLDXOBJECTACCESSNVPROC dxObjectAccessNV;
89     PFNWGLDXLOCKOBJECTSNVPROC dxLockObjectsNV;
90     PFNWGLDXUNLOCKOBJECTSNVPROC dxUnlockObjectsNV;
91 };
92 
93 }  // namespace rx
94 
95 #endif  // LIBANGLE_RENDERER_GL_WGL_FUNCTIONS_WGL
96