0N/A/*
2362N/A * Copyright (c) 2004, 2007, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/A#ifndef OGLFuncs_md_h_Included
0N/A#define OGLFuncs_md_h_Included
0N/A
0N/A#include <windows.h>
0N/A#include "J2D_GL/wglext.h"
0N/A#include "OGLFuncMacros.h"
4310N/A#include <jdk_util.h>
0N/A
0N/A/**
0N/A * Core WGL functions
0N/A */
0N/Atypedef HGLRC (GLAPIENTRY *wglCreateContextType)(HDC hdc);
0N/Atypedef BOOL (GLAPIENTRY *wglDeleteContextType)(HGLRC hglrc);
0N/Atypedef BOOL (GLAPIENTRY *wglMakeCurrentType)(HDC hdc, HGLRC hglrc);
0N/Atypedef HGLRC (GLAPIENTRY *wglGetCurrentContextType)();
0N/Atypedef HDC (GLAPIENTRY *wglGetCurrentDCType)();
0N/Atypedef PROC (GLAPIENTRY *wglGetProcAddressType)(LPCSTR procName);
0N/Atypedef BOOL (GLAPIENTRY *wglShareListsType)(HGLRC hglrc1, HGLRC hglrc2);
0N/A
0N/A/**
0N/A * WGL extension function pointers
0N/A */
0N/Atypedef BOOL (GLAPIENTRY *wglChoosePixelFormatARBType)(HDC hdc, const int *pAttribIList, const FLOAT *pAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
0N/Atypedef BOOL (GLAPIENTRY *wglGetPixelFormatAttribivARBType)(HDC, int, int, UINT, const int *, int *);
0N/Atypedef HPBUFFERARB (GLAPIENTRY *wglCreatePbufferARBType)(HDC, int, int, int, const int *);
0N/Atypedef HDC (GLAPIENTRY *wglGetPbufferDCARBType)(HPBUFFERARB);
0N/Atypedef int (GLAPIENTRY *wglReleasePbufferDCARBType)(HPBUFFERARB, HDC);
0N/Atypedef BOOL (GLAPIENTRY *wglDestroyPbufferARBType)(HPBUFFERARB);
0N/Atypedef BOOL (GLAPIENTRY *wglQueryPbufferARBType)(HPBUFFERARB, int, int *);
0N/Atypedef BOOL (GLAPIENTRY *wglMakeContextCurrentARBType)(HDC, HDC, HGLRC);
0N/Atypedef const char *(GLAPIENTRY *wglGetExtensionsStringARBType)(HDC hdc);
0N/A
0N/A#define OGL_LIB_HANDLE hDllOpenGL
0N/A#define OGL_DECLARE_LIB_HANDLE() \
0N/A static HMODULE OGL_LIB_HANDLE = 0
0N/A#define OGL_LIB_IS_UNINITIALIZED() \
0N/A (OGL_LIB_HANDLE == 0)
0N/A#define OGL_OPEN_LIB() \
4305N/A OGL_LIB_HANDLE = JDK_LoadSystemLibrary("opengl32.dll")
0N/A#define OGL_CLOSE_LIB() \
0N/A FreeLibrary(OGL_LIB_HANDLE)
0N/A#define OGL_GET_PROC_ADDRESS(f) \
0N/A GetProcAddress(OGL_LIB_HANDLE, #f)
0N/A#define OGL_GET_EXT_PROC_ADDRESS(f) \
0N/A j2d_wglGetProcAddress((LPCSTR)#f)
0N/A
0N/A#define OGL_EXPRESS_PLATFORM_FUNCS(action) \
0N/A OGL_##action##_FUNC(wglCreateContext); \
0N/A OGL_##action##_FUNC(wglDeleteContext); \
0N/A OGL_##action##_FUNC(wglMakeCurrent); \
0N/A OGL_##action##_FUNC(wglGetCurrentContext); \
0N/A OGL_##action##_FUNC(wglGetCurrentDC); \
0N/A OGL_##action##_FUNC(wglGetProcAddress); \
0N/A OGL_##action##_FUNC(wglShareLists);
0N/A
0N/A#define OGL_EXPRESS_PLATFORM_EXT_FUNCS(action) \
0N/A OGL_##action##_EXT_FUNC(wglChoosePixelFormatARB); \
0N/A OGL_##action##_EXT_FUNC(wglGetPixelFormatAttribivARB); \
0N/A OGL_##action##_EXT_FUNC(wglCreatePbufferARB); \
0N/A OGL_##action##_EXT_FUNC(wglGetPbufferDCARB); \
0N/A OGL_##action##_EXT_FUNC(wglReleasePbufferDCARB); \
0N/A OGL_##action##_EXT_FUNC(wglDestroyPbufferARB); \
0N/A OGL_##action##_EXT_FUNC(wglQueryPbufferARB); \
0N/A OGL_##action##_EXT_FUNC(wglMakeContextCurrentARB); \
0N/A OGL_##action##_EXT_FUNC(wglGetExtensionsStringARB);
0N/A
0N/A#endif /* OGLFuncs_md_h_Included */