diff options
author | kbr <[email protected]> | 2006-01-15 03:24:43 +0000 |
---|---|---|
committer | kbr <[email protected]> | 2006-01-15 03:24:43 +0000 |
commit | 16c530c791dbf17e66618233600d9e3387f18da7 (patch) | |
tree | f9c128f140dbbbdd51aae7cd3e79a41cb64b177d /src/java/net | |
parent | 7a45837b60c5cb5b3582167ccbf770c13bd21ea0 (diff) |
Moved GlueGen out of the JOGL workspace and into its own project.
Restructured JOGL and JOAL build processes to separately invoke
GlueGen's main build.xml before using it to generate their code.
Refactored OS/CPU detection code into gluegen-cpptasks.xml build file
in GlueGen workspace, which is now imported by both the JOGL and JOAL
build processes. Unfortunately it seems to be somewhat difficult to
completely factor out the C compiler configuration into the GlueGen
workspace so this has been left for a later date. Added missed
ALProcAddressLookup file to JOAL workspace. Updated JOGL and JOAL
build documentation. More documentation for the GlueGen workspace is
forthcoming.
git-svn-id: file:///home/mbien/NetBeansProjects/JOGAMP/joal-sync/git-svn/../svn-server-sync/joal/trunk@103 03bf7f67-59de-4072-a415-9a990d468a3f
Diffstat (limited to 'src/java/net')
-rwxr-xr-x | src/java/net/java/games/joal/impl/ALProcAddressLookup.java | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/src/java/net/java/games/joal/impl/ALProcAddressLookup.java b/src/java/net/java/games/joal/impl/ALProcAddressLookup.java new file mode 100755 index 0000000..5291587 --- /dev/null +++ b/src/java/net/java/games/joal/impl/ALProcAddressLookup.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) 2003-2005 Sun Microsystems, Inc. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * -Redistribution of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * -Redistribution in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * Neither the name of Sun Microsystems, Inc. or the names of contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * This software is provided "AS IS," without a warranty of any kind. + * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING + * ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR + * NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS + * LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A + * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. + * IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT + * OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR + * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, + * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS + * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + * + * You acknowledge that this software is not designed or intended for use in the + * design, construction, operation or maintenance of any nuclear facility. + */ + +package net.java.games.joal.impl; + +import net.java.games.joal.*; +import com.sun.gluegen.runtime.*; + +/** Helper class for managing OpenAL-related proc address tables. */ + +public class ALProcAddressLookup { + private static final ALProcAddressTable alTable = new ALProcAddressTable(); + private static volatile boolean alTableInitialized = false; + private static final ALCProcAddressTable alcTable = new ALCProcAddressTable(); + private static volatile boolean alcTableInitialized = false; + + public static void resetALProcAddressTable() { + if (!alTableInitialized) { + synchronized (ALProcAddressLookup.class) { + if (!alTableInitialized) { + // At some point this may require an OpenAL context to be + // current as we will actually use alGetProcAddress. Since + // this routine is currently broken and there are no + // per-context function pointers anyway we could actually do + // this work anywhere. We should also in theory have + // per-ALcontext ALProcAddressTables and per-ALCdevice + // ALCProcAddressTables. + ALImpl impl = (ALImpl) ALFactory.getAL(); + ProcAddressHelper.resetProcAddressTable(alTable, impl); + alTableInitialized = true; + } + } + } + } + + public static void resetALCProcAddressTable() { + if (!alcTableInitialized) { + synchronized (ALProcAddressLookup.class) { + if (!alcTableInitialized) { + // At some point this may require an OpenAL device to be + // created as we will actually use alcGetProcAddress. Since + // this routine is currently broken and there are no + // per-device function pointers anyway we could actually do + // this work anywhere. We should also in theory have + // per-ALcontext ALProcAddressTables and per-ALCdevice + // ALCProcAddressTables. + ALImpl impl = (ALImpl) ALFactory.getAL(); + ProcAddressHelper.resetProcAddressTable(alcTable, impl); + alcTableInitialized = true; + } + } + } + } + + public static ALProcAddressTable getALProcAddressTable() { + return alTable; + } + + public static ALCProcAddressTable getALCProcAddressTable() { + return alcTable; + } +} |