Skip to content

Commit

Permalink
Merged with latest of mbien
Browse files Browse the repository at this point in the history
  • Loading branch information
sgothel committed Mar 31, 2010
2 parents 73829c3 + 2226216 commit e37c383
Show file tree
Hide file tree
Showing 60 changed files with 3,101 additions and 3,036 deletions.
1 change: 0 additions & 1 deletion make/build-junit.xml
Expand Up @@ -103,7 +103,6 @@
<javac destdir="${build_t.java}"
source="1.5" debug="true"
fork="yes"
verbose="true"
debuglevel="lines,vars,source">
<classpath refid="junit.compile.classpath"/>
<src path="${test.base.dir}"/>
Expand Down
7 changes: 5 additions & 2 deletions make/build.xml
Expand Up @@ -481,13 +481,14 @@
- original source. -->

<property name="gluegen-rt.classes" value="com/jogamp/gluegen/runtime/**"/>
<property name="jogamp.common.classes" value="com/jogamp/common/**"/>

<!--compile gluegen-rt with source=1.4 first-->
<javac destdir="${classes}"
source="1.4"
debug="true"
debuglevel="source,lines,vars"
includes="${gluegen-rt.classes}"
includes="${gluegen-rt.classes},${jogamp.common.classes}"
excludes="${gluegen.excludes}">
<src path="${src.java}" />
<src path="${src.generated.java}" />
Expand Down Expand Up @@ -533,6 +534,7 @@
<fileset dir="${classes}">
<include name="com/jogamp/gluegen/runtime/*.class" />
<include name="com/jogamp/gluegen/runtime/opengl/*.class" />
<include name="com/jogamp/common/**" />
</fileset>
</jar>

Expand All @@ -549,6 +551,7 @@
<fileset dir="${classes-cdc}">
<include name="com/jogamp/gluegen/runtime/*.class" />
<include name="com/jogamp/gluegen/runtime/opengl/*.class" />
<include name="com/jogamp/common/*.class" />
</fileset>
</jar>

Expand Down Expand Up @@ -586,7 +589,7 @@
<fileset dir="${build}/test/build/classes">
<include name="com/sun/gluegen/**Test*"/>
</fileset>
<formatter usefile="false" type="brief"/>
<formatter usefile="false" type="plain"/>
<formatter usefile="true" type="xml"/>
</batchtest>
<classpath>
Expand Down
2 changes: 1 addition & 1 deletion make/dynlink-macosx.cfg
@@ -1,6 +1,6 @@
Style AllStatic
JavaClass MacOSXDynamicLinkerImpl
Package com.jogamp.gluegen.runtime
Package com.jogamp.common.os
Implements MacOSXDynamicLinkerImpl DynamicLinker
JavaOutputDir ../src/java
NativeOutputDir ../src/native/macosx
Expand Down
2 changes: 1 addition & 1 deletion make/dynlink-unix.cfg
@@ -1,6 +1,6 @@
Style AllStatic
JavaClass UnixDynamicLinkerImpl
Package com.jogamp.gluegen.runtime
Package com.jogamp.common.os
Implements UnixDynamicLinkerImpl DynamicLinker
JavaOutputDir ../src/java
NativeOutputDir ../src/native/unix
Expand Down
2 changes: 1 addition & 1 deletion make/dynlink-windows.cfg
@@ -1,6 +1,6 @@
Style AllStatic
JavaClass WindowsDynamicLinkerImpl
Package com.jogamp.gluegen.runtime
Package com.jogamp.common.os
Implements WindowsDynamicLinkerImpl DynamicLinker
JavaOutputDir ../src/java
NativeOutputDir ../src/native/windows
Expand Down
Expand Up @@ -28,7 +28,9 @@
/*
* Created on Saturday, March 27 2010 11:55
*/
package com.jogamp.gluegen.runtime;
package com.jogamp.common.nio;

import com.jogamp.common.os.*;

import java.nio.ByteBuffer;
import java.nio.Buffer;
Expand All @@ -38,7 +40,7 @@
* @author Michael Bien
* @author Sven Gothel
*/
public abstract class AbstractBuffer {
public abstract class AbstractBuffer implements NativeBuffer {

protected final ByteBuffer bb;
protected int capacity;
Expand Down Expand Up @@ -67,7 +69,7 @@ public final int position() {
return position;
}

public final AbstractBuffer position(int newPos) {
public final NativeBuffer position(int newPos) {
if (0 > newPos || newPos >= capacity) {
throw new IndexOutOfBoundsException("Sorry to interrupt, but the position "+newPos+" was out of bounds. " +
"My capacity is "+capacity()+".");
Expand All @@ -84,7 +86,7 @@ public final boolean hasRemaining() {
return position < capacity;
}

public final AbstractBuffer rewind() {
public final NativeBuffer rewind() {
position = 0;
return this;
}
Expand Down
Expand Up @@ -28,8 +28,9 @@
/*
* Created on Saturday, March 27 2010 11:55
*/
package com.jogamp.gluegen.runtime;
package com.jogamp.common.nio;

import com.jogamp.common.os.*;
import java.nio.ByteBuffer;
import java.nio.Buffer;
import java.util.HashMap;
Expand Down
Expand Up @@ -36,8 +36,9 @@
* Sun gratefully acknowledges that this software was originally authored
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
package com.jogamp.gluegen.runtime;
package com.jogamp.common.nio;

import com.jogamp.common.os.Platform;
import java.nio.*;

/**
Expand Down
Expand Up @@ -25,8 +25,9 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

package com.jogamp.gluegen.runtime;
package com.jogamp.common.nio;

import com.jogamp.common.os.*;
import java.nio.ByteBuffer;

/**
Expand Down
Expand Up @@ -33,8 +33,9 @@
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
package com.jogamp.gluegen.runtime;
package com.jogamp.common.nio;

import com.jogamp.common.os.Platform;
import java.nio.*;

/**
Expand Down
Expand Up @@ -33,7 +33,7 @@
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
package com.jogamp.gluegen.runtime;
package com.jogamp.common.nio;

import java.nio.*;

Expand Down
54 changes: 54 additions & 0 deletions src/java/com/jogamp/common/nio/NativeBuffer.java
@@ -0,0 +1,54 @@
/*
* Created on Tuesday, March 30 2010 18:22
*/
package com.jogamp.common.nio;

import java.nio.ByteBuffer;

/**
* Hardware independent container for various kinds of buffers.
*
* @author Michael Bien
* @author Sven Gothel
*/
public interface NativeBuffer/*<B extends NativeBuffer>*/ {

public int limit();

public int capacity();

public int position();

public NativeBuffer position(int newPos);

public int remaining();

public boolean hasRemaining();

public NativeBuffer rewind();

public boolean hasArray();

public int arrayOffset();

public ByteBuffer getBuffer();

public boolean isDirect();

/*
public long[] array();
public B rewind();
public B put(int index, long value);
public B put(long value);
public B put(B src);
public long get();
public long get(int idx);
*/

}
Expand Up @@ -28,8 +28,9 @@
/*
* Created on Saturday, March 27 2010 11:55
*/
package com.jogamp.gluegen.runtime;
package com.jogamp.common.nio;

import com.jogamp.common.os.*;
import java.nio.ByteBuffer;
import java.nio.Buffer;
import java.util.HashMap;
Expand Down
Expand Up @@ -33,8 +33,9 @@
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
package com.jogamp.gluegen.runtime;
package com.jogamp.common.nio;

import com.jogamp.common.os.Platform;
import java.nio.*;

/**
Expand Down
Expand Up @@ -33,8 +33,9 @@
* in the design, construction, operation or maintenance of any nuclear
* facility.
*/
package com.jogamp.gluegen.runtime;
package com.jogamp.common.nio;

import com.jogamp.common.os.Platform;
import java.nio.*;

/**
Expand Down
Expand Up @@ -36,8 +36,9 @@
* Sun gratefully acknowledges that this software was originally authored
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
package com.jogamp.gluegen.runtime;
package com.jogamp.common.nio;

import com.jogamp.common.os.Platform;
import java.nio.*;

/**
Expand Down
Expand Up @@ -37,7 +37,7 @@
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/

package com.jogamp.gluegen.runtime;
package com.jogamp.common.os;

/** Provides an abstract interface to the OS's low-level dynamic
linking functionality. */
Expand Down
Expand Up @@ -37,7 +37,7 @@
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/

package com.jogamp.gluegen.runtime;
package com.jogamp.common.os;

/** Interface callers may use to use the ProcAddressHelper's {@link
ProcAddressHelper#resetProcAddressTable resetProcAddressTable}
Expand Down
@@ -1,11 +1,9 @@
/* !---- DO NOT EDIT: This file autogenerated by com\sun\gluegen\JavaEmitter.java on Mon Jul 31 16:27:00 PDT 2006 ----! */

package com.jogamp.gluegen.runtime;
package com.jogamp.common.os;

import com.jogamp.gluegen.runtime.*;

public class MacOSXDynamicLinkerImpl implements DynamicLinker
{
public class MacOSXDynamicLinkerImpl implements DynamicLinker {

public static final int RTLD_LAZY = 0x1;
public static final int RTLD_NOW = 0x2;
Expand Down
Expand Up @@ -37,8 +37,9 @@
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/

package com.jogamp.gluegen.runtime;
package com.jogamp.common.os;

import com.jogamp.gluegen.runtime.NativeLibLoader;
import java.io.*;
import java.lang.reflect.*;
import java.security.*;
Expand Down Expand Up @@ -412,7 +413,7 @@ public Object run() {
}

private static volatile boolean loadedDynLinkNativeLib;
static void ensureNativeLibLoaded() {
public static void ensureNativeLibLoaded() {
if (!loadedDynLinkNativeLib) {
synchronized (NativeLibrary.class) {
if (!loadedDynLinkNativeLib) {
Expand Down
Expand Up @@ -28,8 +28,9 @@
/*
* Created on Sunday, March 28 2010 14:43
*/
package com.jogamp.gluegen.runtime;
package com.jogamp.common.os;

import com.jogamp.common.nio.Buffers;
import java.nio.ByteBuffer;
import java.nio.IntBuffer;
import java.nio.ShortBuffer;
Expand Down
@@ -1,11 +1,9 @@
/* !---- DO NOT EDIT: This file autogenerated by com\sun\gluegen\JavaEmitter.java on Mon Jul 31 16:26:59 PDT 2006 ----! */

package com.jogamp.gluegen.runtime;
package com.jogamp.common.os;

import com.jogamp.gluegen.runtime.*;

public class UnixDynamicLinkerImpl implements DynamicLinker
{
public class UnixDynamicLinkerImpl implements DynamicLinker {

public static final int RTLD_LAZY = 0x00001;
public static final int RTLD_NOW = 0x00002;
Expand Down
@@ -1,11 +1,9 @@
/* !---- DO NOT EDIT: This file autogenerated by com\sun\gluegen\JavaEmitter.java on Tue May 27 02:37:55 PDT 2008 ----! */

package com.jogamp.gluegen.runtime;
package com.jogamp.common.os;

import com.jogamp.gluegen.runtime.*;

public class WindowsDynamicLinkerImpl implements DynamicLinker
{
public class WindowsDynamicLinkerImpl implements DynamicLinker {


/** Interface to C language function: <br> <code> BOOL FreeLibrary(HANDLE hLibModule); </code> */
Expand Down
1 change: 1 addition & 0 deletions src/java/com/jogamp/gluegen/runtime/ProcAddressHelper.java
Expand Up @@ -39,6 +39,7 @@

package com.jogamp.gluegen.runtime;

import com.jogamp.common.os.DynamicLookupHelper;
import java.security.*;

// Debugging only
Expand Down
Expand Up @@ -36,6 +36,7 @@

package com.jogamp.gluegen.runtime.opengl;

import com.jogamp.common.os.DynamicLookupHelper;
import com.jogamp.gluegen.runtime.*;

// Debugging only
Expand Down

0 comments on commit e37c383

Please sign in to comment.