Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/windows/native/sun/java2d/opengl/OGLFuncs_md.h
32288 views
/*1* Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425#ifndef OGLFuncs_md_h_Included26#define OGLFuncs_md_h_Included2728#include <windows.h>29#include "J2D_GL/wglext.h"30#include "OGLFuncMacros.h"31#include <jdk_util.h>3233/**34* Core WGL functions35*/36typedef HGLRC (GLAPIENTRY *wglCreateContextType)(HDC hdc);37typedef BOOL (GLAPIENTRY *wglDeleteContextType)(HGLRC hglrc);38typedef BOOL (GLAPIENTRY *wglMakeCurrentType)(HDC hdc, HGLRC hglrc);39typedef HGLRC (GLAPIENTRY *wglGetCurrentContextType)();40typedef HDC (GLAPIENTRY *wglGetCurrentDCType)();41typedef PROC (GLAPIENTRY *wglGetProcAddressType)(LPCSTR procName);42typedef BOOL (GLAPIENTRY *wglShareListsType)(HGLRC hglrc1, HGLRC hglrc2);4344/**45* WGL extension function pointers46*/47typedef BOOL (GLAPIENTRY *wglChoosePixelFormatARBType)(HDC hdc, const int *pAttribIList, const FLOAT *pAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);48typedef BOOL (GLAPIENTRY *wglGetPixelFormatAttribivARBType)(HDC, int, int, UINT, const int *, int *);49typedef HPBUFFERARB (GLAPIENTRY *wglCreatePbufferARBType)(HDC, int, int, int, const int *);50typedef HDC (GLAPIENTRY *wglGetPbufferDCARBType)(HPBUFFERARB);51typedef int (GLAPIENTRY *wglReleasePbufferDCARBType)(HPBUFFERARB, HDC);52typedef BOOL (GLAPIENTRY *wglDestroyPbufferARBType)(HPBUFFERARB);53typedef BOOL (GLAPIENTRY *wglQueryPbufferARBType)(HPBUFFERARB, int, int *);54typedef BOOL (GLAPIENTRY *wglMakeContextCurrentARBType)(HDC, HDC, HGLRC);55typedef const char *(GLAPIENTRY *wglGetExtensionsStringARBType)(HDC hdc);5657#define OGL_LIB_HANDLE hDllOpenGL58#define OGL_DECLARE_LIB_HANDLE() \59static HMODULE OGL_LIB_HANDLE = 060#define OGL_LIB_IS_UNINITIALIZED() \61(OGL_LIB_HANDLE == 0)62#define OGL_OPEN_LIB() \63OGL_LIB_HANDLE = JDK_LoadSystemLibrary("opengl32.dll")64#define OGL_CLOSE_LIB() \65FreeLibrary(OGL_LIB_HANDLE)66#define OGL_GET_PROC_ADDRESS(f) \67GetProcAddress(OGL_LIB_HANDLE, #f)68#define OGL_GET_EXT_PROC_ADDRESS(f) \69j2d_wglGetProcAddress((LPCSTR)#f)7071#define OGL_EXPRESS_PLATFORM_FUNCS(action) \72OGL_##action##_FUNC(wglCreateContext); \73OGL_##action##_FUNC(wglDeleteContext); \74OGL_##action##_FUNC(wglMakeCurrent); \75OGL_##action##_FUNC(wglGetCurrentContext); \76OGL_##action##_FUNC(wglGetCurrentDC); \77OGL_##action##_FUNC(wglGetProcAddress); \78OGL_##action##_FUNC(wglShareLists);7980#define OGL_EXPRESS_PLATFORM_EXT_FUNCS(action) \81OGL_##action##_EXT_FUNC(wglChoosePixelFormatARB); \82OGL_##action##_EXT_FUNC(wglGetPixelFormatAttribivARB); \83OGL_##action##_EXT_FUNC(wglCreatePbufferARB); \84OGL_##action##_EXT_FUNC(wglGetPbufferDCARB); \85OGL_##action##_EXT_FUNC(wglReleasePbufferDCARB); \86OGL_##action##_EXT_FUNC(wglDestroyPbufferARB); \87OGL_##action##_EXT_FUNC(wglQueryPbufferARB); \88OGL_##action##_EXT_FUNC(wglMakeContextCurrentARB); \89OGL_##action##_EXT_FUNC(wglGetExtensionsStringARB);9091#endif /* OGLFuncs_md_h_Included */929394