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