mirror of
https://github.com/shadowfacts/lwjgl2-arm64.git
synced 2026-04-06 06:53:59 +00:00
Fixed Brian's bugs
This commit is contained in:
parent
5ac3ea26e8
commit
f08389fdd2
4 changed files with 46 additions and 48 deletions
|
|
@ -74,38 +74,36 @@ public abstract class BaseAL {
|
|||
*/
|
||||
public void create() throws Exception {
|
||||
if (created) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// need to pass path of possible locations of OAL to native side
|
||||
String libpath = System.getProperty("java.library.path");
|
||||
String seperator = System.getProperty("path.separator");
|
||||
String libname;
|
||||
|
||||
// libname is hardcoded atm - this will change in a near future...
|
||||
libname = (System.getProperty("os.name").toLowerCase().indexOf("windows") == -1)
|
||||
? "libopenal.so"
|
||||
: "OpenAL32.dll";
|
||||
|
||||
StringTokenizer st = new StringTokenizer(libpath, seperator);
|
||||
|
||||
//create needed string array
|
||||
String[] oalPaths = new String[st.countTokens()+1];
|
||||
|
||||
//build paths
|
||||
for(int i=0;i<st.countTokens();i++) {
|
||||
oalPaths[i] = st.nextToken() + File.separator + libname;
|
||||
}
|
||||
|
||||
//add cwd path
|
||||
oalPaths[oalPaths.length-1] = libname;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// need to pass path of possible locations of OAL to native side
|
||||
String libpath = System.getProperty("java.library.path");
|
||||
String seperator = System.getProperty("path.separator");
|
||||
String libname;
|
||||
|
||||
// libname is hardcoded atm - this will change in a near future...
|
||||
libname = (System.getProperty("os.name").toLowerCase().indexOf("windows") == -1)
|
||||
? "libopenal.so"
|
||||
: "OpenAL32.dll";
|
||||
|
||||
StringTokenizer st = new StringTokenizer(libpath, seperator);
|
||||
|
||||
//create needed string array
|
||||
String[] oalPaths = new String[st.countTokens()+1];
|
||||
|
||||
//build paths
|
||||
for(int i=0;i<oalPaths.length - 1;i++) {
|
||||
oalPaths[i] = st.nextToken() + File.separator + libname;
|
||||
}
|
||||
|
||||
//add cwd path
|
||||
oalPaths[oalPaths.length-1] = libname;
|
||||
if (!nCreate(oalPaths)) {
|
||||
throw new Exception("AL instance could not be created.");
|
||||
}
|
||||
}
|
||||
created = true;
|
||||
init();
|
||||
init();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -130,4 +128,4 @@ public abstract class BaseAL {
|
|||
* Native method the destroy the AL
|
||||
*/
|
||||
protected native void nDestroy();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -298,6 +298,10 @@ public class ALTest extends BasicTest {
|
|||
// Initialize Open AL manually
|
||||
//Open device
|
||||
device = alc.openDevice(null);
|
||||
if (device == null) {
|
||||
System.out.println("Could not create ALC device");
|
||||
System.exit(-1);
|
||||
}
|
||||
//Create context(s)
|
||||
context = alc.createContext(device, 0);
|
||||
//Set active context
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue