Path: blob/master/src/java.desktop/share/native/common/java2d/opengl/OGLFuncs.c
41159 views
/*1* Copyright (c) 2004, 2006, 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 HEADLESS2627#include "OGLFuncs.h"2829OGL_EXPRESS_ALL_FUNCS(DECLARE)3031OGL_DECLARE_LIB_HANDLE();3233jboolean34OGLFuncs_OpenLibrary()35{36J2dRlsTraceLn(J2D_TRACE_INFO, "OGLFuncs_OpenLibrary");3738OGL_OPEN_LIB();39if (OGL_LIB_IS_UNINITIALIZED()) {40J2dRlsTraceLn(J2D_TRACE_ERROR,41"OGLFuncs_OpenLibrary: could not open library");42return JNI_FALSE;43}4445return JNI_TRUE;46}4748void49OGLFuncs_CloseLibrary()50{51J2dRlsTraceLn(J2D_TRACE_INFO, "OGLFuncs_CloseLibrary");5253if (OGL_LIB_IS_UNINITIALIZED()) {54J2dRlsTraceLn(J2D_TRACE_ERROR,55"OGLFuncs_CloseLibrary: library not yet initialized");56return;57}5859if (OGL_CLOSE_LIB()) {60J2dRlsTraceLn(J2D_TRACE_ERROR,61"OGLFuncs_CloseLibrary: could not close library");62}63}6465jboolean66OGLFuncs_InitPlatformFuncs()67{68J2dRlsTraceLn(J2D_TRACE_INFO, "OGLFuncs_InitPlatformFuncs");6970if (OGL_LIB_IS_UNINITIALIZED()) {71J2dRlsTraceLn(J2D_TRACE_ERROR,72"OGLFuncs_InitPlatformFuncs: library not yet initialized");73return JNI_FALSE;74}7576OGL_EXPRESS_PLATFORM_FUNCS(INIT_AND_CHECK)7778J2dTraceLn(J2D_TRACE_VERBOSE,79"OGLFuncs_InitPlatformFuncs: successfully loaded platform symbols");8081return JNI_TRUE;82}8384jboolean85OGLFuncs_InitBaseFuncs()86{87J2dRlsTraceLn(J2D_TRACE_INFO, "OGLFuncs_InitBaseFuncs");8889if (OGL_LIB_IS_UNINITIALIZED()) {90J2dRlsTraceLn(J2D_TRACE_ERROR,91"OGLFuncs_InitBaseFuncs: library not yet initialized");92return JNI_FALSE;93}9495OGL_EXPRESS_BASE_FUNCS(INIT_AND_CHECK)9697J2dTraceLn(J2D_TRACE_VERBOSE,98"OGLFuncs_InitBaseFuncs: successfully loaded base symbols");99100return JNI_TRUE;101}102103jboolean104OGLFuncs_InitExtFuncs()105{106J2dRlsTraceLn(J2D_TRACE_INFO, "OGLFuncs_InitExtFuncs");107108if (OGL_LIB_IS_UNINITIALIZED()) {109J2dRlsTraceLn(J2D_TRACE_ERROR,110"OGLFuncs_InitExtFuncs: library not yet initialized");111return JNI_FALSE;112}113114OGL_EXPRESS_EXT_FUNCS(INIT)115OGL_EXPRESS_PLATFORM_EXT_FUNCS(INIT_AND_CHECK)116117J2dTraceLn(J2D_TRACE_VERBOSE,118"OGLFuncs_InitExtFuncs: successfully loaded ext symbols");119120return JNI_TRUE;121}122123#endif /* !HEADLESS */124125126