You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(134) |
Sep
(52) |
Oct
(13) |
Nov
(342) |
Dec
(163) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(44) |
Feb
(62) |
Mar
(158) |
Apr
(38) |
May
(70) |
Jun
(58) |
Jul
(104) |
Aug
(207) |
Sep
(83) |
Oct
(122) |
Nov
(23) |
Dec
(49) |
| 2004 |
Jan
(119) |
Feb
(132) |
Mar
(192) |
Apr
(140) |
May
(77) |
Jun
(74) |
Jul
(201) |
Aug
(63) |
Sep
(102) |
Oct
(70) |
Nov
(173) |
Dec
(78) |
| 2005 |
Jan
(174) |
Feb
(197) |
Mar
(105) |
Apr
(59) |
May
(77) |
Jun
(43) |
Jul
(21) |
Aug
(18) |
Sep
(47) |
Oct
(37) |
Nov
(74) |
Dec
(50) |
| 2006 |
Jan
(44) |
Feb
(19) |
Mar
(32) |
Apr
(24) |
May
(31) |
Jun
(55) |
Jul
(138) |
Aug
(28) |
Sep
(12) |
Oct
(41) |
Nov
(58) |
Dec
(24) |
| 2007 |
Jan
(28) |
Feb
(14) |
Mar
(10) |
Apr
(68) |
May
(30) |
Jun
(26) |
Jul
(18) |
Aug
(63) |
Sep
(19) |
Oct
(29) |
Nov
(20) |
Dec
(10) |
| 2008 |
Jan
(38) |
Feb
(7) |
Mar
(37) |
Apr
(120) |
May
(41) |
Jun
(36) |
Jul
(39) |
Aug
(24) |
Sep
(28) |
Oct
(30) |
Nov
(36) |
Dec
(75) |
| 2009 |
Jan
(46) |
Feb
(22) |
Mar
(50) |
Apr
(70) |
May
(134) |
Jun
(105) |
Jul
(75) |
Aug
(34) |
Sep
(38) |
Oct
(34) |
Nov
(19) |
Dec
(20) |
| 2010 |
Jan
(11) |
Feb
(20) |
Mar
(65) |
Apr
(83) |
May
(104) |
Jun
(73) |
Jul
(78) |
Aug
(57) |
Sep
(43) |
Oct
(35) |
Nov
(9) |
Dec
(4) |
| 2011 |
Jan
(21) |
Feb
(11) |
Mar
(18) |
Apr
(10) |
May
(18) |
Jun
(15) |
Jul
(48) |
Aug
(25) |
Sep
(17) |
Oct
(45) |
Nov
(15) |
Dec
(12) |
| 2012 |
Jan
(21) |
Feb
(9) |
Mar
(12) |
Apr
(9) |
May
(9) |
Jun
(5) |
Jul
(1) |
Aug
(10) |
Sep
(12) |
Oct
(1) |
Nov
(28) |
Dec
(5) |
| 2013 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
| 2016 |
Jan
(2) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
1
|
2
(2) |
3
(3) |
4
|
5
|
6
|
7
(4) |
|
8
(1) |
9
|
10
|
11
(5) |
12
|
13
|
14
(1) |
|
15
(2) |
16
|
17
|
18
|
19
(26) |
20
|
21
|
|
22
(1) |
23
(3) |
24
(6) |
25
(1) |
26
(3) |
27
(1) |
28
(2) |
|
29
(5) |
30
(2) |
|
|
|
|
|
|
From: <ma...@us...> - 2007-04-19 23:13:54
|
Revision: 2794
http://svn.sourceforge.net/java-game-lib/?rev=2794&view=rev
Author: matzon
Date: 2007-04-19 16:13:52 -0700 (Thu, 19 Apr 2007)
Log Message:
-----------
fixing warnings
Modified Paths:
--------------
trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC11.c
Modified: trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC11.c
===================================================================
--- trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC11.c 2007-04-19 23:02:57 UTC (rev 2793)
+++ trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC11.c 2007-04-19 23:13:52 UTC (rev 2794)
@@ -68,10 +68,10 @@
dev_name = (ALubyte*) GetStringNativeChars(env, devicename);
}
- device = alcCaptureOpenDevice(dev_name, frequency, format, buffersize);
+ device = alcCaptureOpenDevice((const char *)dev_name, (unsigned int) frequency, format, buffersize);
free(dev_name);
- return (jlong) device;
+ return (jlong) ((intptr_t)device);
}
/*
@@ -80,7 +80,7 @@
* Signature: (J)Z
*/
static jboolean JNICALL Java_org_lwjgl_openal_ALC11_nalcCaptureCloseDevice(JNIEnv *env, jclass clazz, jlong device) {
- return (jboolean) alcCaptureCloseDevice((ALCdevice*) device);
+ return (jboolean) alcCaptureCloseDevice((ALCdevice*) ((intptr_t)device));
}
/*
@@ -89,7 +89,7 @@
* Signature: (J)V
*/
static void JNICALL Java_org_lwjgl_openal_ALC11_nalcCaptureStart(JNIEnv *env, jclass clazz, jlong device) {
- alcCaptureStart((ALCdevice*) device);
+ alcCaptureStart((ALCdevice*) ((intptr_t)device));
}
/*
@@ -98,7 +98,7 @@
* Signature: (J)V
*/
static void JNICALL Java_org_lwjgl_openal_ALC11_nalcCaptureStop(JNIEnv * env, jclass clazz, jlong device) {
- alcCaptureStop((ALCdevice*) device);
+ alcCaptureStop((ALCdevice*) ((intptr_t)device));
}
/*
@@ -108,7 +108,7 @@
*/
static void JNICALL Java_org_lwjgl_openal_ALC11_nalcCaptureSamples(JNIEnv *env, jclass clazz, jlong device, jobject buffer, jint position, jint samples) {
ALuint *buffer_address = ((ALuint *)(*env)->GetDirectBufferAddress(env, buffer)) + position;
- alcCaptureSamples((ALCdevice*) device, buffer_address, samples);
+ alcCaptureSamples((ALCdevice*) ((intptr_t)device), buffer_address, samples);
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2007-04-19 23:02:58
|
Revision: 2793
http://svn.sourceforge.net/java-game-lib/?rev=2793&view=rev
Author: matzon
Date: 2007-04-19 16:02:57 -0700 (Thu, 19 Apr 2007)
Log Message:
-----------
fixing warnings
Modified Paths:
--------------
trunk/LWJGL/src/native/common/common_tools.c
trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC10.c
Modified: trunk/LWJGL/src/native/common/common_tools.c
===================================================================
--- trunk/LWJGL/src/native/common/common_tools.c 2007-04-19 22:58:13 UTC (rev 2792)
+++ trunk/LWJGL/src/native/common/common_tools.c 2007-04-19 23:02:57 UTC (rev 2793)
@@ -204,7 +204,6 @@
jmethodID jmethod_str;
jstring result;
jbyteArray bytes;
- int len;
if (str==NULL) {
return NULL;
}
Modified: trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC10.c
===================================================================
--- trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC10.c 2007-04-19 22:58:13 UTC (rev 2792)
+++ trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC10.c 2007-04-19 23:02:57 UTC (rev 2793)
@@ -190,7 +190,6 @@
*/
static jint JNICALL Java_org_lwjgl_openal_ALC10_nalcMakeContextCurrent (JNIEnv *env, jclass clazz, jlong contextaddress) {
ALCcontext* context = (ALCcontext*)((intptr_t)contextaddress);
- ALCenum result;
return alcMakeContextCurrent(context);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2007-04-19 22:58:15
|
Revision: 2792
http://svn.sourceforge.net/java-game-lib/?rev=2792&view=rev
Author: matzon
Date: 2007-04-19 15:58:13 -0700 (Thu, 19 Apr 2007)
Log Message:
-----------
removing ALC
Removed Paths:
-------------
trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC.c
Deleted: trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC.c
===================================================================
--- trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC.c 2007-04-19 22:54:25 UTC (rev 2791)
+++ trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC.c 2007-04-19 22:58:13 UTC (rev 2792)
@@ -1,423 +0,0 @@
-/*
- * Copyright (c) 2002-2004 LWJGL Project
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions 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 'LWJGL' nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * $Id$
- *
- * This is the actual JNI implementation of the OpenAL context/device library.
- *
- * @author Brian Matzon <br...@ma...>
- * @version $Revision$
- */
-
-/* OpenAL includes */
-#include "extal.h"
-
-//alc
-typedef ALCubyte* (ALCAPIENTRY *alcGetStringPROC)(ALCdevice *device,ALCenum param);
-typedef ALCvoid (ALCAPIENTRY *alcGetIntegervPROC)(ALCdevice *device,ALCenum param,ALCsizei size,ALCint *data);
-typedef ALCdevice* (ALCAPIENTRY *alcOpenDevicePROC)(ALCubyte *deviceName);
-typedef ALCvoid (ALCAPIENTRY *alcCloseDevicePROC)(ALCdevice *device);
-typedef ALCcontext* (ALCAPIENTRY *alcCreateContextPROC)(ALCdevice *device,ALCint *attrList);
-typedef ALCenum (ALCAPIENTRY *alcMakeContextCurrentPROC)(ALCcontext *context);
-typedef ALCvoid (ALCAPIENTRY *alcProcessContextPROC)(ALCcontext *context);
-typedef ALCdevice* (ALCAPIENTRY *alcGetContextsDevicePROC)(ALCcontext *context);
-typedef ALCvoid (ALCAPIENTRY *alcSuspendContextPROC)(ALCcontext *context);
-typedef ALCvoid (ALCAPIENTRY *alcDestroyContextPROC)(ALCcontext *context);
-typedef ALCenum (ALCAPIENTRY *alcGetErrorPROC)(ALCdevice *device);
-typedef ALCboolean (ALCAPIENTRY *alcIsExtensionPresentPROC)(ALCdevice *device,ALCubyte *extName);
-//typedef ALCvoid* (ALCAPIENTRY *alcGetProcAddressPROC)(ALCdevice *device,ALCubyte *funcName);
-typedef ALCenum (ALCAPIENTRY *alcGetEnumValuePROC)(ALCdevice *device,ALCubyte *enumName);
-typedef ALCcontext* (ALCAPIENTRY *alcGetCurrentContextPROC)(ALCvoid);
-
-static alcGetCurrentContextPROC alcGetCurrentContext = NULL;
-static alcGetStringPROC alcGetString;
-static alcGetIntegervPROC alcGetIntegerv;
-static alcOpenDevicePROC alcOpenDevice;
-static alcCloseDevicePROC alcCloseDevice;
-static alcCreateContextPROC alcCreateContext;
-static alcMakeContextCurrentPROC alcMakeContextCurrent;
-static alcProcessContextPROC alcProcessContext;
-static alcGetContextsDevicePROC alcGetContextsDevice;
-static alcSuspendContextPROC alcSuspendContext;
-static alcDestroyContextPROC alcDestroyContext;
-static alcGetErrorPROC alcGetError;
-static alcIsExtensionPresentPROC alcIsExtensionPresent;
-//static alcGetProcAddressPROC alcGetProcAddress;
-static alcGetEnumValuePROC alcGetEnumValue;
-
-/**
- * This function returns strings related to the context.
- *
- * C Specification:
- * ALubyte * alcGetString(ALCdevice *device, ALenum token);
- */
-static jstring JNICALL Java_org_lwjgl_openal_ALC_nalcGetString (JNIEnv *env, jclass clazz, jlong deviceaddress, jint token) {
- const char* alcString = (const char*) alcGetString((ALCdevice*)((intptr_t)deviceaddress), (ALenum) token);
- jstring string;
-
- if(alcString == NULL) {
- return NULL;
- }
-
- string = NewStringNative(env, alcString);
-
- return string;
-}
-
-/**
- * This function returns integers related to the context.
- *
- * C Specification:
- * ALvoid alcGetIntegerv(ALCdevice *device, ALenum token, ALsizei size, ALint *dest);
- */
-static void JNICALL Java_org_lwjgl_openal_ALC_nalcGetIntegerv (JNIEnv *env, jclass clazz, jlong deviceaddress, jint token, jint size, jobject dest, jint offset) {
- ALint* address = NULL;
- if (dest != NULL) {
- address = offset + (ALint*) (*env)->GetDirectBufferAddress(env, dest);
- }
- alcGetIntegerv((ALCdevice*)((intptr_t)deviceaddress), (ALenum) token, (ALsizei) size, address);
-}
-
-/**
- * This function opens a device by name.
- *
- * C Specification:
- * ALCdevice *alcOpenDevice( const ALubyte *tokstr );
- */
-static jobject JNICALL Java_org_lwjgl_openal_ALC_alcOpenDevice (JNIEnv *env, jclass clazz, jstring tokstr) {
- char * tokenstring;
- ALCdevice* device;
- /* get ready to create ALCdevice instance */
- jobject alcDevice_object = NULL;
- jclass alcDevice_class = NULL;
- jmethodID alcDevice_method = NULL;
-
- if(tokstr != NULL) {
- tokenstring = GetStringNativeChars(env, tokstr);
- } else {
- tokenstring = NULL;
- }
-
- /* get device */
- device = alcOpenDevice((ALubyte *) tokenstring);
-
- /* if error - cleanup and get out */
- if(device == NULL) {
- if(tokenstring != NULL) {
- free(tokenstring);
- }
- return NULL;
- }
-
- /* find class and constructor */
- alcDevice_class = (*env)->FindClass(env, "org/lwjgl/openal/ALCdevice");
- alcDevice_method = (*env)->GetMethodID(env, alcDevice_class, "<init>", "(J)V");
-
- /* create instance */
- alcDevice_object = (*env)->NewObject(env, alcDevice_class, alcDevice_method, (jlong)((intptr_t)device));
-
- /* clean up */
- if (tokenstring != NULL)
- free(tokenstring);
-
- return alcDevice_object;
-}
-
-/**
- * This function closes a device by name.
- *
- * C Specification:
- * void alcCloseDevice( ALCdevice *dev );
- */
-static void JNICALL Java_org_lwjgl_openal_ALC_alcCloseDevice (JNIEnv *env, jclass clazz, jlong deviceaddress) {
- alcCloseDevice((ALCdevice*)((intptr_t)deviceaddress));
-}
-
-/**
- * This function creates a context using a specified device.
- *
- * C Specification:
- * ALCcontext* alcCreateContext( ALCdevice *dev, ALint* attrlist );
- */
-static jobject JNICALL Java_org_lwjgl_openal_ALC_nalcCreateContext (JNIEnv *env, jclass clazz, jlong deviceaddress, jobject attrlist) {
- ALint* address = NULL;
- ALCcontext* context;
- /* get ready to create ALCcontext instance */
- jobject alcContext_object = NULL;
- jclass alcContext_class = NULL;
- jmethodID alcContext_method = NULL;
-
- if (attrlist != NULL) {
- address = (ALint*) (*env)->GetDirectBufferAddress(env, attrlist);
- }
- context = alcCreateContext((ALCdevice*)((intptr_t)deviceaddress), address);
-
- /* if error - get out */
- if(context == NULL) {
- return NULL;
- }
-
- /* find class and constructor */
- alcContext_class = (*env)->FindClass(env, "org/lwjgl/openal/ALCcontext");
- alcContext_method = (*env)->GetMethodID(env, alcContext_class, "<init>", "(J)V");
-
- /* create instance */
- alcContext_object = (*env)->NewObject(env, alcContext_class, alcContext_method, (jlong)((intptr_t)context));
-
- return alcContext_object;
-}
-
-/**
- * This function makes a specified context the current context.
- *
- * C Specification:
- * ALCboolean alcMakeContextCurrent(ALCcontext *context);
- */
-static jint JNICALL Java_org_lwjgl_openal_ALC_alcMakeContextCurrent (JNIEnv *env, jclass clazz, jlong contextaddress) {
- ALCcontext* context = (ALCcontext*)((intptr_t)contextaddress);
- ALCenum result;
- if(context == NULL) {
- result = alcMakeContextCurrent(NULL);
- } else {
- result = alcMakeContextCurrent(context);
- }
- return result;
-}
-
-/**
- * This function tells a context to begin processing.
- *
- * C Specification:
- * void alcProcessContext(ALCcontext *context);
- */
-static void JNICALL Java_org_lwjgl_openal_ALC_nalcProcessContext (JNIEnv *env, jclass clazz, jlong contextaddress) {
- alcProcessContext((ALCcontext*)((intptr_t)contextaddress));
-}
-
-/**
- * This function retrieves the current context.
- *
- * C Specification:
- * ALCcontext* alcGetCurrentContext( ALvoid );
- */
-static jobject JNICALL Java_org_lwjgl_openal_ALC_alcGetCurrentContext (JNIEnv *env, jclass clazz) {
- ALCcontext* context = alcGetCurrentContext();
-
- /* get ready to create ALCcontext instance */
- jobject alcContext_object = NULL;
- jclass alcContext_class = NULL;
- jmethodID alcContext_method = NULL;
-
- if(context == NULL) {
- return NULL;
- }
- /* find class and constructor */
- alcContext_class = (*env)->FindClass(env, "org/lwjgl/openal/ALCcontext");
- alcContext_method = (*env)->GetMethodID(env, alcContext_class, "<init>", "(J)V");
-
- /* create instance */
- alcContext_object = (*env)->NewObject(env, alcContext_class, alcContext_method, (jlong)((intptr_t)context));
-
- return alcContext_object;
-}
-
-/**
- * This function retrieves the specified contexts device
- *
- * C Specification:
- * ALCdevice* alcGetContextsDevice(ALCcontext *context);
- */
-static jobject JNICALL Java_org_lwjgl_openal_ALC_alcGetContextsDevice (JNIEnv *env, jclass clazz, jlong contextaddress) {
- ALCdevice* device = alcGetContextsDevice((ALCcontext*)((intptr_t)contextaddress));
- /* get ready to create ALCdevice instance */
- jobject alcDevice_object = NULL;
- jclass alcDevice_class = NULL;
- jmethodID alcDevice_method = NULL;
-
- if(device == NULL) {
- return NULL;
- }
-
- /* find class and constructor */
- alcDevice_class = (*env)->FindClass(env, "org/lwjgl/openal/ALCdevice");
- alcDevice_method = (*env)->GetMethodID(env, alcDevice_class, "<init>", "(J)V");
-
- /* create instance */
- alcDevice_object = (*env)->NewObject(env, alcDevice_class, alcDevice_method, (jlong)((intptr_t)device));
-
- return alcDevice_object;
-}
-
-/**
- * This function suspends processing on a specified context.
- *
- * C Specification:
- * void alcSuspendContext(ALCcontext *context);
- */
-static void JNICALL Java_org_lwjgl_openal_ALC_nalcSuspendContext (JNIEnv *env, jclass clazz, jlong contextaddress) {
- alcSuspendContext((ALCcontext*)((intptr_t)contextaddress));
-}
-
-/**
- * This function destroys a context.
- *
- * C Specification:
- * void alcDestroyContext(ALCcontext *context);
- */
-static void JNICALL Java_org_lwjgl_openal_ALC_alcDestroyContext (JNIEnv *env, jclass clazz, jlong contextaddress) {
- alcDestroyContext((ALCcontext*)((intptr_t)contextaddress));
-}
-
-/**
- * This function retrieves the specified devices context error state.
- *
- * C Specification:
- * ALCenum alcGetError(ALCdevice *device);
- */
-static jint JNICALL Java_org_lwjgl_openal_ALC_nalcGetError (JNIEnv *env, jclass clazz, jlong deviceaddress) {
- jint result = alcGetError((ALCdevice*)((intptr_t)deviceaddress));
- return result;
-}
-
-/**
- * This function queries if a specified context extension is available.
- *
- * C Specification:
- * ALboolean alcIsExtensionPresent(ALCdevice *device, ALubyte *extName);
- */
-static jboolean JNICALL Java_org_lwjgl_openal_ALC_nalcIsExtensionPresent (JNIEnv *env, jclass clazz, jlong deviceaddress, jstring extName) {
- /* get extension */
- ALubyte* functionname = (ALubyte*) GetStringNativeChars(env, extName);
-
- jboolean result = (jboolean) alcIsExtensionPresent((ALCdevice*)((intptr_t)deviceaddress), functionname);
-
- free(functionname);
-
- return result;
-}
-
-/**
- * This function retrieves the enum value for a specified enumeration name.
- *
- * C Specification:
- * ALenum alcGetEnumValue(ALCdevice *device, ALubyte *enumName);
- */
-static jint JNICALL Java_org_lwjgl_openal_ALC_nalcGetEnumValue (JNIEnv *env, jclass clazz, jlong deviceaddress, jstring enumName) {
- /* get extension */
- ALubyte* enumerationname = (ALubyte*) GetStringNativeChars(env, enumName);
-
- jint result = (jint) alcGetEnumValue((ALCdevice*)((intptr_t)deviceaddress), enumerationname);
-
- free(enumerationname);
-
- return result;
-}
-
-JNIEXPORT jobjectArray JNICALL Java_org_lwjgl_openal_ALC_ngetImplementations(JNIEnv *env, jclass clazz) {
- jclass strcls;
- jarray strarr = NULL;
- jstring str;
-
- char *deviceList;
- char *devices[12];
- int numDevices, i;
-
- // get device list
- deviceList = (char *)alcGetString(NULL, 4100L);
-
- // build list
- for (numDevices = 0; numDevices < 12; numDevices++) {devices[numDevices] = NULL;}
- for (numDevices = 0; numDevices < 12; numDevices++) {
- devices[numDevices] = deviceList;
- deviceList += strlen(deviceList);
- if (deviceList[0] == 0) {
- if (deviceList[1] == 0) {
- break;
- } else {
- deviceList += 1;
- }
- }
- }
-
- // iterate found devices and add to java string array
- if (devices[numDevices] != NULL) {
- numDevices++;
- strcls = (*env)->FindClass(env, "java/lang/String");
- strarr = (*env)->NewObjectArray(env, numDevices+1, strcls, 0);
-
- // add default
- str = NewStringNative(env, "NULL Device (Default)");
- (*env)->SetObjectArrayElement(env, strarr, 0, str);
- (*env)->DeleteLocalRef(env, str);
-
- for (i = 0; i < numDevices; i++) {
- str = NewStringNative(env, devices[i]);
- (*env)->SetObjectArrayElement(env, strarr, i+1, str);
- (*env)->DeleteLocalRef(env, str);
- }
-
- }
- return strarr;
-}
-
-/**
- * Loads the context OpenAL functions
- *
- * @return true if all methods were loaded, false if one of the methods could not be loaded
- */
-#ifdef __cplusplus
-extern "C" {
-#endif
-JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC_initNativeStubs(JNIEnv *env, jclass clazz) {
- JavaMethodAndExtFunction functions[] = {
- {"nalcGetString", "(JI)Ljava/lang/String;", (void*)&Java_org_lwjgl_openal_ALC_nalcGetString, "alcGetString", (void*)&alcGetString},
- {"nalcGetIntegerv", "(JIILjava/nio/Buffer;I)V", (void*)&Java_org_lwjgl_openal_ALC_nalcGetIntegerv, "alcGetIntegerv", (void*)&alcGetIntegerv},
- {"alcOpenDevice", "(Ljava/lang/String;)Lorg/lwjgl/openal/ALCdevice;", (void*)&Java_org_lwjgl_openal_ALC_alcOpenDevice, "alcOpenDevice", (void*)&alcOpenDevice},
- {"alcCloseDevice", "(J)V", (void*)&Java_org_lwjgl_openal_ALC_alcCloseDevice, "alcCloseDevice", (void*)&alcCloseDevice},
- {"nalcCreateContext", "(JLjava/nio/IntBuffer;)Lorg/lwjgl/openal/ALCcontext;", (void*)&Java_org_lwjgl_openal_ALC_nalcCreateContext, "alcCreateContext", (void*)&alcCreateContext},
- {"alcMakeContextCurrent", "(J)I", (void*)&Java_org_lwjgl_openal_ALC_alcMakeContextCurrent, "alcMakeContextCurrent", (void*)&alcMakeContextCurrent},
- {"nalcProcessContext", "(J)V", (void*)&Java_org_lwjgl_openal_ALC_nalcProcessContext, "alcProcessContext", (void*)&alcProcessContext},
- {"alcGetCurrentContext", "()Lorg/lwjgl/openal/ALCcontext;", (void*)&Java_org_lwjgl_openal_ALC_alcGetCurrentContext, "alcGetCurrentContext", (void*)&alcGetCurrentContext},
- {"alcGetContextsDevice", "(J)Lorg/lwjgl/openal/ALCdevice;", (void*)&Java_org_lwjgl_openal_ALC_alcGetContextsDevice, "alcGetContextsDevice", (void*)&alcGetContextsDevice},
- {"nalcSuspendContext", "(J)V", (void*)&Java_org_lwjgl_openal_ALC_nalcSuspendContext, "alcSuspendContext", (void*)&alcSuspendContext},
- {"alcDestroyContext", "(J)V", (void*)&Java_org_lwjgl_openal_ALC_alcDestroyContext, "alcDestroyContext", (void*)&alcDestroyContext},
- {"nalcGetError", "(J)I", (void*)&Java_org_lwjgl_openal_ALC_nalcGetError, "alcGetError", (void*)&alcGetError},
- {"nalcIsExtensionPresent", "(JLjava/lang/String;)Z", (void*)&Java_org_lwjgl_openal_ALC_nalcIsExtensionPresent, "alcIsExtensionPresent", (void*)&alcIsExtensionPresent},
- {"nalcGetEnumValue", "(JLjava/lang/String;)I", (void*)&Java_org_lwjgl_openal_ALC_nalcGetEnumValue, "alcGetEnumValue", (void*)&alcGetEnumValue}
- };
- int num_functions = NUMFUNCTIONS(functions);
- extal_InitializeClass(env, clazz, num_functions, functions);
-}
-#ifdef __cplusplus
-}
-#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2007-04-19 22:54:27
|
Revision: 2791
http://svn.sourceforge.net/java-game-lib/?rev=2791&view=rev
Author: matzon
Date: 2007-04-19 15:54:25 -0700 (Thu, 19 Apr 2007)
Log Message:
-----------
re-enabled missing ALC error check
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/openal/ALC10.java
Modified: trunk/LWJGL/src/java/org/lwjgl/openal/ALC10.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/openal/ALC10.java 2007-04-19 22:53:32 UTC (rev 2790)
+++ trunk/LWJGL/src/java/org/lwjgl/openal/ALC10.java 2007-04-19 22:54:25 UTC (rev 2791)
@@ -158,7 +158,7 @@
public static String alcGetString(ALCdevice device, int pname) {
String result;
result = nalcGetString(getDevice(device), pname);
- //Util.checkALCError();
+ Util.checkALCError();
return result;
}
private native static String nalcGetString(long device, int pname);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2007-04-19 22:53:34
|
Revision: 2790
http://svn.sourceforge.net/java-game-lib/?rev=2790&view=rev
Author: matzon
Date: 2007-04-19 15:53:32 -0700 (Thu, 19 Apr 2007)
Log Message:
-----------
removed ALC from javah
added AL11 to generate-openal
Modified Paths:
--------------
trunk/LWJGL/build.xml
Modified: trunk/LWJGL/build.xml
===================================================================
--- trunk/LWJGL/build.xml 2007-04-19 22:49:49 UTC (rev 2789)
+++ trunk/LWJGL/build.xml 2007-04-19 22:53:32 UTC (rev 2790)
@@ -596,7 +596,6 @@
<class name="org.lwjgl.input.Keyboard" />
<class name="org.lwjgl.input.Mouse" />
- <class name="org.lwjgl.openal.ALC" />
<class name="org.lwjgl.openal.AL" />
<class name="org.lwjgl.opengl.GLContext" />
@@ -648,7 +647,7 @@
<arg path="${lwjgl.src.native}/generated"/>
<arg value="-Atypemap=org.lwjgl.util.generator.ALTypeMap"/>
<arg value="-Ageneratechecks"/>
- <fileset dir="${lwjgl.src.templates}" includes="org/lwjgl/openal/AL10.java"/>
+ <fileset dir="${lwjgl.src.templates}" includes="org/lwjgl/openal/AL10.java, org/lwjgl/openal/AL11.java"/>
</apply>
</target>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2007-04-19 22:49:51
|
Revision: 2789
http://svn.sourceforge.net/java-game-lib/?rev=2789&view=rev
Author: matzon
Date: 2007-04-19 15:49:49 -0700 (Thu, 19 Apr 2007)
Log Message:
-----------
removed some null checks
Modified Paths:
--------------
trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC10.c
Modified: trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC10.c
===================================================================
--- trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC10.c 2007-04-19 22:44:07 UTC (rev 2788)
+++ trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC10.c 2007-04-19 22:49:49 UTC (rev 2789)
@@ -179,11 +179,6 @@
}
context = alcCreateContext((ALCdevice*)((intptr_t)deviceaddress), address);
- /* if error - get out */
- if(context == NULL) {
- return (jlong) NULL;
- }
-
return (jlong)((intptr_t)context);
}
@@ -196,12 +191,7 @@
static jint JNICALL Java_org_lwjgl_openal_ALC10_nalcMakeContextCurrent (JNIEnv *env, jclass clazz, jlong contextaddress) {
ALCcontext* context = (ALCcontext*)((intptr_t)contextaddress);
ALCenum result;
- if(context == NULL) {
- result = alcMakeContextCurrent(NULL);
- } else {
- result = alcMakeContextCurrent(context);
- }
- return result;
+ return alcMakeContextCurrent(context);
}
/**
@@ -222,10 +212,6 @@
*/
static jlong JNICALL Java_org_lwjgl_openal_ALC10_nalcGetCurrentContext (JNIEnv *env, jclass clazz) {
ALCcontext* context = alcGetCurrentContext();
-
- if(context == NULL) {
- return (jlong) NULL;
- }
return (jlong)((intptr_t)context);
}
@@ -237,11 +223,6 @@
*/
static jlong JNICALL Java_org_lwjgl_openal_ALC10_nalcGetContextsDevice (JNIEnv *env, jclass clazz, jlong contextaddress) {
ALCdevice* device = alcGetContextsDevice((ALCcontext*)((intptr_t)contextaddress));
-
- if(device == NULL) {
- return (jlong) NULL;
- }
-
return (jlong)((intptr_t)device);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2007-04-19 22:44:09
|
Revision: 2788
http://svn.sourceforge.net/java-game-lib/?rev=2788&view=rev
Author: matzon
Date: 2007-04-19 15:44:07 -0700 (Thu, 19 Apr 2007)
Log Message:
-----------
output capture devices
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/test/openal/ALCCaptureTest.java
Modified: trunk/LWJGL/src/java/org/lwjgl/test/openal/ALCCaptureTest.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/test/openal/ALCCaptureTest.java 2007-04-19 22:43:38 UTC (rev 2787)
+++ trunk/LWJGL/src/java/org/lwjgl/test/openal/ALCCaptureTest.java 2007-04-19 22:44:07 UTC (rev 2788)
@@ -80,16 +80,16 @@
}
// get list of devices
- String captureDevices = ALC10.alcGetString(null, ALC11.ALC_CAPTURE_DEVICE_SPECIFIER);
- System.out.println("captureDevices: " + captureDevices);
-
+ String[] captureDevices = ALC10.alcGetString(null, ALC11.ALC_CAPTURE_DEVICE_SPECIFIER).split("\0");
+ System.out.println("Available Capture Devices: ");
+ for(int i=0; i<captureDevices.length; i++) {
+ System.out.println(i + ": " + captureDevices[i]);
+ }
String defaultRecorder = ALC10.alcGetString(AL.getDevice(), ALC11.ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER);
System.out.println("Default capture device: " + defaultRecorder);
ALCdevice device = ALC11.alcCaptureOpenDevice(null, FREQ, FMT, SAMPS);
-
-
if(device != null) {
// record some sound
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2007-04-19 22:43:40
|
Revision: 2787
http://svn.sourceforge.net/java-game-lib/?rev=2787&view=rev
Author: matzon
Date: 2007-04-19 15:43:38 -0700 (Thu, 19 Apr 2007)
Log Message:
-----------
remove debug
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/openal/ALC11.java
Modified: trunk/LWJGL/src/java/org/lwjgl/openal/ALC11.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/openal/ALC11.java 2007-04-19 22:39:08 UTC (rev 2786)
+++ trunk/LWJGL/src/java/org/lwjgl/openal/ALC11.java 2007-04-19 22:43:38 UTC (rev 2787)
@@ -83,7 +83,6 @@
public static ALCdevice alcCaptureOpenDevice(String devicename, int frequency, int format, int buffersize) {
long device = nalcCaptureOpenDevice(devicename, frequency, format, buffersize);
if(device > 0) {
- System.out.println("new device: " + device + "/" + devicename);
return new ALCdevice(device);
}
return null;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2007-04-19 22:39:10
|
Revision: 2786
http://svn.sourceforge.net/java-game-lib/?rev=2786&view=rev
Author: matzon
Date: 2007-04-19 15:39:08 -0700 (Thu, 19 Apr 2007)
Log Message:
-----------
using NewStringNativeWithLength
Modified Paths:
--------------
trunk/LWJGL/src/native/common/devil/org_lwjgl_devil_IL.c
trunk/LWJGL/src/native/common/devil/org_lwjgl_devil_ILU.c
trunk/LWJGL/src/native/common/devil/org_lwjgl_devil_ILUT.c
trunk/LWJGL/src/native/common/fmod3/org_lwjgl_fmod3_FMOD.c
trunk/LWJGL/src/native/common/fmod3/org_lwjgl_fmod3_FMusic.c
trunk/LWJGL/src/native/common/fmod3/org_lwjgl_fmod3_FSound.c
Modified: trunk/LWJGL/src/native/common/devil/org_lwjgl_devil_IL.c
===================================================================
--- trunk/LWJGL/src/native/common/devil/org_lwjgl_devil_IL.c 2007-04-19 22:26:19 UTC (rev 2785)
+++ trunk/LWJGL/src/native/common/devil/org_lwjgl_devil_IL.c 2007-04-19 22:39:08 UTC (rev 2786)
@@ -517,7 +517,8 @@
* Signature: (I)Ljava/lang/String;
*/
static jstring JNICALL Java_org_lwjgl_devil_IL_ilGetString(JNIEnv *env, jclass clazz, jint stringName) {
- return NewStringNative(env, ilGetString((ILenum)stringName));
+ char * name = ilGetString((ILenum)stringName);
+ return NewStringNativeWithLength(env, name, strlen(name));
}
/*
Modified: trunk/LWJGL/src/native/common/devil/org_lwjgl_devil_ILU.c
===================================================================
--- trunk/LWJGL/src/native/common/devil/org_lwjgl_devil_ILU.c 2007-04-19 22:26:19 UTC (rev 2785)
+++ trunk/LWJGL/src/native/common/devil/org_lwjgl_devil_ILU.c 2007-04-19 22:39:08 UTC (rev 2786)
@@ -245,7 +245,8 @@
* Signature: (I)Ljava/lang/String;
*/
static jstring JNICALL Java_org_lwjgl_devil_ILU_iluErrorString(JNIEnv *env, jclass clazz, jint error) {
- return NewStringNative(env, iluErrorString((ILenum)error));
+ char * errorstring = iluErrorString((ILenum)error);
+ return NewStringNativeWithLength(env, errorstring, strlen(errorstring));
}
/*
@@ -366,7 +367,8 @@
* Signature: (I)Ljava/lang/String;
*/
static jstring JNICALL Java_org_lwjgl_devil_ILU_iluGetString(JNIEnv *env, jclass clazz, jint stringName) {
- return NewStringNative(env, iluGetString((ILenum)stringName));
+ char * name = iluGetString((ILenum)stringName);
+ return NewStringNativeWithLength(env, name, strlen(name));
}
/*
Modified: trunk/LWJGL/src/native/common/devil/org_lwjgl_devil_ILUT.c
===================================================================
--- trunk/LWJGL/src/native/common/devil/org_lwjgl_devil_ILUT.c 2007-04-19 22:26:19 UTC (rev 2785)
+++ trunk/LWJGL/src/native/common/devil/org_lwjgl_devil_ILUT.c 2007-04-19 22:39:08 UTC (rev 2786)
@@ -120,7 +120,8 @@
* Signature: (I)Ljava/lang/String;
*/
static jstring JNICALL Java_org_lwjgl_devil_ILUT_ilutGetString(JNIEnv *env, jclass clazz, jint stringName){
- return NewStringNative(env, ilutGetString((ILenum)stringName));
+ char * name = ilutGetString((ILenum)stringName);
+ return NewStringNativeWithLength(env, name, strlen(name));
}
/*
Modified: trunk/LWJGL/src/native/common/fmod3/org_lwjgl_fmod3_FMOD.c
===================================================================
--- trunk/LWJGL/src/native/common/fmod3/org_lwjgl_fmod3_FMOD.c 2007-04-19 22:26:19 UTC (rev 2785)
+++ trunk/LWJGL/src/native/common/fmod3/org_lwjgl_fmod3_FMOD.c 2007-04-19 22:39:08 UTC (rev 2786)
@@ -82,5 +82,6 @@
* Signature: (I)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_org_lwjgl_fmod3_FMOD_FMOD_1ErrorString(JNIEnv *env, jclass clazz, jint errorcode) {
- return NewStringNative(env, FMOD_ErrorString(errorcode));
+ char * error = FMOD_ErrorString(errorcode);
+ return NewStringNativeWithLength(env, error, strlen(error));
}
Modified: trunk/LWJGL/src/native/common/fmod3/org_lwjgl_fmod3_FMusic.c
===================================================================
--- trunk/LWJGL/src/native/common/fmod3/org_lwjgl_fmod3_FMusic.c 2007-04-19 22:26:19 UTC (rev 2785)
+++ trunk/LWJGL/src/native/common/fmod3/org_lwjgl_fmod3_FMusic.c 2007-04-19 22:39:08 UTC (rev 2786)
@@ -281,7 +281,7 @@
JNIEXPORT jstring JNICALL Java_org_lwjgl_fmod3_FMusic_nFMUSIC_1GetName
(JNIEnv *env, jclass clazz, jlong module) {
const char * name = fmod_instance->FMUSIC_GetName((FMUSIC_MODULE *) module);
- return NewStringNative(env, name);
+ return NewStringNativeWithLength(env, name, strlen(name));
}
/*
Modified: trunk/LWJGL/src/native/common/fmod3/org_lwjgl_fmod3_FSound.c
===================================================================
--- trunk/LWJGL/src/native/common/fmod3/org_lwjgl_fmod3_FSound.c 2007-04-19 22:26:19 UTC (rev 2785)
+++ trunk/LWJGL/src/native/common/fmod3/org_lwjgl_fmod3_FSound.c 2007-04-19 22:39:08 UTC (rev 2786)
@@ -230,7 +230,8 @@
* Signature: (I)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_org_lwjgl_fmod3_FSound_FSOUND_1GetDriverName(JNIEnv * env, jclass clazz, jint id) {
- return NewStringNative(env, (const char *) fmod_instance->FSOUND_GetDriverName(id));
+ char * driver = fmod_instance->FSOUND_GetDriverName(id);
+ return NewStringNativeWithLength(env, driver, strlen(driver));
}
/*
@@ -430,7 +431,8 @@
* Signature: (J)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_org_lwjgl_fmod3_FSound_nFSOUND_1Sample_1GetName(JNIEnv * env, jclass clazz, jlong sptr) {
- return NewStringNative(env, fmod_instance->FSOUND_Sample_GetName((FSOUND_SAMPLE *) sptr));
+ char * name = fmod_instance->FSOUND_Sample_GetName((FSOUND_SAMPLE *) sptr);
+ return NewStringNativeWithLength(env, name, strlen(name));
}
/*
@@ -1203,7 +1205,7 @@
unsigned int * nPcmOffset = pcmOffsetPosition + (unsigned int *) (*env)->GetDirectBufferAddress(env, pcmOffset);
char * result = fmod_instance->FSOUND_Stream_GetSyncPointInfo(nPoint, nPcmOffset);
if(result != NULL) {
- return NewStringNative(env, result);
+ return NewStringNativeWithLength(env, result, strlen(result));
}
return NULL;
}
@@ -1221,7 +1223,7 @@
if(fmod_instance->FSOUND_Stream_GetTagField((FSOUND_STREAM*) stream, num, &type, &name, &value, &length)) {
// create string instance of name
- jstring nName = NewStringNative(env, name);
+ jstring nName = NewStringNativeWithLength(env, name, strlen(name));
// get set method and call it
jclass cls = (*env)->GetObjectClass(env, tagField);
@@ -1257,7 +1259,8 @@
* Signature: ()Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_org_lwjgl_fmod3_FSound_FSOUND_1Stream_1Net_1GetLastServerStatus(JNIEnv * env, jclass clazz) {
- return NewStringNative(env, fmod_instance->FSOUND_Stream_Net_GetLastServerStatus());
+ char * serverstatus = fmod_instance->FSOUND_Stream_Net_GetLastServerStatus();
+ return NewStringNativeWithLength(env, serverstatus, strlen(serverstatus));
}
/*
@@ -1777,7 +1780,8 @@
* Signature: (I)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_org_lwjgl_fmod3_FSound_FSOUND_1Record_1GetDriverName(JNIEnv * env, jclass clazz, jint driver) {
- return NewStringNative(env, (const char *)fmod_instance->FSOUND_Record_GetDriverName(driver));
+ char * drivername = fmod_instance->FSOUND_Record_GetDriverName(driver);
+ return NewStringNativeWithLength(env, drivername, strlen(drivername));
}
/*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2007-04-19 22:34:02
|
Revision: 2772
http://svn.sourceforge.net/java-game-lib/?rev=2772&view=rev
Author: matzon
Date: 2007-04-19 15:18:16 -0700 (Thu, 19 Apr 2007)
Log Message:
-----------
using NewStringNativeWithLength
Modified Paths:
--------------
trunk/LWJGL/src/native/common/common_tools.c
trunk/LWJGL/src/native/common/common_tools.h
Modified: trunk/LWJGL/src/native/common/common_tools.c
===================================================================
--- trunk/LWJGL/src/native/common/common_tools.c 2007-04-19 12:00:40 UTC (rev 2771)
+++ trunk/LWJGL/src/native/common/common_tools.c 2007-04-19 22:18:16 UTC (rev 2772)
@@ -195,11 +195,11 @@
* match GLuchar and ALuchar types
*/
jstring NewStringNativeUnsigned(JNIEnv *env, const unsigned char *str) {
- return NewStringNative(env, (const char *)str);
+ return NewStringNativeWithLength(env, (const char *)str, strlen((const char *)str));
}
// creates locale specific string
-jstring NewStringNative(JNIEnv *env, const char *str) {
+jstring NewStringNativeWithLength(JNIEnv *env, const char *str, int length) {
jclass jcls_str;
jmethodID jmethod_str;
jstring result;
@@ -221,10 +221,10 @@
if ((*env)->EnsureLocalCapacity(env,2) < 0) {
return NULL; /* out of memory error */
}
- len = strlen(str);
- bytes = (*env)->NewByteArray(env,len);
+
+ bytes = (*env)->NewByteArray(env,length);
if (bytes != NULL) {
- (*env)->SetByteArrayRegion(env,bytes, 0, len, (jbyte *)str);
+ (*env)->SetByteArrayRegion(env,bytes, 0, length, (jbyte *)str);
result = (jstring)(*env)->NewObject(env,jcls_str, jmethod_str, bytes);
(*env)->DeleteLocalRef(env,bytes);
return result;
@@ -289,7 +289,7 @@
}
bool getBooleanProperty(JNIEnv *env, const char* propertyName) {
- jstring property = NewStringNative(env, propertyName);
+ jstring property = NewStringNativeWithLength(env, propertyName, strlen(propertyName));
jclass org_lwjgl_LWJGLUtil_class;
jmethodID getBoolean;
if (property == NULL)
Modified: trunk/LWJGL/src/native/common/common_tools.h
===================================================================
--- trunk/LWJGL/src/native/common/common_tools.h 2007-04-19 12:00:40 UTC (rev 2771)
+++ trunk/LWJGL/src/native/common/common_tools.h 2007-04-19 22:18:16 UTC (rev 2772)
@@ -138,7 +138,7 @@
extern void printfDebug(const char *format, ...);
extern bool getBooleanProperty(JNIEnv *env, const char* propertyName);
extern char * GetStringNativeChars(JNIEnv *env, jstring jstr);
-extern jstring NewStringNative(JNIEnv *env, const char *str);
+extern jstring NewStringNativeWithLength(JNIEnv *env, const char *str, int length);
extern jstring NewStringNativeUnsigned(JNIEnv *env, const unsigned char *str);
extern jobject newJavaManagedByteBuffer(JNIEnv *env, const int size);
extern bool positionBuffer(JNIEnv *env, jobject buffer, jint position);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2007-04-19 22:26:25
|
Revision: 2785
http://svn.sourceforge.net/java-game-lib/?rev=2785&view=rev
Author: matzon
Date: 2007-04-19 15:26:19 -0700 (Thu, 19 Apr 2007)
Log Message:
-----------
updated to ALC10 instead of ALC
Removed Paths:
-------------
trunk/LWJGL/src/java/org/lwjgl/openal/ALC.java
Deleted: trunk/LWJGL/src/java/org/lwjgl/openal/ALC.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/openal/ALC.java 2007-04-19 22:25:47 UTC (rev 2784)
+++ trunk/LWJGL/src/java/org/lwjgl/openal/ALC.java 2007-04-19 22:26:19 UTC (rev 2785)
@@ -1,382 +0,0 @@
-/*
- * Copyright (c) 2002-2004 LWJGL Project
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions 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 'LWJGL' nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package org.lwjgl.openal;
-
-import java.nio.Buffer;
-import java.nio.IntBuffer;
-
-import org.lwjgl.BufferChecks;
-import org.lwjgl.LWJGLException;
-import org.lwjgl.Sys;
-
-/**
- *
- * <p>
- * This is the context class for OpenAL. This class implements functions
- * in alc.h
- * </p>
- *
- * <p>
- * ALC introduces the notion of a Device. A Device can be, depending on the
- * implementation, a hardware device, or a daemon/OS service/actual server. This
- * mechanism also permits different drivers (and hardware) to coexist within the same
- * system, as well as allowing several applications to share system resources for audio,
- * including a single hardware output device. The details are left to the
- * implementation, which has to map the available backends to unique device
- * specifiers (represented as strings).
- * </p>
- *
- * <p>
- * <b>NOTE:</b><br>
- * The LWJGL implementation of OpenAL does not expose the device, nor the context.
- * Whenever <code>AL</code> is created using the <code>create</code> method, an underlying
- * device and context is created. Thus more advanced usage of multiple contexts and/or devices
- * are not possible. The above mentioned features are very rarely used in games.
- * </p>
- *
- * @author Brian Matzon <br...@ma...>
- * @version $Revision$
- * $Id$
- */
-public final class ALC {
- /** Bad value */
- public static final int ALC_INVALID = -1;
-
- /** Boolean False */
- public static final int ALC_FALSE = 0;
-
- /** Boolean True */
- public static final int ALC_TRUE = 1;
-
- /** Errors: No Error */
- public static final int ALC_NO_ERROR = ALC_FALSE;
-
- /** Major version query. */
- public static final int ALC_MAJOR_VERSION = 0x1000;
-
- /** Minor version query. */
- public static final int ALC_MINOR_VERSION = 0x1001;
-
- /**
- * The size required for the zero-terminated attributes list, for the current context.
- **/
- public static final int ALC_ATTRIBUTES_SIZE = 0x1002;
-
- /**
- * Expects a destination of ALC_CURRENT_ATTRIBUTES_SIZE,
- * and provides the attribute list for the current context of the specified device.
- */
- public static final int ALC_ALL_ATTRIBUTES = 0x1003;
-
- /** The specifier string for the default device */
- public static final int ALC_DEFAULT_DEVICE_SPECIFIER = 0x1004;
-
- /** The specifier string for the device */
- public static final int ALC_DEVICE_SPECIFIER = 0x1005;
-
- /** The extensions string for diagnostics and printing */
- public static final int ALC_EXTENSIONS = 0x1006;
-
- /** Frequency for mixing output buffer, in units of Hz. */
- public static final int ALC_FREQUENCY = 0x1007;
-
- /** Refresh intervalls, in units of Hz. */
- public static final int ALC_REFRESH = 0x1008;
-
- /** Flag, indicating a synchronous context. */
- public static final int ALC_SYNC = 0x1009;
-
- /** The device argument does not name a valid device */
- public static final int ALC_INVALID_DEVICE = 0xA001;
-
- /** The context argument does not name a valid context */
- public static final int ALC_INVALID_CONTEXT = 0xA002;
-
- /**
- * A function was called at inappropriate time, or in an inappropriate way,
- * causing an illegal state. This can be an incompatible ALenum, object ID,
- * and/or function.
- */
- public static final int ALC_INVALID_ENUM = 0xA003;
-
- /**
- * Illegal value passed as an argument to an AL call.
- * Applies to parameter values, but not to enumerations.
- */
- public static final int ALC_INVALID_VALUE = 0xA004;
-
- /**
- * A function could not be completed, because there is not enough
- * memory available.
- */
- public static final int ALC_OUT_OF_MEMORY = 0xA005;
-
- static {
- Sys.initialize();
- }
-
- private ALC() {
- }
-
- static native void initNativeStubs() throws LWJGLException;
-
- static long getDevice() {
- if(AL.device != null) {
- return AL.device.device;
- }
- return 0L;
- }
-
- /**
- * The application can obtain certain strings from ALC.
- *
- * <code>ALC_DEFAULT_DEVICE_SPECIFIER</code> - The specifer string for the default device
- * <code>ALC_DEVICE_SPECIFIER</code> - The specifer string for the device
- * <code>ALC_EXTENSIONS</code> - The extensions string for diagnostics and printing.
- *
- * In addition, printable error message strings are provided for all valid error tokens,
- * including <code>ALC_NO_ERROR</code>,<code>ALC_INVALID_DEVICE</code>, <code>ALC_INVALID_CONTEXT</code>,
- * <code>ALC_INVALID_ENUM</code>, <code>ALC_INVALID_VALUE</code>.
- *
- * @param pname Property to get
- * @return String property from device
- */
- public static String alcGetString(int pname) {
- String result;
- result = nalcGetString(getDevice(), pname);
- Util.checkALCError();
- return result;
- }
- private native static String nalcGetString(long device, int pname);
-
- /**
- * The application can query ALC for information using an integer query function.
- * For some tokens, <code>null</code> is a legal deviceHandle. In other cases, specifying a <code>null</code>
- * device will generate an <code>ALC_INVALID_DEVICE</code> error. The application has to
- * specify the size of the destination buffer provided. A <code>null</code> destination or a zero
- * size parameter will cause ALC to ignore the query.
- *
- * <code>ALC_MAJOR_VERSION</code> - Major version query.
- * <code>ALC_MINOR_VERSION</code> - Minor version query.
- * <code>ALC_ATTRIBUTES_SIZE</code> - The size required for the zero-terminated attributes list,
- * for the current context. <code>null</code> is an invalid device. <code>null</code> (no current context
- * for the specified device) is legal.
- * <code>ALC_ALL_ATTRIBUTES</code> - Expects a destination of <code>ALC_CURRENT_ATTRIBUTES_SIZE</code>,
- * and provides the attribute list for the current context of the specified device.
- * <code>null</code> is an invalid device. <code>null</code> (no current context for the specified device)
- * will return the default attributes defined by the specified device.
- *
- * @param pname Property to get
- * @param integerdata ByteBuffer to write integers to
- */
- public static void alcGetInteger(int pname, IntBuffer integerdata) {
- BufferChecks.checkDirect(integerdata);
- nalcGetIntegerv(getDevice(), pname, integerdata.remaining(), integerdata, integerdata.position());
- Util.checkALCError();
- }
- private native static void nalcGetIntegerv(long device, int pname, int size, Buffer integerdata, int offset);
-
- /**
- * The <code>alcOpenDevice</code> function allows the application (i.e. the client program) to
- * connect to a device (i.e. the server).
- *
- * If the function returns <code>null</code>, then no sound driver/device has been found. The
- * argument is a null terminated string that requests a certain device or device
- * configuration. If <code>null</code> is specified, the implementation will provide an
- * implementation specific default.
- *
- * @param devicename name of device to open
- * @return opened device, or null
- */
- native static ALCdevice alcOpenDevice(String devicename);
-
- /**
- * The <code>alcCloseDevice</code> function allows the application (i.e. the client program) to
- * disconnect from a device (i.e. the server).
- *
- * If deviceHandle is <code>null</code> or invalid, an <code>ALC_INVALID_DEVICE</code> error will be
- * generated. Once closed, a deviceHandle is invalid.
- *
- * @param device address of native device to close
- */
- native static void alcCloseDevice(long device);
-
- /**
- * A context is created using <code>alcCreateContext</code>. The device parameter has to be a valid
- * device. The attribute list can be <code>null</code>, or a zero terminated list of integer pairs
- * composed of valid ALC attribute tokens and requested values.
- *
- * Context creation will fail if the application requests attributes that, by themselves,
- * can not be provided. Context creation will fail if the combination of specified
- * attributes can not be provided. Context creation will fail if a specified attribute, or
- * the combination of attributes, does not match the default values for unspecified
- * attributes.
- *
- * @param device address of device to associate context to
- * @param attrList Buffer to read attributes from
- * @return New context, or null if creation failed
- */
- static ALCcontext alcCreateContext(long device, IntBuffer attrList) {
- ALCcontext result = nalcCreateContext(device, attrList);
- Util.checkALCError();
- return result;
- }
- private native static ALCcontext nalcCreateContext(long device, IntBuffer attrList);
-
- /**
- * To make a Context current with respect to AL Operation (state changes by issueing
- * commands), <code>alcMakeContextCurrent</code> is used. The context parameter can be <code>null</code>
- * or a valid context pointer. The operation will apply to the device that the context
- * was created for.
- *
- * For each OS process (usually this means for each application), only one context can
- * be current at any given time. All AL commands apply to the current context.
- * Commands that affect objects shared among contexts (e.g. buffers) have side effects
- * on other contexts.
- *
- * @param context address of context to make current
- * @return true if successfull, false if not
- */
- native static int alcMakeContextCurrent(long context);
-
- /**
- * The current context is the only context accessible to state changes by AL commands
- * (aside from state changes affecting shared objects). However, multiple contexts can
- * be processed at the same time. To indicate that a context should be processed (i.e.
- * that internal execution state like offset increments are supposed to be performed),
- * the application has to use <code>alcProcessContext</code>.
- *
- * Repeated calls to <code>alcProcessContext</code> are legal, and do not affect a context that is
- * already marked as processing. The default state of a context created by
- * alcCreateContext is that it is not marked as processing.
- */
- public static void alcProcessContext() {
- nalcProcessContext(AL.context.context);
- }
- private native static void nalcProcessContext(long context);
-
- /**
- * The application can query for, and obtain an handle to, the current context for the
- * application. If there is no current context, <code>null</code> is returned.
- *
- * @return Current ALCcontext
- */
- native static ALCcontext alcGetCurrentContext();
-
- /**
- * The application can query for, and obtain an handle to, the device of a given context.
- *
- * @param context address of context to get device for
- * @param ALCdevice associated with context
- */
- native static ALCdevice alcGetContextsDevice(long context);
-
- /**
- * The application can suspend any context from processing (including the current
- * one). To indicate that a context should be suspended from processing (i.e. that
- * internal execution state like offset increments is not supposed to be changed), the
- * application has to use <code>alcSuspendContext</code>.
- *
- * Repeated calls to <code>alcSuspendContext</code> are legal, and do not affect a context that is
- * already marked as suspended. The default state of a context created by
- * <code>alcCreateContext</code> is that it is marked as suspended.
- *
- * @param context address of context to suspend
- */
- public static void alcSuspendContext() {
- nalcSuspendContext(AL.context.context);
- }
- private native static void nalcSuspendContext(long context);
-
- /**
- * The correct way to destroy a context is to first release it using <code>alcMakeCurrent</code> and
- * <code>null</code>. Applications should not attempt to destroy a current context.
- *
- * @param context address of context to Destroy
- */
- native static void alcDestroyContext(long context);
-
- /**
- * ALC uses the same conventions and mechanisms as AL for error handling. In
- * particular, ALC does not use conventions derived from X11 (GLX) or Windows
- * (WGL). The <code>alcGetError</code> function can be used to query ALC errors.
- *
- * Error conditions are specific to the device.
- *
- * ALC_NO_ERROR - The device handle or specifier does name an accessible driver/server.
- * <code>ALC_INVALID_DEVICE</code> - The Context argument does not name a valid context.
- * <code>ALC_INVALID_CONTEXT</code> - The Context argument does not name a valid context.
- * <code>ALC_INVALID_ENUM</code> - A token used is not valid, or not applicable.
- * <code>ALC_INVALID_VALUE</code> - An value (e.g. attribute) is not valid, or not applicable.
- *
- * @return Errorcode from ALC statemachine
- */
- public static int alcGetError() {
- return nalcGetError(getDevice());
- }
- private native static int nalcGetError(long device);
-
- /**
- * Verify that a given extension is available for the current context and the device it
- * is associated with.
- * A <code>null</code> name argument returns <code>ALC_FALSE</code>, as do invalid and unsupported string
- * tokens.
- *
- * @param extName name of extension to find
- * @return true if extension is available, false if not
- */
- public static boolean alcIsExtensionPresent(String extName) {
- boolean result = nalcIsExtensionPresent(getDevice(), extName);
- Util.checkALCError();
- return result;
- }
- private native static boolean nalcIsExtensionPresent(long device, String extName);
-
- /**
- * Enumeration/token values are device independend, but tokens defined for
- * extensions might not be present for a given device. But only the tokens defined
- * by the AL core are guaranteed. Availability of extension tokens dependends on the ALC extension.
- *
- * Specifying a <code>null</code> name parameter will cause an <code>ALC_INVALID_VALUE</code> error.
- *
- * @param enumName name of enum to find
- * @return value of enumeration
- */
- public static int alcGetEnumValue(String enumName) {
- int result = nalcGetEnumValue(getDevice(), enumName);
- Util.checkALCError();
- return result;
- }
- private native static int nalcGetEnumValue(long device, String enumName);
-
- static native String[] ngetImplementations();
-}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2007-04-19 22:25:49
|
Revision: 2784
http://svn.sourceforge.net/java-game-lib/?rev=2784&view=rev
Author: matzon
Date: 2007-04-19 15:25:47 -0700 (Thu, 19 Apr 2007)
Log Message:
-----------
updated to ALC10 instead of ALC
Added Paths:
-----------
trunk/LWJGL/src/java/org/lwjgl/openal/ALC10.java
Added: trunk/LWJGL/src/java/org/lwjgl/openal/ALC10.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/openal/ALC10.java (rev 0)
+++ trunk/LWJGL/src/java/org/lwjgl/openal/ALC10.java 2007-04-19 22:25:47 UTC (rev 2784)
@@ -0,0 +1,415 @@
+/*
+ * Copyright (c) 2002-2004 LWJGL Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions 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 'LWJGL' nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.lwjgl.openal;
+
+import java.nio.Buffer;
+import java.nio.IntBuffer;
+
+import org.lwjgl.BufferChecks;
+import org.lwjgl.LWJGLException;
+
+/**
+ *
+ * <p>
+ * This is the context class for OpenAL. This class implements functions
+ * in alc.h
+ * </p>
+ *
+ * <p>
+ * ALC introduces the notion of a Device. A Device can be, depending on the
+ * implementation, a hardware device, or a daemon/OS service/actual server. This
+ * mechanism also permits different drivers (and hardware) to coexist within the same
+ * system, as well as allowing several applications to share system resources for audio,
+ * including a single hardware output device. The details are left to the
+ * implementation, which has to map the available backends to unique device
+ * specifiers (represented as strings).
+ * </p>
+ *
+ * <p>
+ * <b>NOTE:</b><br>
+ * The LWJGL implementation of OpenAL does not expose the device, nor the context.
+ * Whenever <code>AL</code> is created using the <code>create</code> method, an underlying
+ * device and context is created. Thus more advanced usage of multiple contexts and/or devices
+ * are not possible. The above mentioned features are very rarely used in games.
+ * </p>
+ *
+ * @author Brian Matzon <br...@ma...>
+ * @version $Revision: 2286 $
+ * $Id: ALC.java 2286 2006-03-23 19:32:21 +0000 (to, 23 mar 2006) matzon $
+ */
+public final class ALC10 {
+ /** Bad value */
+ public static final int ALC_INVALID = 0;
+
+ /** Boolean False */
+ public static final int ALC_FALSE = 0;
+
+ /** Boolean True */
+ public static final int ALC_TRUE = 1;
+
+ /** Errors: No Error */
+ public static final int ALC_NO_ERROR = ALC_FALSE;
+
+ /** Major version query. */
+ public static final int ALC_MAJOR_VERSION = 0x1000;
+
+ /** Minor version query. */
+ public static final int ALC_MINOR_VERSION = 0x1001;
+
+ /**
+ * The size required for the zero-terminated attributes list, for the current context.
+ **/
+ public static final int ALC_ATTRIBUTES_SIZE = 0x1002;
+
+ /**
+ * Expects a destination of ALC_CURRENT_ATTRIBUTES_SIZE,
+ * and provides the attribute list for the current context of the specified device.
+ */
+ public static final int ALC_ALL_ATTRIBUTES = 0x1003;
+
+ /** The specifier string for the default device */
+ public static final int ALC_DEFAULT_DEVICE_SPECIFIER = 0x1004;
+
+ /** The specifier string for the device */
+ public static final int ALC_DEVICE_SPECIFIER = 0x1005;
+
+ /** The extensions string for diagnostics and printing */
+ public static final int ALC_EXTENSIONS = 0x1006;
+
+ /** Frequency for mixing output buffer, in units of Hz. */
+ public static final int ALC_FREQUENCY = 0x1007;
+
+ /** Refresh intervalls, in units of Hz. */
+ public static final int ALC_REFRESH = 0x1008;
+
+ /** Flag, indicating a synchronous context. */
+ public static final int ALC_SYNC = 0x1009;
+
+ /** The device argument does not name a valid device */
+ public static final int ALC_INVALID_DEVICE = 0xA001;
+
+ /** The context argument does not name a valid context */
+ public static final int ALC_INVALID_CONTEXT = 0xA002;
+
+ /**
+ * A function was called at inappropriate time, or in an inappropriate way,
+ * causing an illegal state. This can be an incompatible ALenum, object ID,
+ * and/or function.
+ */
+ public static final int ALC_INVALID_ENUM = 0xA003;
+
+ /**
+ * Illegal value passed as an argument to an AL call.
+ * Applies to parameter values, but not to enumerations.
+ */
+ public static final int ALC_INVALID_VALUE = 0xA004;
+
+ /**
+ * A function could not be completed, because there is not enough
+ * memory available.
+ */
+ public static final int ALC_OUT_OF_MEMORY = 0xA005;
+
+ static native void initNativeStubs() throws LWJGLException;
+
+ /**
+ * The application can obtain certain strings from ALC.
+ *
+ * <code>ALC_DEFAULT_DEVICE_SPECIFIER</code> - The specifer string for the default device
+ * <code>ALC_DEVICE_SPECIFIER</code> - The specifer string for the device
+ * <code>ALC_EXTENSIONS</code> - The extensions string for diagnostics and printing.
+ *
+ * In addition, printable error message strings are provided for all valid error tokens,
+ * including <code>ALC_NO_ERROR</code>,<code>ALC_INVALID_DEVICE</code>, <code>ALC_INVALID_CONTEXT</code>,
+ * <code>ALC_INVALID_ENUM</code>, <code>ALC_INVALID_VALUE</code>.
+ *
+ * @param pname Property to get
+ * @return String property from device
+ */
+ public static String alcGetString(ALCdevice device, int pname) {
+ String result;
+ result = nalcGetString(getDevice(device), pname);
+ //Util.checkALCError();
+ return result;
+ }
+ private native static String nalcGetString(long device, int pname);
+
+ /**
+ * The application can query ALC for information using an integer query function.
+ * For some tokens, <code>null</code> is a legal deviceHandle. In other cases, specifying a <code>null</code>
+ * device will generate an <code>ALC_INVALID_DEVICE</code> error. The application has to
+ * specify the size of the destination buffer provided. A <code>null</code> destination or a zero
+ * size parameter will cause ALC to ignore the query.
+ *
+ * <code>ALC_MAJOR_VERSION</code> - Major version query.
+ * <code>ALC_MINOR_VERSION</code> - Minor version query.
+ * <code>ALC_ATTRIBUTES_SIZE</code> - The size required for the zero-terminated attributes list,
+ * for the current context. <code>null</code> is an invalid device. <code>null</code> (no current context
+ * for the specified device) is legal.
+ * <code>ALC_ALL_ATTRIBUTES</code> - Expects a destination of <code>ALC_CURRENT_ATTRIBUTES_SIZE</code>,
+ * and provides the attribute list for the current context of the specified device.
+ * <code>null</code> is an invalid device. <code>null</code> (no current context for the specified device)
+ * will return the default attributes defined by the specified device.
+ *
+ * @param pname Property to get
+ * @param integerdata ByteBuffer to write integers to
+ */
+ public static void alcGetInteger(ALCdevice device, int pname, IntBuffer integerdata) {
+ BufferChecks.checkDirect(integerdata);
+ nalcGetIntegerv(getDevice(device), pname, integerdata.remaining(), integerdata, integerdata.position());
+ Util.checkALCError();
+ }
+ private native static void nalcGetIntegerv(long device, int pname, int size, Buffer integerdata, int offset);
+
+ /**
+ * The <code>alcOpenDevice</code> function allows the application (i.e. the client program) to
+ * connect to a device (i.e. the server).
+ *
+ * If the function returns <code>null</code>, then no sound driver/device has been found. The
+ * argument is a null terminated string that requests a certain device or device
+ * configuration. If <code>null</code> is specified, the implementation will provide an
+ * implementation specific default.
+ *
+ * @param devicename name of device to open
+ * @return opened device, or null
+ */
+ public static ALCdevice alcOpenDevice(String devicename) {
+ long device = nalcOpenDevice(devicename);
+ if(device > 0) {
+ return new ALCdevice(device);
+ }
+ return null;
+ }
+ native static long nalcOpenDevice(String devicename);
+
+ /**
+ * The <code>alcCloseDevice</code> function allows the application (i.e. the client program) to
+ * disconnect from a device (i.e. the server).
+ *
+ * If deviceHandle is <code>null</code> or invalid, an <code>ALC_INVALID_DEVICE</code> error will be
+ * generated. Once closed, a deviceHandle is invalid.
+ *
+ * @param device address of native device to close
+ */
+ public static boolean alcCloseDevice(ALCdevice device) {
+ return nalcCloseDevice(getDevice(device));
+ }
+ native static boolean nalcCloseDevice(long device);
+
+ /**
+ * A context is created using <code>alcCreateContext</code>. The device parameter has to be a valid
+ * device. The attribute list can be <code>null</code>, or a zero terminated list of integer pairs
+ * composed of valid ALC attribute tokens and requested values.
+ *
+ * Context creation will fail if the application requests attributes that, by themselves,
+ * can not be provided. Context creation will fail if the combination of specified
+ * attributes can not be provided. Context creation will fail if a specified attribute, or
+ * the combination of attributes, does not match the default values for unspecified
+ * attributes.
+ *
+ * @param device address of device to associate context to
+ * @param attrList Buffer to read attributes from
+ * @return New context, or null if creation failed
+ */
+ public static ALCcontext alcCreateContext(ALCdevice device, IntBuffer attrList) {
+ long context = nalcCreateContext(getDevice(device), attrList);
+ Util.checkALCError();
+
+ if(context > 0) {
+ return new ALCcontext(context);
+ }
+
+ return null;
+ }
+ private native static long nalcCreateContext(long device, IntBuffer attrList);
+
+ /**
+ * To make a Context current with respect to AL Operation (state changes by issueing
+ * commands), <code>alcMakeContextCurrent</code> is used. The context parameter can be <code>null</code>
+ * or a valid context pointer. The operation will apply to the device that the context
+ * was created for.
+ *
+ * For each OS process (usually this means for each application), only one context can
+ * be current at any given time. All AL commands apply to the current context.
+ * Commands that affect objects shared among contexts (e.g. buffers) have side effects
+ * on other contexts.
+ *
+ * @param context address of context to make current
+ * @return true if successfull, false if not
+ */
+ public static int alcMakeContextCurrent(ALCcontext context) {
+ return nalcMakeContextCurrent(getContext(context));
+ }
+ public native static int nalcMakeContextCurrent(long context);
+
+ /**
+ * The current context is the only context accessible to state changes by AL commands
+ * (aside from state changes affecting shared objects). However, multiple contexts can
+ * be processed at the same time. To indicate that a context should be processed (i.e.
+ * that internal execution state like offset increments are supposed to be performed),
+ * the application has to use <code>alcProcessContext</code>.
+ *
+ * Repeated calls to <code>alcProcessContext</code> are legal, and do not affect a context that is
+ * already marked as processing. The default state of a context created by
+ * alcCreateContext is that it is not marked as processing.
+ */
+ public static void alcProcessContext(ALCcontext context) {
+ nalcProcessContext(getContext(context));
+ }
+ private native static void nalcProcessContext(long context);
+
+ /**
+ * The application can query for, and obtain an handle to, the current context for the
+ * application. If there is no current context, <code>null</code> is returned.
+ *
+ * @return Current ALCcontext
+ */
+ public static ALCcontext alcGetCurrentContext() {
+ long context = nalcGetCurrentContext();
+ if(context > 0) {
+ return new ALCcontext(context);
+ }
+ return null;
+ }
+ public native static long nalcGetCurrentContext();
+
+ /**
+ * The application can query for, and obtain an handle to, the device of a given context.
+ *
+ * @param context address of context to get device for
+ * @param ALCdevice associated with context
+ */
+ public static ALCdevice alcGetContextsDevice(ALCcontext context) {
+ long device = nalcGetContextsDevice(getContext(context));
+ if (device > 0) {
+ return new ALCdevice(device);
+ }
+ return null;
+ }
+ private native static long nalcGetContextsDevice(long context);
+
+ /**
+ * The application can suspend any context from processing (including the current
+ * one). To indicate that a context should be suspended from processing (i.e. that
+ * internal execution state like offset increments is not supposed to be changed), the
+ * application has to use <code>alcSuspendContext</code>.
+ *
+ * Repeated calls to <code>alcSuspendContext</code> are legal, and do not affect a context that is
+ * already marked as suspended. The default state of a context created by
+ * <code>alcCreateContext</code> is that it is marked as suspended.
+ *
+ * @param context address of context to suspend
+ */
+ public static void alcSuspendContext(ALCcontext context) {
+ nalcSuspendContext(getContext(context));
+ }
+ private native static void nalcSuspendContext(long context);
+
+ /**
+ * The correct way to destroy a context is to first release it using <code>alcMakeCurrent</code> and
+ * <code>null</code>. Applications should not attempt to destroy a current context.
+ *
+ * @param context address of context to Destroy
+ */
+ public static void alcDestroyContext(ALCcontext context) {
+ nalcDestroyContext(getContext(context));
+ }
+ native static void nalcDestroyContext(long context);
+
+ /**
+ * ALC uses the same conventions and mechanisms as AL for error handling. In
+ * particular, ALC does not use conventions derived from X11 (GLX) or Windows
+ * (WGL). The <code>alcGetError</code> function can be used to query ALC errors.
+ *
+ * Error conditions are specific to the device.
+ *
+ * ALC_NO_ERROR - The device handle or specifier does name an accessible driver/server.
+ * <code>ALC_INVALID_DEVICE</code> - The Context argument does not name a valid context.
+ * <code>ALC_INVALID_CONTEXT</code> - The Context argument does not name a valid context.
+ * <code>ALC_INVALID_ENUM</code> - A token used is not valid, or not applicable.
+ * <code>ALC_INVALID_VALUE</code> - An value (e.g. attribute) is not valid, or not applicable.
+ *
+ * @return Errorcode from ALC statemachine
+ */
+ public static int alcGetError(ALCdevice device) {
+ return nalcGetError(getDevice(device));
+ }
+ private native static int nalcGetError(long device);
+
+ /**
+ * Verify that a given extension is available for the current context and the device it
+ * is associated with.
+ * A <code>null</code> name argument returns <code>ALC_FALSE</code>, as do invalid and unsupported string
+ * tokens.
+ *
+ * @param extName name of extension to find
+ * @return true if extension is available, false if not
+ */
+ public static boolean alcIsExtensionPresent(ALCdevice device, String extName) {
+ boolean result = nalcIsExtensionPresent(getDevice(device), extName);
+ Util.checkALCError();
+ return result;
+ }
+ private native static boolean nalcIsExtensionPresent(long device, String extName);
+
+ /**
+ * Enumeration/token values are device independend, but tokens defined for
+ * extensions might not be present for a given device. But only the tokens defined
+ * by the AL core are guaranteed. Availability of extension tokens dependends on the ALC extension.
+ *
+ * Specifying a <code>null</code> name parameter will cause an <code>ALC_INVALID_VALUE</code> error.
+ *
+ * @param enumName name of enum to find
+ * @return value of enumeration
+ */
+ public static int alcGetEnumValue(ALCdevice device, String enumName) {
+ int result = nalcGetEnumValue(getDevice(device), enumName);
+ Util.checkALCError();
+ return result;
+ }
+ private native static int nalcGetEnumValue(long device, String enumName);
+
+ static long getDevice(ALCdevice device) {
+ if(device != null) {
+ return device.device;
+ }
+ return 0L;
+ }
+
+ static long getContext(ALCcontext context) {
+ if(context != null) {
+ return context.context;
+ }
+ return 0L;
+ }
+
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2007-04-19 22:25:14
|
Revision: 2783
http://svn.sourceforge.net/java-game-lib/?rev=2783&view=rev
Author: matzon
Date: 2007-04-19 15:25:13 -0700 (Thu, 19 Apr 2007)
Log Message:
-----------
openal 1.1
Added Paths:
-----------
trunk/LWJGL/src/java/org/lwjgl/openal/ALC11.java
Added: trunk/LWJGL/src/java/org/lwjgl/openal/ALC11.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/openal/ALC11.java (rev 0)
+++ trunk/LWJGL/src/java/org/lwjgl/openal/ALC11.java 2007-04-19 22:25:13 UTC (rev 2783)
@@ -0,0 +1,180 @@
+/*
+ * Copyright (c) 2002-2004 LWJGL Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions 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 'LWJGL' nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.lwjgl.openal;
+
+import java.nio.ByteBuffer;
+import java.nio.IntBuffer;
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.LWJGLException;
+import org.lwjgl.LWJGLUtil;
+
+
+/**
+ *
+ * @author Brian Matzon <br...@ma...>
+ * @version $Revision: 2286 $
+ * $Id: ALC.java 2286 2006-03-23 19:32:21 +0000 (to, 23 mar 2006) matzon $
+ */
+public final class ALC11 {
+
+ public static int ALC_CAPTURE_DEVICE_SPECIFIER = 0x310;
+ public static int ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER = 0x311;
+ public static int ALC_CAPTURE_SAMPLES = 0x312;
+
+ /**
+ * The alcCaptureOpenDevice function allows the application to connect to a capture
+ * device. To obtain a list of all available capture devices, use getCaptureDevices a list of all
+ * capture devices will be returned. Retrieving ALC_CAPTURE_DEVICE_SPECIFIER with a valid capture device specified will result
+ * in the name of that device being returned as a single string.
+ *
+ * If the function returns null, then no sound driver/device has been found, or the
+ * requested format could not be fulfilled.
+ * The "deviceName" argument is a string that requests a certain device or
+ * device configuration. If null is specified, the implementation will provide an
+ * implementation specific default. The "frequency" and "format" arguments specify the format that
+ * audio data will be presented to the application, and match the values that can be passed to
+ * alBufferData. The implementation is expected to convert and resample to this format on
+ * behalf of the application. The "buffersize" argument specifies the number of sample frames
+ * to buffer in the AL, for example, requesting a format of AL_FORMAT_STEREO16 and
+ * a buffer size of 1024 would require the AL to store up to 1024 * 4 bytes of audio data.
+ * Note that the implementation may use a larger buffer than requested if it needs to, but the
+ * implementation will set up a buffer of at least the requested size.
+ * Specifying a compressed or extension-supplied format may result in failure, even if the
+ * extension is supplied for rendering.
+ *
+ * <i>LWJGL SPECIFIC: the actual created device is managed internally in lwjgl</i>
+ *
+ * @param devicename Name of device to open for capture
+ * @param frequency Frequency of samples to capture
+ * @param format Format of samples to capture
+ * @param buffersize Size of buffer to capture to
+ * @return ALCdevice if it was possible to open a device
+ */
+ public static ALCdevice alcCaptureOpenDevice(String devicename, int frequency, int format, int buffersize) {
+ long device = nalcCaptureOpenDevice(devicename, frequency, format, buffersize);
+ if(device > 0) {
+ System.out.println("new device: " + device + "/" + devicename);
+ return new ALCdevice(device);
+ }
+ return null;
+ }
+ static native long nalcCaptureOpenDevice( String devicename, int frequency, int format, int buffersize);
+
+ /**
+ * The alcCaptureCloseDevice function allows the application to disconnect from a capture
+ * device.
+ *
+ * The return code will be true or false, indicating success or failure. If
+ * the device is null or invalid, an ALC_INVALID_DEVICE error will be generated.
+ * Once closed, a capture device is invalid.
+ * @return true if device was successfully closed
+ */
+ public static boolean alcCaptureCloseDevice(ALCdevice device) {
+ return nalcCaptureCloseDevice(ALC10.getDevice(device));
+ }
+ static native boolean nalcCaptureCloseDevice(long device);
+
+ /**
+ * Once a capture device has been opened via alcCaptureOpenDevice, it is made to start
+ * recording audio via the alcCaptureStart entry point:
+ *
+ * Once started, the device will record audio to an internal ring buffer, the size of which was
+ * specified when opening the device.
+ * The application may query the capture device to discover how much data is currently
+ * available via the alcGetInteger with the ALC_CAPTURE_SAMPLES token. This will
+ * report the number of sample frames currently available.
+ */
+ public static void alcCaptureStart(ALCdevice device) {
+ nalcCaptureStart(ALC10.getDevice(device));
+ }
+ static native void nalcCaptureStart(long device);
+
+ /**
+ * If the application doesn't need to capture more audio for an amount of time, they can halt
+ * the device without closing it via the alcCaptureStop entry point.
+ * The implementation is encouraged to optimize for this case. The amount of audio
+ * samples available after restarting a stopped capture device is reset to zero. The
+ * application does not need to stop the capture device to read from it.
+ */
+ public static void alcCaptureStop(ALCdevice device) {
+ nalcCaptureStop(ALC10.getDevice(device));
+ }
+ static native void nalcCaptureStop(long device);
+
+ /**
+ * When the application feels there are enough samples available to process, it can obtain
+ * them from the AL via the alcCaptureSamples entry point.
+ *
+ * The "buffer" argument specifies an application-allocated buffer that can contain at least
+ * "samples" sample frames. The implementation may defer conversion and resampling until
+ * this point. Requesting more sample frames than are currently available is an error.
+ *
+ * @param buffer Buffer to store samples in
+ * @param samples Number of samples to request
+ */
+ public static void alcCaptureSamples(ALCdevice device, ByteBuffer buffer, int samples ) {
+ nalcCaptureSamples(ALC10.getDevice(device), buffer, buffer.position(), samples);
+ }
+ static native void nalcCaptureSamples(long device, ByteBuffer buffer, int position, int samples );
+
+ static native void initNativeStubs() throws LWJGLException;
+
+ /**
+ * Initializes ALC11, including any extensions
+ * @return true if initialization was successfull
+ */
+ static boolean initialize() {
+ try {
+ IntBuffer ib = BufferUtils.createIntBuffer(2);
+ ALC10.alcGetInteger(AL.getDevice(), ALC10.ALC_MAJOR_VERSION, ib);
+ ib.position(1);
+ ALC10.alcGetInteger(AL.getDevice(), ALC10.ALC_MINOR_VERSION, ib);
+
+ int major = ib.get(0);
+ int minor = ib.get(1);
+
+ // checking for version 1.x+
+ if(major >= 1) {
+
+ // checking for version 1.1+
+ if(minor >= 1) {
+ initNativeStubs();
+ }
+ }
+ } catch (LWJGLException le) {
+ LWJGLUtil.log("failed to initialize ALC11: " + le);
+ return false;
+ }
+ return true;
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2007-04-19 22:24:38
|
Revision: 2782
http://svn.sourceforge.net/java-game-lib/?rev=2782&view=rev
Author: matzon
Date: 2007-04-19 15:24:36 -0700 (Thu, 19 Apr 2007)
Log Message:
-----------
exposing context and device
updated to ALC10 instead of ALC
removed getImplementations - alcGetString now works as "expected"
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/openal/AL.java
Modified: trunk/LWJGL/src/java/org/lwjgl/openal/AL.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/openal/AL.java 2007-04-19 22:23:40 UTC (rev 2781)
+++ trunk/LWJGL/src/java/org/lwjgl/openal/AL.java 2007-04-19 22:24:36 UTC (rev 2782)
@@ -156,26 +156,28 @@
private static void init(String deviceArguments, int contextFrequency, int contextRefresh, boolean contextSynchronized, boolean openDevice) throws LWJGLException {
try {
AL10.initNativeStubs();
- ALC.initNativeStubs();
-
+ ALC10.initNativeStubs();
+
if(openDevice) {
- device = ALC.alcOpenDevice(deviceArguments);
+ device = ALC10.alcOpenDevice(deviceArguments);
if (device == null)
throw new LWJGLException("Could not open ALC device");
if (contextFrequency == -1) {
- context = ALC.alcCreateContext(device.device, null);
+ context = ALC10.alcCreateContext(device, null);
} else {
- context = ALC.alcCreateContext(device.device,
+ context = ALC10.alcCreateContext(device,
ALCcontext.createAttributeList(contextFrequency, contextRefresh,
- contextSynchronized ? ALC.ALC_TRUE : ALC.ALC_FALSE));
+ contextSynchronized ? ALC10.ALC_TRUE : ALC10.ALC_FALSE));
}
- ALC.alcMakeContextCurrent(context.context);
+ ALC10.alcMakeContextCurrent(context);
}
} catch (LWJGLException e) {
destroy();
throw e;
}
+
+ ALC11.initialize();
}
/**
@@ -194,15 +196,16 @@
*/
public static void destroy() {
if (context != null) {
- ALC.alcDestroyContext(context.context);
+ ALC10.alcDestroyContext(context);
context = null;
}
if (device != null) {
- ALC.alcCloseDevice(device.device);
+ boolean result = ALC10.alcCloseDevice(device);
device = null;
}
resetNativeStubs(AL10.class);
- resetNativeStubs(ALC.class);
+ resetNativeStubs(ALC10.class);
+ resetNativeStubs(ALC11.class);
if (created)
nDestroy();
@@ -212,50 +215,16 @@
private static native void resetNativeStubs(Class clazz);
/**
- * Gets a handle to the current openAL context. The handle is "opaque" right now
- * because, realistically, there is nothing you can actually do with it. If it turns
- * out that there are useful things you can do with it then it'll return an instance
- * of ALCcontext (which will have to become a public class)
- * @return an opaque handle to the AL context.
+ * @return handle to the default AL context.
*/
- public static Object getContext() {
+ public static ALCcontext getContext() {
return context;
}
-
+
/**
- *
- * @return
+ * @return handle to the default AL device.
*/
- public static String[] getImplementations() throws LWJGLException, OpenALException {
- if(AL.isCreated()) {
- throw new OpenALException("Cannot enumerate devices if AL has already been created");
- }
-
- Vector availableDevices = new Vector();
-
- try {
- // init
- create(null, 44100, 60, false, false);
-
- // check for extension
- if(!ALC.alcIsExtensionPresent("ALC_ENUMERATION_EXT")) {
- throw new OpenALException("ALC_ENUMERATION_EXT extension not available");
- }
-
- // get list of published devices
- String[] publishedDevices = ALC.ngetImplementations();
-
- // run through them and verify
- for (int i = 0; i < publishedDevices.length; i++) {
- availableDevices.add(publishedDevices[i]);
- }
- } finally {
- destroy();
- }
-
- String[] available = new String[availableDevices.size()];
- availableDevices.copyInto(available);
-
- return available;
+ public static ALCdevice getDevice() {
+ return device;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2007-04-19 22:23:41
|
Revision: 2781
http://svn.sourceforge.net/java-game-lib/?rev=2781&view=rev
Author: matzon
Date: 2007-04-19 15:23:40 -0700 (Thu, 19 Apr 2007)
Log Message:
-----------
updated to ALC10 instead of ALC
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/openal/Util.java
Modified: trunk/LWJGL/src/java/org/lwjgl/openal/Util.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/openal/Util.java 2007-04-19 22:23:20 UTC (rev 2780)
+++ trunk/LWJGL/src/java/org/lwjgl/openal/Util.java 2007-04-19 22:23:40 UTC (rev 2781)
@@ -45,9 +45,9 @@
}
public static void checkALCError() {
- int err = ALC.alcGetError();
- if (err != ALC.ALC_NO_ERROR)
- throw new OpenALException(ALC.alcGetString(err));
+ int err = ALC10.alcGetError(AL.getDevice());
+ if (err != ALC10.ALC_NO_ERROR)
+ throw new OpenALException(ALC10.alcGetString(AL.getDevice(), err));
}
public static void checkALError() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2007-04-19 22:23:34
|
Revision: 2780
http://svn.sourceforge.net/java-game-lib/?rev=2780&view=rev
Author: matzon
Date: 2007-04-19 15:23:20 -0700 (Thu, 19 Apr 2007)
Log Message:
-----------
exposing context and device
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/openal/ALCcontext.java
trunk/LWJGL/src/java/org/lwjgl/openal/ALCdevice.java
Modified: trunk/LWJGL/src/java/org/lwjgl/openal/ALCcontext.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/openal/ALCcontext.java 2007-04-19 22:23:04 UTC (rev 2779)
+++ trunk/LWJGL/src/java/org/lwjgl/openal/ALCcontext.java 2007-04-19 22:23:20 UTC (rev 2780)
@@ -43,7 +43,7 @@
* @version $Revision$
* $Id$
*/
-final class ALCcontext {
+public final class ALCcontext {
/** address of actual context */
final long context;
@@ -57,14 +57,31 @@
this.context = context;
}
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ public boolean equals(Object context) {
+ if(context instanceof ALCcontext) {
+ return ((ALCcontext)context).context == this.context;
+ }
+ return super.equals(context);
+ }
+
+ /**
+ * Creates an attribute list in a ByteBuffer
+ * @param contextFrequency Frequency to add
+ * @param contextRefresh Refresh rate to add
+ * @param contextSynchronized Whether to synchronize the context
+ * @return
+ */
static IntBuffer createAttributeList(int contextFrequency, int contextRefresh, int contextSynchronized) {
IntBuffer attribList = BufferUtils.createIntBuffer(7);
- attribList.put(ALC.ALC_FREQUENCY);
+ attribList.put(ALC10.ALC_FREQUENCY);
attribList.put(contextFrequency);
- attribList.put(ALC.ALC_REFRESH);
+ attribList.put(ALC10.ALC_REFRESH);
attribList.put(contextRefresh);
- attribList.put(ALC.ALC_SYNC);
+ attribList.put(ALC10.ALC_SYNC);
attribList.put(contextSynchronized);
attribList.put(0); //terminating int
Modified: trunk/LWJGL/src/java/org/lwjgl/openal/ALCdevice.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/openal/ALCdevice.java 2007-04-19 22:23:04 UTC (rev 2779)
+++ trunk/LWJGL/src/java/org/lwjgl/openal/ALCdevice.java 2007-04-19 22:23:20 UTC (rev 2780)
@@ -39,7 +39,7 @@
* @version $Revision$
* $Id$
*/
-final class ALCdevice {
+public final class ALCdevice {
/** address of actual device */
final long device;
@@ -51,5 +51,15 @@
*/
ALCdevice(long device) {
this.device = device;
- }
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ public boolean equals(Object device) {
+ if(device instanceof ALCdevice) {
+ return ((ALCdevice)device).device == this.device;
+ }
+ return super.equals(device);
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2007-04-19 22:23:06
|
Revision: 2779
http://svn.sourceforge.net/java-game-lib/?rev=2779&view=rev
Author: matzon
Date: 2007-04-19 15:23:04 -0700 (Thu, 19 Apr 2007)
Log Message:
-----------
updated to ALC10 instead of ALC
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/test/openal/ALCTest.java
trunk/LWJGL/src/java/org/lwjgl/test/openal/BasicTest.java
Modified: trunk/LWJGL/src/java/org/lwjgl/test/openal/ALCTest.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/test/openal/ALCTest.java 2007-04-19 22:22:18 UTC (rev 2778)
+++ trunk/LWJGL/src/java/org/lwjgl/test/openal/ALCTest.java 2007-04-19 22:23:04 UTC (rev 2779)
@@ -34,7 +34,8 @@
import java.nio.IntBuffer;
import org.lwjgl.BufferUtils;
-import org.lwjgl.openal.ALC;
+import org.lwjgl.openal.AL;
+import org.lwjgl.openal.ALC10;
/**
*
@@ -58,29 +59,29 @@
*/
protected void execute(String[] args) {
//error stuff
- int lastError = ALC.ALC_NO_ERROR;
+ int lastError = ALC10.ALC_NO_ERROR;
//create attribute list for context creation
IntBuffer buffer = BufferUtils.createIntBuffer(7);
- if ((lastError = ALC.alcGetError()) != ALC.ALC_NO_ERROR) {
- System.out.println("ALC Error: " + ALC.alcGetString(lastError));
+ if ((lastError = ALC10.alcGetError(AL.getDevice())) != ALC10.ALC_NO_ERROR) {
+ System.out.println("ALC Error: " + ALC10.alcGetString(AL.getDevice(), lastError));
System.exit(-1);
}
//query
System.out.println(
"DEFAULT_DEVICE_SPECIFIER: "
- + ALC.alcGetString(ALC.ALC_DEFAULT_DEVICE_SPECIFIER));
+ + ALC10.alcGetString(AL.getDevice(), ALC10.ALC_DEFAULT_DEVICE_SPECIFIER));
System.out.println(
- "DEVICE_SPECIFIER: " + ALC.alcGetString(ALC.ALC_DEVICE_SPECIFIER));
- System.out.println("EXTENSIONS: " + ALC.alcGetString(ALC.ALC_EXTENSIONS));
+ "DEVICE_SPECIFIER: " + ALC10.alcGetString(AL.getDevice(), ALC10.ALC_DEVICE_SPECIFIER));
+ System.out.println("EXTENSIONS: " + ALC10.alcGetString(AL.getDevice(), ALC10.ALC_EXTENSIONS));
//mo query
buffer.rewind();
buffer.position(0);
- ALC.alcGetInteger(ALC.ALC_MAJOR_VERSION, buffer);
- ALC.alcGetInteger(ALC.ALC_MINOR_VERSION, (IntBuffer) buffer.position(1));
+ ALC10.alcGetInteger(AL.getDevice(), ALC10.ALC_MAJOR_VERSION, buffer);
+ ALC10.alcGetInteger(AL.getDevice(), ALC10.ALC_MINOR_VERSION, (IntBuffer) buffer.position(1));
System.out.println("ALC_MAJOR_VERSION: " + buffer.get(0));
System.out.println("ALC_MINOR_VERSION: " + buffer.get(1));
@@ -91,7 +92,7 @@
//get an enumerstion value
System.out.println(
"Value of ALC_MAJOR_VERSION: "
- + ALC.alcGetEnumValue("ALC_MAJOR_VERSION"));
+ + ALC10.alcGetEnumValue(AL.getDevice(), "ALC_MAJOR_VERSION"));
alExit();
}
Modified: trunk/LWJGL/src/java/org/lwjgl/test/openal/BasicTest.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/test/openal/BasicTest.java 2007-04-19 22:22:18 UTC (rev 2778)
+++ trunk/LWJGL/src/java/org/lwjgl/test/openal/BasicTest.java 2007-04-19 22:23:04 UTC (rev 2779)
@@ -36,6 +36,7 @@
import org.lwjgl.BufferUtils;
import org.lwjgl.openal.AL;
import org.lwjgl.openal.AL10;
+import org.lwjgl.openal.ALC10;
import org.lwjgl.opengl.DisplayMode;
/**
@@ -53,23 +54,21 @@
*/
public BasicTest() {
try {
- String[] imps = AL.getImplementations();
- if(imps.length > 0) {
- System.out.println("Available devices: ");
- for(int i=0; i<imps.length; i++) {
- System.out.println(" " + i + ": " + imps[i]);
- }
- }
+ AL.create();
+
+ System.out.println("Default device: " + ALC10.alcGetString(null, ALC10.ALC_DEFAULT_DEVICE_SPECIFIER));
+
+ if(ALC10.alcIsExtensionPresent(null, "ALC_ENUMERATION_EXT")) {
+ String[] devices = ALC10.alcGetString(null, ALC10.ALC_DEVICE_SPECIFIER).split("\0");
+ System.out.println("Available devices: ");
+ for(int i=0; i<devices.length; i++) {
+ System.out.println(i +": " + devices[i]);
+ }
+ }
} catch (Exception e) {
- System.out.println("Unable to query available devices: " + e.getMessage());
+ System.out.println("Unable to create OpenAL.\nPlease make sure that OpenAL is available on this system. Exception: " + e);
+ return;
}
-
- try {
- AL.create();
- } catch (Exception e) {
- System.out.println("Unable to create OpenAL.\nPlease make sure that OpenAL is available on this system. Exception: " + e);
- return;
- }
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2007-04-19 22:22:25
|
Revision: 2778
http://svn.sourceforge.net/java-game-lib/?rev=2778&view=rev
Author: matzon
Date: 2007-04-19 15:22:18 -0700 (Thu, 19 Apr 2007)
Log Message:
-----------
Capture test for OpenAL 1.1
Added Paths:
-----------
trunk/LWJGL/src/java/org/lwjgl/test/openal/ALCCaptureTest.java
Added: trunk/LWJGL/src/java/org/lwjgl/test/openal/ALCCaptureTest.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/test/openal/ALCCaptureTest.java (rev 0)
+++ trunk/LWJGL/src/java/org/lwjgl/test/openal/ALCCaptureTest.java 2007-04-19 22:22:18 UTC (rev 2778)
@@ -0,0 +1,154 @@
+/*
+ * Copyright (c) 2002-2004 LWJGL Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions 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 'LWJGL' nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.lwjgl.test.openal;
+
+import java.nio.ByteBuffer;
+import java.nio.IntBuffer;
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.openal.AL;
+import org.lwjgl.openal.AL10;
+import org.lwjgl.openal.ALC10;
+import org.lwjgl.openal.ALC11;
+import org.lwjgl.openal.ALCdevice;
+import org.lwjgl.openal.OpenALException;
+
+/**
+ *
+ * This is a test for the ALC part of OpenAL
+ *
+ * @author Brian Matzon <br...@ma...>
+ * @version $Revision: 2286 $
+ * $Id: ALCTest.java 2286 2006-03-23 19:32:21Z matzon $
+ */
+public class ALCCaptureTest extends BasicTest {
+
+ /**
+ * Creates an instance of ALCTest
+ */
+ public ALCCaptureTest() {
+ super();
+ }
+
+ /**
+ * Runs the actual test, using supplied arguments
+ */
+ protected void execute(String[] args) {
+ int lastError = ALC10.ALC_NO_ERROR;
+ IntBuffer sampleCount = BufferUtils.createIntBuffer(1);
+
+ int state = AL10.AL_PLAYING;
+ int FMT = AL10.AL_FORMAT_MONO16;
+ int FMTSIZE = 16/8;
+ int FREQ = 44100;
+ int TIME = 5;
+ int SAMPS = (FREQ * TIME);
+ ByteBuffer buf = BufferUtils.createByteBuffer(SAMPS * FMTSIZE);
+
+ // check that capture is available
+ if(!ALC10.alcIsExtensionPresent(AL.getDevice(), "ALC_EXT_CAPTURE")) {
+ throw new OpenALException("ALC_EXT_CAPTURE extension not available");
+ }
+
+ // get list of devices
+ String captureDevices = ALC10.alcGetString(null, ALC11.ALC_CAPTURE_DEVICE_SPECIFIER);
+ System.out.println("captureDevices: " + captureDevices);
+
+
+ String defaultRecorder = ALC10.alcGetString(AL.getDevice(), ALC11.ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER);
+ System.out.println("Default capture device: " + defaultRecorder);
+
+ ALCdevice device = ALC11.alcCaptureOpenDevice(null, FREQ, FMT, SAMPS);
+
+
+
+ if(device != null) {
+ // record some sound
+ // =====================================
+ System.out.print("Recording using " + ALC10.alcGetString(device, ALC11.ALC_CAPTURE_DEVICE_SPECIFIER) + "...");
+ ALC11.alcCaptureStart(device);
+ while (sampleCount.get(0) < SAMPS) {
+ pause(1000);
+ ALC10.alcGetInteger(device, ALC11.ALC_CAPTURE_SAMPLES, sampleCount);
+ }
+ System.out.println("done");
+ ALC11.alcCaptureStop(device);
+
+ // capure the samples
+ ALC11.alcCaptureSamples(device, buf, SAMPS);
+ ALC11.alcCaptureCloseDevice(device);
+ // -------------------------------------
+
+ // play back recording
+ // ===================
+ IntBuffer buffers = BufferUtils.createIntBuffer(1);
+ IntBuffer sources = BufferUtils.createIntBuffer(1);
+
+ buffers.position(0).limit(1);
+ AL10.alGenBuffers(buffers);
+
+ sources.position(0).limit(1);
+ AL10.alGenSources(sources);
+
+ System.out.print("Playing...");
+
+ AL10.alBufferData(buffers.get(0), FMT, buf, FREQ);
+ AL10.alSourcei(sources.get(0), AL10.AL_BUFFER, buffers.get(0));
+ AL10.alSourcei(sources.get(0), AL10.AL_LOOPING, AL10.AL_FALSE);
+ AL10.alSourcePlay(sources.get(0));
+
+ while (state == AL10.AL_PLAYING)
+ {
+ pause(100);
+ state = AL10.alGetSourcei(sources.get(0), AL10.AL_SOURCE_STATE);
+ }
+
+ System.out.println("done");
+
+ AL10.alDeleteSources(sources);
+ AL10.alDeleteBuffers(buffers);
+ }
+
+ alExit();
+ }
+
+ /**
+ * main entry point
+ *
+ * @param args String array containing arguments
+ */
+ public static void main(String[] args) {
+ ALCCaptureTest alcTest = new ALCCaptureTest();
+ alcTest.execute(args);
+ System.exit(0);
+ }
+}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2007-04-19 22:21:53
|
Revision: 2777
http://svn.sourceforge.net/java-game-lib/?rev=2777&view=rev
Author: matzon
Date: 2007-04-19 15:21:52 -0700 (Thu, 19 Apr 2007)
Log Message:
-----------
openal 1.1
Added Paths:
-----------
trunk/LWJGL/src/templates/org/lwjgl/openal/AL11.java
Added: trunk/LWJGL/src/templates/org/lwjgl/openal/AL11.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/openal/AL11.java (rev 0)
+++ trunk/LWJGL/src/templates/org/lwjgl/openal/AL11.java 2007-04-19 22:21:52 UTC (rev 2777)
@@ -0,0 +1,278 @@
+/*
+ * Copyright (c) 2002-2004 LWJGL Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions 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 'LWJGL' nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.lwjgl.openal;
+
+import java.nio.Buffer;
+import java.nio.IntBuffer;
+import java.nio.FloatBuffer;
+import java.nio.DoubleBuffer;
+
+import org.lwjgl.openal.AL10;
+import org.lwjgl.util.generator.*;
+
+/**
+ * <br>
+ * This is the core OpenAL class. This class implements
+ * AL.h version 1.1
+ *
+ * @author Brian Matzon <br...@ma...>
+ * @version $Revision: 2286 $
+ * $Id: AL10.java 2286 2006-03-23 19:32:21Z matzon $
+ */
+public interface AL11 {
+
+ /** Source buffer position information in seconds */
+ public static final int AL_SEC_OFFSET = 0x1024;
+
+ /** Source buffer position information in samples */
+ public static final int AL_SAMPLE_OFFSET = 0x1025;
+
+ /** Source buffer position information in bytes */
+ public static final int AL_BYTE_OFFSET = 0x1026;
+
+ /** Type of source: Buffer has been attached using AL_BUFFER */
+ public static final int AL_STATIC = 0x1028;
+
+ /** Type of source: if one or more Buffers have been attached using alSourceQueueBuffers */
+ public static final int AL_STREAMING = 0x1029;
+
+ /** Type of source: when it has the NULL buffer attached */
+ public static final int AL_UNDETERMINED = 0x1030;
+
+ /** @see AL10.AL_INVALID_OPERATION */
+ public static final int AL_ILLEGAL_COMMAND = 0xA004;
+
+ /** Speed of Sound in units per second */
+ public static final int AL_SPEED_OF_SOUND = 0xC003;
+
+ public static final int AL_LINEAR_DISTANCE = 0xD003;
+ public static final int AL_LINEAR_DISTANCE_CLAMPED = 0xD004;
+ public static final int AL_EXPONENT_DISTANCE = 0xD005;
+ public static final int AL_EXPONENT_DISTANCE_CLAMPED = 0xD006;
+
+ /**
+ * Listener attributes are changed using the Listener group of commands.
+ *
+ * @param pname name of the attribute to be set
+ * @param v1 value value 1
+ * @param v2 value value 2
+ * @param v3 value value 3
+ */
+ @ALvoid
+ void alListener3i(@ALenum int pname, int v1, int v2, int v3);
+
+ /**
+ * Listener state is maintained inside the AL implementation and can be queried in
+ * full.
+ *
+ * @param pname name of the attribute to be retrieved
+ * @param intdata Buffer to write ints to
+ */
+ // TODO: What's the real minimum number of elements?
+ @StripPostfix("intdata")
+ @ALvoid
+ void alGetListeneriv(@ALenum int pname, @Check("1") FloatBuffer intdata);
+
+ /**
+ * Specifies the position and other properties as taken into account during
+ * sound processing.
+ *
+ * @param source Source to set property on
+ * @param pname property to set
+ * @param v1 value 1 of property
+ * @param v2 value 2 of property
+ * @param v3 value 3 of property
+ */
+ @ALvoid
+ void alSource3i(@ALuint int source, @ALenum int pname, int v1, int v2, int v3);
+
+ /**
+ * Specifies the position and other properties as taken into account during
+ * sound processing.
+ *
+ * @param source Source to set property on
+ * @param pname property to set
+ * @param value IntBuffer containing value of property
+ */
+ // TODO: What's the correct minimum value?
+ @StripPostfix("value")
+ @ALvoid
+ void alSourceiv(@ALuint int source, @ALenum int pname, @Check("1") @Const IntBuffer value);
+
+ /**
+ * This function sets a floating point property of a buffer.
+ * <i>note: There are no relevant buffer properties defined in OpenAL 1.1 which can be affected by
+ * this call, but this function may be used by OpenAL extensions.</i>
+ *
+ * @param buffer Buffer to set property on
+ * @param pname property to set
+ * @param value value of property
+ */
+ @ALvoid
+ void alBufferf(@ALuint int buffer, @ALenum int pname, float value);
+
+ /**
+ * This function sets a floating point property of a buffer.
+ * <i>note: There are no relevant buffer properties defined in OpenAL 1.1 which can be affected by
+ * this call, but this function may be used by OpenAL extensions.</i>
+ *
+ * @param buffer Buffer to set property on
+ * @param pname property to set
+ * @param v1 value of property
+ * @param v2 value of property
+ * @param v3 value of property
+ */
+ @ALvoid
+ void alBuffer3f(@ALuint int buffer, @ALenum int pname, float v1, float v2, float v3);
+
+ /**
+ * This function sets a floating point property of a buffer.
+ * <i>note: There are no relevant buffer properties defined in OpenAL 1.1 which can be affected by
+ * this call, but this function may be used by OpenAL extensions.</i>
+ *
+ * @param buffer Buffer to set property on
+ * @param pname property to set
+ * @param value FloatBuffer containing value of property
+ */
+ // TODO: What's the correct minimum value?
+ @StripPostfix("value")
+ @ALvoid
+ void alBufferfv(@ALuint int buffer, @ALenum int pname, @Check("1") @Const FloatBuffer value);
+
+ /**
+ * This function sets an integer property of a buffer.
+ * <i>note: There are no relevant buffer properties defined in OpenAL 1.1 which can be affected by
+ * this call, but this function may be used by OpenAL extensions.</i>
+ *
+ * @param buffer Buffer to set property on
+ * @param pname property to set
+ * @param value value of property
+ */
+ @ALvoid
+ void alBufferi(@ALuint int buffer, @ALenum int pname, int value);
+
+ /**
+ * This function sets an integer property of a buffer.
+ * <i>note: There are no relevant buffer properties defined in OpenAL 1.1 which can be affected by
+ * this call, but this function may be used by OpenAL extensions.</i>
+ *
+ * @param buffer Buffer to set property on
+ * @param pname property to set
+ * @param v1 value of property
+ * @param v2 value of property
+ * @param v3 value of property
+ */
+ @ALvoid
+ void alBuffer3i(@ALuint int buffer, @ALenum int pname, int v1, int v2, int v3);
+
+ /**
+ * This function sets an integer property of a buffer.
+ * <i>note: There are no relevant buffer properties defined in OpenAL 1.1 which can be affected by
+ * this call, but this function may be used by OpenAL extensions.</i>
+ *
+ * @param buffer Buffer to set property on
+ * @param pname property to set
+ * @param value IntBuffer containing value of property
+ */
+ // TODO: What's the correct minimum value?
+ @StripPostfix("value")
+ @ALvoid
+ void alBufferiv(@ALuint int buffer, @ALenum int pname, @Check("1") @Const IntBuffer value);
+
+ /**
+ * This function retrieves an integer property of a buffer.
+ * <i>note: There are no relevant buffer properties defined in OpenAL 1.1 which can be affected by
+ * this call, but this function may be used by OpenAL extensions.</i>
+ *
+ * @param buffer Buffer to get property from
+ * @param pname name of property
+ * @return int
+ */
+ @ALvoid
+ void alGetBufferi(@ALuint int buffer, @ALenum int pname, @Result int value);
+
+ /**
+ * This function retrieves an integer property of a buffer.
+ *
+ * @param buffer Buffer to get property from
+ * @param pname name of property
+ */
+ // TODO: What's the correct minimum value?
+ @StripPostfix("values")
+ @ALvoid
+ void alGetBufferiv(@ALuint int buffer, @ALenum int pname, @Check("1") IntBuffer values);
+
+ /**
+ * This function retrieves a floating point property of a buffer.
+ * <i>note: There are no relevant buffer properties defined in OpenAL 1.1 which can be affected by
+ * this call, but this function may be used by OpenAL extensions.</i>
+ *
+ * @param buffer Buffer to get property from
+ * @param pname name of property
+ * @return floating point property
+ */
+ @ALvoid
+ void alGetBufferf(@ALuint int buffer, @ALenum int pname, @Result float value);
+
+ /**
+ * This function retrieves a floating point property of a buffer.
+ * <i>note: There are no relevant buffer properties defined in OpenAL 1.1 which can be affected by
+ * this call, but this function may be used by OpenAL extensions.</i>
+ *
+ * @param buffer Buffer to get property from
+ * @param pname name of property
+ */
+ // TODO: What's the correct minimum value?
+ @StripPostfix("values")
+ @ALvoid
+ void alGetBufferfv(@ALuint int buffer, @ALenum int pname, @Check("1") FloatBuffer values);
+
+ /**
+ * <p>
+ * AL_SPEED_OF_SOUND allows the application to change the reference (propagation)
+ * speed used in the Doppler calculation. The source and listener velocities should be
+ * expressed in the same units as the speed of sound.
+ * </p>
+ * <p>
+ * A negative or zero value will result in an AL_INVALID_VALUE error, and the
+ * command is ignored. The default value is 343.3 (appropriate for velocity units of meters
+ * and air as the propagation medium). The current setting can be queried using
+ * alGetFloat{v} and AL_SPEED_OF_SOUND.
+ * Distance and velocity units are completely independent of one another (so you could use
+ * different units for each if desired).
+ * </p>
+ *
+ * @param value distance model to be set
+ */
+ @ALvoid
+ void alSpeedOfSound(float value);
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2007-04-19 22:21:40
|
Revision: 2776
http://svn.sourceforge.net/java-game-lib/?rev=2776&view=rev
Author: matzon
Date: 2007-04-19 15:21:37 -0700 (Thu, 19 Apr 2007)
Log Message:
-----------
AL_SOURCE_TYPE changed value ...
Modified Paths:
--------------
trunk/LWJGL/src/templates/org/lwjgl/openal/AL10.java
Modified: trunk/LWJGL/src/templates/org/lwjgl/openal/AL10.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/openal/AL10.java 2007-04-19 22:21:04 UTC (rev 2775)
+++ trunk/LWJGL/src/templates/org/lwjgl/openal/AL10.java 2007-04-19 22:21:37 UTC (rev 2776)
@@ -64,7 +64,7 @@
* Indicate the type of SOURCE.
* Sources can be spatialized
*/
- int AL_SOURCE_TYPE = 0x200;
+ int AL_SOURCE_TYPE = 0x1027;
/** Indicate source has absolute coordinates */
int AL_SOURCE_ABSOLUTE = 0x201;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2007-04-19 22:21:08
|
Revision: 2775
http://svn.sourceforge.net/java-game-lib/?rev=2775&view=rev
Author: matzon
Date: 2007-04-19 15:21:04 -0700 (Thu, 19 Apr 2007)
Log Message:
-----------
using NewStringNativeWithLength
Modified Paths:
--------------
trunk/LWJGL/src/native/windows/org_lwjgl_Sys.c
trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsRegistry.c
Modified: trunk/LWJGL/src/native/windows/org_lwjgl_Sys.c
===================================================================
--- trunk/LWJGL/src/native/windows/org_lwjgl_Sys.c 2007-04-19 22:20:36 UTC (rev 2774)
+++ trunk/LWJGL/src/native/windows/org_lwjgl_Sys.c 2007-04-19 22:21:04 UTC (rev 2775)
@@ -105,7 +105,7 @@
CloseClipboard();
return NULL;
}
- ret = NewStringNative(env, (const char *) clipboard_data);
+ ret = NewStringNativeWithLength(env, (const char *) clipboard_data, strlen(clipboard_data));
} else {
return NULL;
}
Modified: trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsRegistry.c
===================================================================
--- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsRegistry.c 2007-04-19 22:20:36 UTC (rev 2774)
+++ trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsRegistry.c 2007-04-19 22:21:04 UTC (rev 2775)
@@ -93,7 +93,7 @@
return NULL;
}
result[buf_size - 1] = '\0';
- java_result = NewStringNative(env, result);
+ java_result = NewStringNativeWithLength(env, result, strlen(result));
free(result);
return java_result;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2007-04-19 22:20:39
|
Revision: 2774
http://svn.sourceforge.net/java-game-lib/?rev=2774&view=rev
Author: matzon
Date: 2007-04-19 15:20:36 -0700 (Thu, 19 Apr 2007)
Log Message:
-----------
using NewStringNativeWithLength
Modified Paths:
--------------
trunk/LWJGL/src/native/windows/dinputhelper.c
Modified: trunk/LWJGL/src/native/windows/dinputhelper.c
===================================================================
--- trunk/LWJGL/src/native/windows/dinputhelper.c 2007-04-19 22:20:14 UTC (rev 2773)
+++ trunk/LWJGL/src/native/windows/dinputhelper.c 2007-04-19 22:20:36 UTC (rev 2774)
@@ -47,7 +47,7 @@
jmethodID nextObject_method;
jboolean should_continue;
- name = NewStringNative(env, tszName);
+ name = NewStringNativeWithLength(env, tszName, strlen(tszName));
if (name == NULL)
return false;
enum_class = (*env)->GetObjectClass(env, enumerator);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2007-04-19 22:20:16
|
Revision: 2773
http://svn.sourceforge.net/java-game-lib/?rev=2773&view=rev
Author: matzon
Date: 2007-04-19 15:20:14 -0700 (Thu, 19 Apr 2007)
Log Message:
-----------
openal 1.1
exposing device and context
Added Paths:
-----------
trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC10.c
trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC11.c
Added: trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC10.c
===================================================================
--- trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC10.c (rev 0)
+++ trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC10.c 2007-04-19 22:20:14 UTC (rev 2773)
@@ -0,0 +1,342 @@
+/*
+ * Copyright (c) 2002-2004 LWJGL Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions 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 'LWJGL' nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * $Id: org_lwjgl_openal_ALC.c 2279 2006-02-23 19:22:00Z elias_naur $
+ *
+ * This is the actual JNI implementation of the OpenAL context/device library.
+ *
+ * @author Brian Matzon <br...@ma...>
+ * @version $Revision: 2279 $
+ */
+
+/* OpenAL includes */
+#include "extal.h"
+
+//alc
+typedef ALCubyte* (ALCAPIENTRY *alcGetStringPROC)(ALCdevice *device,ALCenum param);
+typedef ALCvoid (ALCAPIENTRY *alcGetIntegervPROC)(ALCdevice *device,ALCenum param,ALCsizei size,ALCint *data);
+typedef ALCdevice* (ALCAPIENTRY *alcOpenDevicePROC)(ALCubyte *deviceName);
+typedef ALCboolean (ALCAPIENTRY *alcCloseDevicePROC)(ALCdevice *device);
+typedef ALCcontext* (ALCAPIENTRY *alcCreateContextPROC)(ALCdevice *device,ALCint *attrList);
+typedef ALCenum (ALCAPIENTRY *alcMakeContextCurrentPROC)(ALCcontext *context);
+typedef ALCvoid (ALCAPIENTRY *alcProcessContextPROC)(ALCcontext *context);
+typedef ALCdevice* (ALCAPIENTRY *alcGetContextsDevicePROC)(ALCcontext *context);
+typedef ALCvoid (ALCAPIENTRY *alcSuspendContextPROC)(ALCcontext *context);
+typedef ALCvoid (ALCAPIENTRY *alcDestroyContextPROC)(ALCcontext *context);
+typedef ALCenum (ALCAPIENTRY *alcGetErrorPROC)(ALCdevice *device);
+typedef ALCboolean (ALCAPIENTRY *alcIsExtensionPresentPROC)(ALCdevice *device,ALCubyte *extName);
+//typedef ALCvoid* (ALCAPIENTRY *alcGetProcAddressPROC)(ALCdevice *device,ALCubyte *funcName);
+typedef ALCenum (ALCAPIENTRY *alcGetEnumValuePROC)(ALCdevice *device,ALCubyte *enumName);
+typedef ALCcontext* (ALCAPIENTRY *alcGetCurrentContextPROC)(ALCvoid);
+
+static alcGetCurrentContextPROC alcGetCurrentContext = NULL;
+static alcGetStringPROC alcGetString;
+static alcGetIntegervPROC alcGetIntegerv;
+static alcOpenDevicePROC alcOpenDevice;
+static alcCloseDevicePROC alcCloseDevice;
+static alcCreateContextPROC alcCreateContext;
+static alcMakeContextCurrentPROC alcMakeContextCurrent;
+static alcProcessContextPROC alcProcessContext;
+static alcGetContextsDevicePROC alcGetContextsDevice;
+static alcSuspendContextPROC alcSuspendContext;
+static alcDestroyContextPROC alcDestroyContext;
+static alcGetErrorPROC alcGetError;
+static alcIsExtensionPresentPROC alcIsExtensionPresent;
+//static alcGetProcAddressPROC alcGetProcAddress;
+static alcGetEnumValuePROC alcGetEnumValue;
+
+/**
+ * This function returns strings related to the context.
+ *
+ * C Specification:
+ * ALubyte * alcGetString(ALCdevice *device, ALenum token);
+ */
+static jstring JNICALL Java_org_lwjgl_openal_ALC10_nalcGetString (JNIEnv *env, jclass clazz, jlong deviceaddress, jint token) {
+ const char* alcString = (const char*) alcGetString((ALCdevice*)((intptr_t)deviceaddress), (ALenum) token);
+ int length;
+ int i=1;
+
+ if(alcString == NULL) {
+ return NULL;
+ }
+
+ // Special treatment of enumeration tokens
+ // These are encoded using \0 between elements and a finishing \0\0
+ switch(token) {
+ case 0x1005: // ALC_DEVICE_SPECIFIER
+ case 0x310: // ALC_CAPTURE_DEVICE_SPECIFIER
+ while (alcString[i - 1] != '\0' || alcString[i] != '\0') {
+ i++;
+ }
+ length = i + 1;
+ break;
+ default:
+ length = strlen(alcString);
+ }
+ return NewStringNativeWithLength(env, alcString, length);
+}
+
+/**
+ * This function returns integers related to the context.
+ *
+ * C Specification:
+ * ALvoid alcGetIntegerv(ALCdevice *device, ALenum token, ALsizei size, ALint *dest);
+ */
+static void JNICALL Java_org_lwjgl_openal_ALC10_nalcGetIntegerv (JNIEnv *env, jclass clazz, jlong deviceaddress, jint token, jint size, jobject dest, jint offset) {
+ ALint* address = NULL;
+ if (dest != NULL) {
+ address = offset + (ALint*) (*env)->GetDirectBufferAddress(env, dest);
+ }
+ alcGetIntegerv((ALCdevice*)((intptr_t)deviceaddress), (ALenum) token, (ALsizei) size, address);
+}
+
+/**
+ * This function opens a device by name.
+ *
+ * C Specification:
+ * ALCdevice *alcOpenDevice( const ALubyte *tokstr );
+ */
+static jlong JNICALL Java_org_lwjgl_openal_ALC10_nalcOpenDevice (JNIEnv *env, jclass clazz, jstring tokstr) {
+ char * tokenstring;
+ ALCdevice* device;
+
+ if(tokstr != NULL) {
+ tokenstring = GetStringNativeChars(env, tokstr);
+ } else {
+ tokenstring = NULL;
+ }
+
+ /* get device */
+ device = alcOpenDevice((ALubyte *) tokenstring);
+
+ /* if error - cleanup and get out */
+ if(device == NULL) {
+ if(tokenstring != NULL) {
+ free(tokenstring);
+ }
+ return (jlong) NULL;
+ }
+
+ /* clean up */
+ if (tokenstring != NULL)
+ free(tokenstring);
+
+ return (jlong)((intptr_t)device);
+}
+
+/**
+ * This function closes a device by name.
+ *
+ * C Specification:
+ * bool alcCloseDevice( ALCdevice *dev );
+ */
+static jboolean JNICALL Java_org_lwjgl_openal_ALC10_nalcCloseDevice (JNIEnv *env, jclass clazz, jlong deviceaddress) {
+ return alcCloseDevice((ALCdevice*)((intptr_t)deviceaddress));
+}
+
+/**
+ * This function creates a context using a specified device.
+ *
+ * C Specification:
+ * ALCcontext* alcCreateContext( ALCdevice *dev, ALint* attrlist );
+ */
+static jlong JNICALL Java_org_lwjgl_openal_ALC10_nalcCreateContext (JNIEnv *env, jclass clazz, jlong deviceaddress, jobject attrlist) {
+ ALint* address = NULL;
+ ALCcontext* context;
+
+ if (attrlist != NULL) {
+ address = (ALint*) safeGetBufferAddress(env, attrlist);
+ }
+ context = alcCreateContext((ALCdevice*)((intptr_t)deviceaddress), address);
+
+ /* if error - get out */
+ if(context == NULL) {
+ return (jlong) NULL;
+ }
+
+ return (jlong)((intptr_t)context);
+}
+
+/**
+ * This function makes a specified context the current context.
+ *
+ * C Specification:
+ * ALCboolean alcMakeContextCurrent(ALCcontext *context);
+ */
+static jint JNICALL Java_org_lwjgl_openal_ALC10_nalcMakeContextCurrent (JNIEnv *env, jclass clazz, jlong contextaddress) {
+ ALCcontext* context = (ALCcontext*)((intptr_t)contextaddress);
+ ALCenum result;
+ if(context == NULL) {
+ result = alcMakeContextCurrent(NULL);
+ } else {
+ result = alcMakeContextCurrent(context);
+ }
+ return result;
+}
+
+/**
+ * This function tells a context to begin processing.
+ *
+ * C Specification:
+ * void alcProcessContext(ALCcontext *context);
+ */
+static void JNICALL Java_org_lwjgl_openal_ALC10_nalcProcessContext (JNIEnv *env, jclass clazz, jlong contextaddress) {
+ alcProcessContext((ALCcontext*)((intptr_t)contextaddress));
+}
+
+/**
+ * This function retrieves the current context.
+ *
+ * C Specification:
+ * ALCcontext* alcGetCurrentContext( ALvoid );
+ */
+static jlong JNICALL Java_org_lwjgl_openal_ALC10_nalcGetCurrentContext (JNIEnv *env, jclass clazz) {
+ ALCcontext* context = alcGetCurrentContext();
+
+ if(context == NULL) {
+ return (jlong) NULL;
+ }
+ return (jlong)((intptr_t)context);
+}
+
+/**
+ * This function retrieves the specified contexts device
+ *
+ * C Specification:
+ * ALCdevice* alcGetContextsDevice(ALCcontext *context);
+ */
+static jlong JNICALL Java_org_lwjgl_openal_ALC10_nalcGetContextsDevice (JNIEnv *env, jclass clazz, jlong contextaddress) {
+ ALCdevice* device = alcGetContextsDevice((ALCcontext*)((intptr_t)contextaddress));
+
+ if(device == NULL) {
+ return (jlong) NULL;
+ }
+
+ return (jlong)((intptr_t)device);
+}
+
+/**
+ * This function suspends processing on a specified context.
+ *
+ * C Specification:
+ * void alcSuspendContext(ALCcontext *context);
+ */
+static void JNICALL Java_org_lwjgl_openal_ALC10_nalcSuspendContext (JNIEnv *env, jclass clazz, jlong contextaddress) {
+ alcSuspendContext((ALCcontext*)((intptr_t)contextaddress));
+}
+
+/**
+ * This function destroys a context.
+ *
+ * C Specification:
+ * void alcDestroyContext(ALCcontext *context);
+ */
+static void JNICALL Java_org_lwjgl_openal_ALC10_nalcDestroyContext (JNIEnv *env, jclass clazz, jlong contextaddress) {
+ alcDestroyContext((ALCcontext*)((intptr_t)contextaddress));
+}
+
+/**
+ * This function retrieves the specified devices context error state.
+ *
+ * C Specification:
+ * ALCenum alcGetError(ALCdevice *device);
+ */
+static jint JNICALL Java_org_lwjgl_openal_ALC10_nalcGetError (JNIEnv *env, jclass clazz, jlong deviceaddress) {
+ return alcGetError((ALCdevice*)((intptr_t)deviceaddress));
+}
+
+/**
+ * This function queries if a specified context extension is available.
+ *
+ * C Specification:
+ * ALboolean alcIsExtensionPresent(ALCdevice *device, ALubyte *extName);
+ */
+static jboolean JNICALL Java_org_lwjgl_openal_ALC10_nalcIsExtensionPresent (JNIEnv *env, jclass clazz, jlong deviceaddress, jstring extName) {
+ /* get extension */
+ ALubyte* functionname = (ALubyte*) GetStringNativeChars(env, extName);
+
+ jboolean result = (jboolean) alcIsExtensionPresent((ALCdevice*)((intptr_t)deviceaddress), functionname);
+
+ free(functionname);
+
+ return result;
+}
+
+/**
+ * This function retrieves the enum value for a specified enumeration name.
+ *
+ * C Specification:
+ * ALenum alcGetEnumValue(ALCdevice *device, ALubyte *enumName);
+ */
+static jint JNICALL Java_org_lwjgl_openal_ALC10_nalcGetEnumValue (JNIEnv *env, jclass clazz, jlong deviceaddress, jstring enumName) {
+ /* get extension */
+ ALubyte* enumerationname = (ALubyte*) GetStringNativeChars(env, enumName);
+
+ jint result = (jint) alcGetEnumValue((ALCdevice*)((intptr_t)deviceaddress), enumerationname);
+
+ free(enumerationname);
+
+ return result;
+}
+
+/**
+ * Loads the context OpenAL functions
+ *
+ * @return true if all methods were loaded, false if one of the methods could not be loaded
+ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC10_initNativeStubs(JNIEnv *env, jclass clazz) {
+ JavaMethodAndExtFunction functions[] = {
+ {"nalcGetString", "(JI)Ljava/lang/String;", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetString, "alcGetString", (void*)&alcGetString},
+ {"nalcGetIntegerv", "(JIILjava/nio/Buffer;I)V", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetIntegerv, "alcGetIntegerv", (void*)&alcGetIntegerv},
+ {"nalcOpenDevice", "(Ljava/lang/String;)J", (void*)&Java_org_lwjgl_openal_ALC10_nalcOpenDevice, "alcOpenDevice", (void*)&alcOpenDevice},
+ {"nalcCloseDevice", "(J)Z", (void*)&Java_org_lwjgl_openal_ALC10_nalcCloseDevice, "alcCloseDevice", (void*)&alcCloseDevice},
+ {"nalcCreateContext", "(JLjava/nio/IntBuffer;)J", (void*)&Java_org_lwjgl_openal_ALC10_nalcCreateContext, "alcCreateContext", (void*)&alcCreateContext},
+ {"nalcMakeContextCurrent", "(J)I", (void*)&Java_org_lwjgl_openal_ALC10_nalcMakeContextCurrent, "alcMakeContextCurrent", (void*)&alcMakeContextCurrent},
+ {"nalcProcessContext", "(J)V", (void*)&Java_org_lwjgl_openal_ALC10_nalcProcessContext, "alcProcessContext", (void*)&alcProcessContext},
+ {"nalcGetCurrentContext", "()J", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetCurrentContext, "alcGetCurrentContext", (void*)&alcGetCurrentContext},
+ {"nalcGetContextsDevice", "(J)J", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetContextsDevice, "alcGetContextsDevice", (void*)&alcGetContextsDevice},
+ {"nalcSuspendContext", "(J)V", (void*)&Java_org_lwjgl_openal_ALC10_nalcSuspendContext, "alcSuspendContext", (void*)&alcSuspendContext},
+ {"nalcDestroyContext", "(J)V", (void*)&Java_org_lwjgl_openal_ALC10_nalcDestroyContext, "alcDestroyContext", (void*)&alcDestroyContext},
+ {"nalcGetError", "(J)I", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetError, "alcGetError", (void*)&alcGetError},
+ {"nalcIsExtensionPresent", "(JLjava/lang/String;)Z", (void*)&Java_org_lwjgl_openal_ALC10_nalcIsExtensionPresent, "alcIsExtensionPresent", (void*)&alcIsExtensionPresent},
+ {"nalcGetEnumValue", "(JLjava/lang/String;)I", (void*)&Java_org_lwjgl_openal_ALC10_nalcGetEnumValue, "alcGetEnumValue", (void*)&alcGetEnumValue}
+ };
+ int num_functions = NUMFUNCTIONS(functions);
+ extal_InitializeClass(env, clazz, num_functions, functions);
+}
+#ifdef __cplusplus
+}
+#endif
Added: trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC11.c
===================================================================
--- trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC11.c (rev 0)
+++ trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC11.c 2007-04-19 22:20:14 UTC (rev 2773)
@@ -0,0 +1,135 @@
+/*
+ * Copyright (c) 2002-2004 LWJGL Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions 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 'LWJGL' nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * $Id: org_lwjgl_openal_ALC.c 2279 2006-02-23 19:22:00Z elias_naur $
+ *
+ * This is the actual JNI implementation of the OpenAL context/device library.
+ *
+ * @author Brian Matzon <br...@ma...>
+ * @version $Revision: 2279 $
+ */
+
+/* OpenAL includes */
+#include "extal.h"
+
+//alc
+typedef ALCdevice * (ALCAPIENTRY *alcCaptureOpenDevicePROC)( const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize );
+typedef ALCboolean (ALCAPIENTRY *alcCaptureCloseDevicePROC)( ALCdevice *device );
+typedef void (ALCAPIENTRY *alcCaptureStartPROC)( ALCdevice *device );
+typedef void (ALCAPIENTRY *alcCaptureStopPROC)( ALCdevice *device );
+typedef void (ALCAPIENTRY *alcCaptureSamplesPROC)( ALCdevice *device, ALCvoid *buffer, ALCsizei samples );
+
+static alcCaptureOpenDevicePROC alcCaptureOpenDevice;
+static alcCaptureCloseDevicePROC alcCaptureCloseDevice;
+static alcCaptureStartPROC alcCaptureStart;
+static alcCaptureStopPROC alcCaptureStop;
+static alcCaptureSamplesPROC alcCaptureSamples;
+
+/*
+ * Class: org_lwjgl_openal_ALC11
+ * Method: nalcCaptureOpenDevice
+ * Signature: (Ljava/lang/String;III)J
+ */
+static jlong JNICALL Java_org_lwjgl_openal_ALC11_nalcCaptureOpenDevice(JNIEnv *env, jclass clazz, jstring devicename, jint frequency, jint format, jint buffersize) {
+ ALubyte* dev_name = NULL;
+ ALCdevice* device = NULL;
+
+ if(devicename != NULL) {
+ dev_name = (ALubyte*) GetStringNativeChars(env, devicename);
+ }
+
+ device = alcCaptureOpenDevice(dev_name, frequency, format, buffersize);
+
+ free(dev_name);
+ return (jlong) device;
+}
+
+/*
+ * Class: org_lwjgl_openal_ALC11
+ * Method: nalcCaptureCloseDevice
+ * Signature: (J)Z
+ */
+static jboolean JNICALL Java_org_lwjgl_openal_ALC11_nalcCaptureCloseDevice(JNIEnv *env, jclass clazz, jlong device) {
+ return (jboolean) alcCaptureCloseDevice((ALCdevice*) device);
+}
+
+/*
+ * Class: org_lwjgl_openal_ALC11
+ * Method: nalcCaptureStart
+ * Signature: (J)V
+ */
+static void JNICALL Java_org_lwjgl_openal_ALC11_nalcCaptureStart(JNIEnv *env, jclass clazz, jlong device) {
+ alcCaptureStart((ALCdevice*) device);
+}
+
+/*
+ * Class: org_lwjgl_openal_ALC11
+ * Method: nalcCaptureStop
+ * Signature: (J)V
+ */
+static void JNICALL Java_org_lwjgl_openal_ALC11_nalcCaptureStop(JNIEnv * env, jclass clazz, jlong device) {
+ alcCaptureStop((ALCdevice*) device);
+}
+
+/*
+ * Class: org_lwjgl_openal_ALC11
+ * Method: nalcCaptureSamples
+ * Signature: (JLjava/nio/ByteBuffer;I)V
+ */
+static void JNICALL Java_org_lwjgl_openal_ALC11_nalcCaptureSamples(JNIEnv *env, jclass clazz, jlong device, jobject buffer, jint position, jint samples) {
+ ALuint *buffer_address = ((ALuint *)(*env)->GetDirectBufferAddress(env, buffer)) + position;
+ alcCaptureSamples((ALCdevice*) device, buffer_address, samples);
+}
+
+/**
+ * Loads the context OpenAL functions
+ *
+ * @return true if all methods were loaded, false if one of the methods could not be loaded
+ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC11_initNativeStubs(JNIEnv *env, jclass clazz) {
+ JavaMethodAndExtFunction functions[] = {
+ {"nalcCaptureOpenDevice", "(Ljava/lang/String;III)J", (void*)&Java_org_lwjgl_openal_ALC11_nalcCaptureOpenDevice, "alcCaptureOpenDevice", (void*)&alcCaptureOpenDevice},
+ {"nalcCaptureCloseDevice", "(J)Z", (void*)&Java_org_lwjgl_openal_ALC11_nalcCaptureCloseDevice, "alcCaptureCloseDevice", (void*)&alcCaptureCloseDevice},
+ {"nalcCaptureStart", "(J)V", (void*)&Java_org_lwjgl_openal_ALC11_nalcCaptureStart, "alcCaptureStart", (void*)&alcCaptureStart},
+ {"nalcCaptureStop", "(J)V", (void*)&Java_org_lwjgl_openal_ALC11_nalcCaptureStop, "alcCaptureStop", (void*)&alcCaptureStop},
+ {"nalcCaptureSamples", "(JLjava/nio/ByteBuffer;II)V", (void*)&Java_org_lwjgl_openal_ALC11_nalcCaptureSamples, "alcCaptureSamples", (void*)&alcCaptureSamples}
+ };
+ int num_functions = NUMFUNCTIONS(functions);
+ extal_InitializeClass(env, clazz, num_functions, functions);
+}
+#ifdef __cplusplus
+}
+#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <eli...@us...> - 2007-04-19 12:00:41
|
Revision: 2771
http://svn.sourceforge.net/java-game-lib/?rev=2771&view=rev
Author: elias_naur
Date: 2007-04-19 05:00:40 -0700 (Thu, 19 Apr 2007)
Log Message:
-----------
JInput update
Modified Paths:
--------------
trunk/LWJGL/libs/jinput.jar
Modified: trunk/LWJGL/libs/jinput.jar
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <eli...@us...> - 2007-04-19 08:25:17
|
Revision: 2770
http://svn.sourceforge.net/java-game-lib/?rev=2770&view=rev
Author: elias_naur
Date: 2007-04-19 01:24:36 -0700 (Thu, 19 Apr 2007)
Log Message:
-----------
Removed reference to generated code in build.xml
Modified Paths:
--------------
trunk/LWJGL/build.xml
Modified: trunk/LWJGL/build.xml
===================================================================
--- trunk/LWJGL/build.xml 2007-04-19 07:42:01 UTC (rev 2769)
+++ trunk/LWJGL/build.xml 2007-04-19 08:24:36 UTC (rev 2770)
@@ -206,7 +206,6 @@
<uptodate property="lwjgl.main.built" targetfile="${lwjgl.lib}/win32/lwjgl.dll" >
<srcfiles dir= "${lwjgl.src.native}/common" includes="*.c*"/>
- <srcfiles dir= "${lwjgl.src.native}/generated" includes="*.c"/>
<srcfiles dir= "${lwjgl.src.native}/windows" includes="*.c"/>
</uptodate>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|