Whooooops!

This commit is contained in:
Caspian Rychlik-Prince 2003-08-17 16:38:57 +00:00
parent 711c157ce6
commit 1e69c2ec92
146 changed files with 16168 additions and 5191 deletions

View File

@ -0,0 +1,257 @@
/*
* Copyright (c) 2002 Light Weight Java Game Library 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 'Light Weight Java Game Library' 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;
import java.util.HashSet;
import java.util.Arrays;
import java.nio.ByteBuffer;
import java.nio.FloatBuffer;
import java.nio.ByteOrder;
/**
* $Id$
*
* Encapsulates everything you need for game display.
* It must be created before any input devices are created.
* The game display has NO mouse cursor or any other window decorations.
*
* @author cix_foo <cix_foo@users.sourceforge.net>
* @version $Revision$
*/
public final class Display {
/** Has the display been created? */
private static boolean created;
/** The current display mode, if created */
private static DisplayMode mode;
/** A pointer to the native display window. On Windows this will be an hWnd. */
private static int handle;
/** Whether or not the display has been requested to shutdown by the user */
private static boolean closeRequested = false;
/*
* Platforms. This will let you determine which platform you are running
* on, which is handy to know for some GL context calls.
*/
/** Windows platform */
public static final int PLATFORM_WGL = 0;
/** GLX (Linux/Unix) platform */
public static final int PLATFORM_GLX = 1;
/** MacOSX platform */
public static final int PLATFORM_AGL = 2;
static {
System.loadLibrary(Sys.getLibraryName());
init();
}
/**
* No construction allowed.
*/
private Display() {
super();
}
/**
* Initialize. This determines, natively, the current display mode and stashes
* it back in the mode static member.
*/
private static native void init();
/**
* Returns the entire list of display modes as an array, in no
* particular order. Any given mode is not guaranteed to be available and
* the only certain way to check is to call create() and make sure it works.
* Only non-palette-indexed modes are returned (ie. bpp will be 16, 24, or 32).
*
* @return an array of all display modes the system reckons it can handle.
*/
public static DisplayMode[] getAvailableDisplayModes() {
DisplayMode[] unfilteredModes = nGetAvailableDisplayModes();
if (unfilteredModes == null) {
return new DisplayMode[0];
}
// We'll use a HashSet to filter out the duplicated modes
HashSet modes = new HashSet(unfilteredModes.length);
modes.addAll(Arrays.asList(unfilteredModes));
DisplayMode[] filteredModes = new DisplayMode[modes.size()];
modes.toArray(filteredModes);
if (Sys.DEBUG) {
System.out.println("Removed " + (unfilteredModes.length - filteredModes.length) + " duplicate displaymodes");
}
return filteredModes;
}
/**
* Native method for getting displaymodes
*/
private static native DisplayMode[] nGetAvailableDisplayModes();
/**
* Set the current display mode. The underlying OS may not use an exact match for
* the specified display mode. After successfully calling setDisplayMode() you will
* still need to query the display's characteristics using getDisplayMode().
*
* @param mode The new display mode to set
* @throws Exception if the display mode could not be set
*/
public static native void setDisplayMode(DisplayMode mode) throws Exception;
/**
* Reset the display mode to whatever it was when LWJGL was initialized.
* Fails silently.
*/
public static native void resetDisplayMode();
/**
* Retrieves the width of the created display
*
* @return the current display width.
*/
public static int getWidth() {
return mode.width;
}
/**
* Retrieves the height of the created display
*
* @return the current display height.
*/
public static int getHeight() {
return mode.height;
}
/**
* Retrieves the current display depth of the created display
*
* @return the current display depth.
*/
public static int getDepth() {
return mode.bpp;
}
/**
* Retrieves the current display frequency of the created display
*
* @return the current display frequency.
*/
public static int getFrequency() {
return mode.freq;
}
/**
* Retrieves the native handle to the created window. The meaning of this value
* is platform specific. Under Win32, it is an HWND.
*
* @return the native handle
* @throws AssertionError if the display has not been created yet.
*/
public static int getHandle() {
assert created : "The display has not been created yet.";
return handle;
}
/**
* Returns the operating system windowing platform. This will be one of the
* constants defined above. There is no "unknown" platform; a native library port
* has to provide a unique platform number for this mechanism to work. If the LWJGL
* is ported to, say, QNX, we will have a PLATFORM_QNX at the ready.
*
* @return the windowing system
*/
public static native int getPlatform();
/**
* Set the display configuration to the specified gamma, brightness and contrast.
* The configuration changes will be reset when resetDisplayMode is called.
*
* @param gamma The gamma value
* @param brightness The brightness value between -1.0 and 1.0, inclusive
* @param contrast The contrast, larger than 0.0.
* @return true if the call succeeded, false otherwise
*/
public static boolean setDisplayConfiguration(float gamma, float brightness, float contrast) {
assert brightness >= -1.0f && brightness <= 1.0f;
assert contrast >= 0.0f;
int rampSize = getGammaRampLength();
if (rampSize == 0)
return false;
FloatBuffer gammaRamp = ByteBuffer.allocateDirect(rampSize*4).order(ByteOrder.nativeOrder()).asFloatBuffer();
for (int i = 0; i < rampSize; i++) {
float intensity = (float)i/(rampSize - 1);
// apply gamma
float rampEntry = (float)java.lang.Math.pow(intensity, gamma);
// apply brightness
rampEntry += brightness;
// apply contrast
rampEntry = (rampEntry - 0.5f)*contrast + 0.5f;
// Clamp entry to [0, 1]
if (rampEntry > 1.0f)
rampEntry = 1.0f;
else if (rampEntry < 0.0f)
rampEntry = 0.0f;
gammaRamp.put(i, rampEntry);
}
if (!setGammaRamp(gammaRamp))
return false;
if (Sys.DEBUG) {
System.out.println("Gamma set, gamma = " + gamma + ", brightness = " + brightness + ", contrast = " + contrast);
}
return true;
}
/**
* Return the length of the gamma ramp arrays. Returns 0 if gamma settings are
* unsupported.
*
* @return the length of each gamma ramp array, or 0 if gamma settings are unsupported.
*/
private static native int getGammaRampLength();
/**
* Native method to set the gamma ramp.
*/
private static native boolean setGammaRamp(FloatBuffer gammaRamp);
}

View File

@ -0,0 +1,106 @@
/*
* Copyright (c) 2002 Light Weight Java Game Library 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 'Light Weight Java Game Library' 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;
/**
* $Id$
*
* This class encapsulates the properties for a given display mode.
* This class is not instantiable, and is aquired from the <code>Display.
* getAvailableDisplayModes()</code> method.
*
* @author cix_foo <cix_foo@users.sourceforge.net>
* @version $Revision$
*/
public final class DisplayMode {
/** properties of the display mode */
public final int width, height, bpp, freq;
/**
* Construct a display mode.
*
* @see Display
*/
private DisplayMode(int width, int height, int bpp, int freq) {
this.width = width;
this.height = height;
this.bpp = bpp;
this.freq = freq;
}
/**
* Tests for <code>DisplayMode</code> equality
*
* @see java.lang.Object#equals(Object)
*/
public boolean equals(Object obj) {
if (obj == null || !(obj instanceof DisplayMode)) {
return false;
}
DisplayMode dm = (DisplayMode) obj;
return dm.width == width
&& dm.height == dm.height
&& dm.bpp == bpp
&& dm.freq == freq;
}
/**
* Retrieves the hashcode for this object
*
* @see java.lang.Object#hashCode()
*/
public int hashCode() {
return width ^ height ^ freq ^ bpp;
}
/**
* Retrieves a String representation of this <code>DisplayMode</code>
*
* @see java.lang.Object#toString()
*/
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append(width);
sb.append(" x ");
sb.append(height);
sb.append(" x ");
sb.append(bpp);
sb.append(" @");
sb.append(freq);
sb.append("Hz");
return sb.toString();
}
}

View File

@ -0,0 +1,132 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.input;
import org.lwjgl.Sys;
import java.nio.IntBuffer;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
/**
* $Id$
*
* A class representing a native cursor. Instances of this
* class can be used with Mouse.setCursor(), if available.
*
* @author elias_naur <elias_naur@users.sourceforge.net>
* @version $Revision$
*/
public class Cursor {
static {
System.loadLibrary(Sys.getLibraryName());
}
/**
* The native handle to the cursor
*/
private final int nativeHandle;
/**
* Constructs a new Cursor, with the given parameters. Mouse must have been created before you can create
* Cursor objects. Cursor images are in ARGB format, but only one bit transparancy is guaranteed to be supported.
* So to maximize portability, lwjgl applications should only create cursor images with 0x00 or 0xff as alpha values.
* The constructor will copy the images and delays, so there's no need to keep them around.
*
* @param width cursor image width
* @param height cursor image height
* @param xHotspot the x coordinate of the cursor hotspot
* @param yHotspot the y coordinate of the cursor hotspot
* @param numImages number of cursor images specified. Must be 1 if animations are not supported.
* @param images A buffer containing the images. The origin is at the lower left corner, like OpenGL.
* @param delays An int buffer of animation frame delays, if numImages is greater than 1, else null
* @throws Exception if the cursor could not be created for any reason
*/
public Cursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays) throws Exception {
assert Mouse.isCreated();
assert width*height*numImages <= images.remaining(): "width*height*numImages > images.remaining()";
assert delays == null || numImages <= delays.remaining(): "delays != null && numImages > delays.remaining()";
assert xHotspot <= width && xHotspot >= 0: "xHotspot > width || xHotspot < 0";
assert yHotspot <= height && yHotspot >= 0: "yHotspot > height || yHotspot < 0";
IntBuffer images_copy = ByteBuffer.allocateDirect(images.remaining()*4).order(ByteOrder.nativeOrder()).asIntBuffer();
flipImages(width, height, numImages, images, images_copy);
nativeHandle = nCreateCursor(width, height, xHotspot, height - yHotspot, numImages, images_copy, 0, delays, delays != null ? delays.position() : 0);
}
private static void flipImages(int width, int height, int numImages, IntBuffer images, IntBuffer images_copy) {
for (int i = 0; i < numImages; i++) {
int start_index = i*width*height;
flipImage(width, height, start_index, images, images_copy);
}
}
private static void flipImage(int width, int height, int start_index, IntBuffer images, IntBuffer images_copy) {
for (int y = 0; y < height>>1; y++) {
int index_y_1 = y*width + start_index;
int index_y_2 = (height - y - 1)*width + start_index;
for (int x = 0; x < width; x++) {
int index1 = index_y_1 + x;
int index2 = index_y_2 + x;
int temp_pixel = images.get(index1 + images.position());
images_copy.put(index1, images.get(index2 + images.position()));
images_copy.put(index2, temp_pixel);
}
}
}
/**
* Destroy the native cursor. Cursor must not be current.
*/
public void destroy() {
nDestroyCursor(nativeHandle);
}
/**
* Gets the native handle associated with the cursor object.
*/
public int getHandle() {
return nativeHandle;
}
/**
* Native method to create a native cursor
*/
private static native int nCreateCursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, int images_offset, IntBuffer delays, int delays_offset);
/**
* Native method to destroy a native cursor
*/
private static native void nDestroyCursor(int handle);
}

View File

@ -0,0 +1,132 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Lightweight Java Game Library' 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;
/**
* $Id$
* <br>
* This is the OpenAL class. It extends the latest core.
*
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public abstract class AL extends CoreAL {
/** ALC instance. */
protected static ALC alc;
/** ALCdevice instance. */
protected static ALCdevice device;
/** Current ALCcontext. */
protected static ALCcontext context;
/**
* String that requests a certain device or device configuration.
* If null is specified, the implementation will provide an
* implementation specific default. */
protected static String deviceArguments;
/** Frequency for mixing output buffer, in units of Hz. */
protected static int contextFrequency = -1;
/** Refresh intervalls, in units of Hz. */
protected static int contextRefresh = -1;
/** Flag, indicating a synchronous context. */
protected static int contextSynchronized = ALC.ALC_FALSE;
/**
* Creates an OpenAL instance. Using this constructor will cause OpenAL to
* open the device using supplied device argument, and create a context using the context values
* supplied.
*
* @param deviceArguments Arguments supplied to native device
* @param contextFrequency Frequency for mixing output buffer, in units of Hz (Common values include 11025, 22050, and 44100).
* @param contextRefresh Refresh intervalls, in units of Hz.
* @param contextSynchronized Flag, indicating a synchronous context.*
*/
public static void create(String deviceArguments, int contextFrequency, int contextRefresh, boolean contextSynchronized)
throws OpenALException {
AL.deviceArguments = deviceArguments;
AL.contextFrequency = contextFrequency;
AL.contextRefresh = contextRefresh;
AL.contextSynchronized = contextSynchronized ? ALC.ALC_TRUE : ALC.ALC_FALSE;
create();
}
/**
* Creates an OpenAL instance. The empty create will cause OpenAL to
* open the default device, and create a context using default values.
*/
public static void create() throws OpenALException {
BaseAL.create();
ALC.create();
device = ALC.alcOpenDevice(deviceArguments);
//check if doing default values or not
if (contextFrequency == -1) {
context = ALC.alcCreateContext(device.device, null);
} else {
context =
ALC.alcCreateContext(
device.device,
ALCcontext.createAttributeList(contextFrequency, contextRefresh, contextSynchronized));
}
ALC.alcMakeContextCurrent(context.context);
}
/**
* Exit cleanly by calling destroy.
*/
public static void destroy() {
ALC.alcDestroyContext(context.context);
ALC.alcCloseDevice(device.device);
ALC.destroy();
device = null;
context = null;
deviceArguments = null;
contextFrequency = -1;
contextRefresh = -1;
contextSynchronized = ALC.ALC_FALSE;
BaseAL.destroy();
}
}

View File

@ -0,0 +1,413 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Lightweight Java Game Library' 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;
/**
* $Id$
*
* <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 <brian@matzon.dk>
* @version $Revision$
*/
public class ALC {
/** Has the ALC object been created? */
protected static boolean created;
/** 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 {
initialize();
}
/** Creates a new instance of ALC */
protected ALC() {
}
/**
* Override to provide any initialization code after creation.
*/
protected static void init() {
}
/**
* Static initialization
*/
private static void initialize() {
System.loadLibrary(org.lwjgl.Sys.getLibraryName());
}
/**
* Creates the ALC instance
*
* @throws Exception if a failiure occured in the ALC creation process
*/
protected static void create() throws OpenALException {
if (created) {
return;
}
if (!nCreate()) {
throw new OpenALException("ALC instance could not be created.");
}
init();
created = true;
}
/**
* Native method to create ALC instance
*
* @return true if the ALC creation process succeeded
*/
protected static native boolean nCreate();
/**
* Calls whatever destruction rutines that are needed
*/
protected static void destroy() {
if (!created) {
return;
}
created = false;
nDestroy();
}
/**
* Native method the destroy the ALC
*/
protected static native void nDestroy();
/**
* 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) {
return nalcGetString(AL.device.device, pname);
}
native static String nalcGetString(int 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) {
nalcGetIntegerv(AL.device.device, pname, integerdata.remaining(), integerdata, integerdata.position());
}
native static void nalcGetIntegerv(int 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(int 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
*/
native static ALCcontext alcCreateContext(int 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 boolean alcMakeContextCurrent(int 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);
}
native static void nalcProcessContext(int 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(int 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
*/
native static void alcSuspendContext(int 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(int 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(AL.device.device);
}
native static int nalcGetError(int 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) {
return nalcIsExtensionPresent(AL.device.device, extName);
}
native static boolean nalcIsExtensionPresent(int 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) {
return nalcGetEnumValue(AL.device.device, enumName);
}
native static int nalcGetEnumValue(int device, String enumName);
}

View File

@ -0,0 +1,73 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Lightweight Java Game Library' 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.*;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
/**
* $Id$
* <br>
* Wrapper class, to make ALC contexts behave like the orginal api.
*
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
final class ALCcontext {
/** address of actual context */
final int context;
/**
* Creates a new instance of ALCcontext
*
* @param context address of actual context
*/
ALCcontext(int context) {
this.context = context;
}
static IntBuffer createAttributeList(int contextFrequency, int contextRefresh, int contextSynchronized) {
IntBuffer attribList = ByteBuffer.allocateDirect(7*4).order(ByteOrder.nativeOrder()).asIntBuffer();
attribList.put(ALC.ALC_FREQUENCY);
attribList.put(contextFrequency);
attribList.put(ALC.ALC_REFRESH);
attribList.put(contextRefresh);
attribList.put(ALC.ALC_SYNC);
attribList.put(contextSynchronized);
attribList.put(0); //terminating int
return attribList;
}
}

View File

@ -0,0 +1,55 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Lightweight Java Game Library' 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;
/**
* $Id$
* <br>
* Wrapper class, to make ALC devices behave like the orginal api.
*
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
final class ALCdevice {
/** address of actual device */
final int device;
/**
* Creates a new instance of ALCdevice
*
* @param device address of actual device
*/
ALCdevice(int device) {
this.device = device;
}
}

View File

@ -0,0 +1,43 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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;
/**
* $Id$
* <br>
* This class contains all OpenAL constants, including extensions.
*
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public interface ALConstants extends BaseALConstants {
}

View File

@ -0,0 +1,190 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.io.File;
import java.util.StringTokenizer;
import java.lang.reflect.Method;
import org.lwjgl.Sys;
/**
* $Id$
* <br>
* The base AL functionality (no actual AL methods).
*
* This has been provided as a base class that we can use for either the
* full AL 1.0 specification or as a cut-down OpenAL embedded spec. (aka
* a mini-driver).
*
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public abstract class BaseAL {
/** Have we been created? */
protected static boolean created;
static {
initialize();
}
/**
* Override to provide any initialization code after creation.
*/
protected static void init() throws OpenALException {
}
/**
* Static initialization
*/
private static void initialize() {
System.loadLibrary(org.lwjgl.Sys.getLibraryName());
}
/**
* Creates the AL instance
*
* @throws Exception if a failiure occured in the AL creation process
*/
public static void create() throws OpenALException {
if (created) {
return;
}
// need to pass path of possible locations of OAL to native side
String libpath = System.getProperty("java.library.path");
String seperator = System.getProperty("path.separator");
String libname;
// libname is hardcoded atm - this will change in a near future...
libname =
(System.getProperty("os.name").toLowerCase().indexOf("windows") == -1)
? "libopenal.so"
: "lwjglaudio.dll";
// try to get path from JWS (if possible)
String jwsLibname =
(System.getProperty("os.name").toLowerCase().indexOf("windows") == -1)
? "openal"
: "lwjglaudio";
String jwsPath = getPathFromJWS(jwsLibname);
if (jwsPath != null) {
libpath += seperator
+ jwsPath.substring(0, jwsPath.lastIndexOf(File.separator));
}
StringTokenizer st = new StringTokenizer(libpath, seperator);
//create needed string array
String[] oalPaths = new String[st.countTokens() + 1];
//build paths
for (int i = 0; i < oalPaths.length - 1; i++) {
oalPaths[i] = st.nextToken() + File.separator + libname;
}
//add cwd path
oalPaths[oalPaths.length - 1] = libname;
if (!nCreate(oalPaths)) {
throw new OpenALException("AL instance could not be created.");
}
init();
created = true;
}
/**
* Tries to locate OpenAL from the JWS Library path
* This method exists because OpenAL is loaded from native code, and as such
* is exempt from JWS library loading rutines. OpenAL therefore always fails.
* We therefore invoke the protected method of the JWS classloader to see if it can
* locate it.
*
* @param libname Name of library to search for
* @return Absolute path to library if found, otherwise null
*/
private static String getPathFromJWS(String libname) {
try {
if(Sys.DEBUG) {
System.out.println("JWS Classloader looking for: " + libname);
}
Object o = BaseAL.class.getClassLoader();
Class c = o.getClass();
Method findLibrary =
c.getMethod("findLibrary", new Class[] { String.class });
Object[] arguments = new Object[] { libname };
return (String) findLibrary.invoke(o, arguments);
} catch (Exception e) {
if(Sys.DEBUG) {
System.out.println("Failure locating OpenAL using classloader:");
e.printStackTrace();
}
}
return null;
}
/**
* Native method to create AL instance
*
* @param oalPaths Array of strings containing paths to search for OpenAL library
* @return true if the AL creation process succeeded
*/
protected static native boolean nCreate(String[] oalPaths);
/**
* Calls whatever destruction rutines that are needed
*/
public static void destroy() {
if (!created) {
return;
}
created = false;
nDestroy();
}
/**
* Native method the destroy the AL
*/
protected static native void nDestroy();
/**
* @return true if AL has been created
*/
public static boolean isCreated() {
return created;
}
}

View File

@ -0,0 +1,350 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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;
/**
* $Id$
* <br>
* This class implements all basic OpenAL constants.
*
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public interface BaseALConstants {
/** Bad value */
public static final int AL_INVALID = -1;
/** Disable value */
public static final int AL_NONE = 0;
/** Boolean False */
public static final int AL_FALSE = 0;
/** Boolean True */
public static final int AL_TRUE = 1;
/**
* Indicate the type of SOURCE.
* Sources can be spatialized
*/
public static final int AL_SOURCE_TYPE = 0x200;
/** Indicate source has absolute coordinates */
public static final int AL_SOURCE_ABSOLUTE = 0x201;
/** Indicate Source has listener relative coordinates */
public static final int AL_SOURCE_RELATIVE = 0x202;
/**
* Directional source, inner cone angle, in degrees
* Range: [0-360]
* Default: 360
*/
public static final int AL_CONE_INNER_ANGLE = 0x1001;
/**
* Directional source, outer cone angle, in degrees.
* Range: [0-360]
* Default: 360
*/
public static final int AL_CONE_OUTER_ANGLE = 0x1002;
/**
* Specify the pitch to be applied, either at source,
* or on mixer results, at listener.
* Range: [0.5-2.0]
* Default: 1.0
*/
public static final int AL_PITCH = 0x1003;
/**
* Specify the current location in three dimensional space.
* OpenAL, like OpenGL, uses a right handed coordinate system,
* where in a frontal default view X (thumb) points right,
* Y points up (index finger), and Z points towards the
* viewer/camera (middle finger).
* To switch from a left handed coordinate system, flip the
* sign on the Z coordinate.
* Listener position is always in the world coordinate system.
*/
public static final int AL_POSITION = 0x1004;
/** Specify the current direction as forward vector. */
public static final int AL_DIRECTION = 0x1005;
/** Specify the current velocity in three dimensional space. */
public static final int AL_VELOCITY = 0x1006;
/**
* Indicate whether source has to loop infinite.
* Type: ALboolean
* Range: [TRUE, FALSE]
* Default: FALSE
*/
public static final int AL_LOOPING = 0x1007;
/**
* Indicate the buffer to provide sound samples.
* Type: ALuint.
* Range: any valid Buffer id.
*/
public static final int AL_BUFFER = 0x1009;
/**
* Indicate the gain (volume amplification) applied.
* Type: ALfloat.
* Range: ]0.0- ]
* A value of 1.0 means un-attenuated/unchanged.
* Each division by 2 equals an attenuation of -6dB.
* Each multiplicaton with 2 equals an amplification of +6dB.
* A value of 0.0 is meaningless with respect to a logarithmic
* scale; it is interpreted as zero volume - the channel
* is effectively disabled.
*/
public static final int AL_GAIN = 0x100A;
/**
* Indicate minimum source attenuation.
* Type: ALfloat
* Range: [0.0 - 1.0]
*/
public static final int AL_MIN_GAIN = 0x100D;
/**
* Indicate maximum source attenuation.
* Type: ALfloat
* Range: [0.0 - 1.0]
*/
public static final int AL_MAX_GAIN = 0x100E;
/**
* Specify the current orientation.
* Type: ALfv6 (at/up)
* Range: N/A
*/
public static final int AL_ORIENTATION = 0x100F;
/* byte offset into source (in canon format). -1 if source
* is not playing. Don't set this, get this.
*
* Type: ALfloat
* Range: [0.0 - ]
* Default: 1.0
*/
public static final int AL_REFERENCE_DISTANCE = 0x1020;
/**
* Indicate the rolloff factor for the source.
* Type: ALfloat
* Range: [0.0 - ]
* Default: 1.0
*/
public static final int AL_ROLLOFF_FACTOR = 0x1021;
/**
* Indicate the gain (volume amplification) applied.
* Type: ALfloat.
* Range: ]0.0- ]
* A value of 1.0 means un-attenuated/unchanged.
* Each division by 2 equals an attenuation of -6dB.
* Each multiplicaton with 2 equals an amplification of +6dB.
* A value of 0.0 is meaningless with respect to a logarithmic
* scale; it is interpreted as zero volume - the channel
* is effectively disabled.
*/
public static final int AL_CONE_OUTER_GAIN = 0x1022;
/**
* Specify the maximum distance.
* Type: ALfloat
* Range: [0.0 - ]
*/
public static final int AL_MAX_DISTANCE = 0x1023;
/**
* Specify the channel mask. (Creative)
* Type: ALuint
* Range: [0 - 255]
*/
public static final int AL_CHANNEL_MASK = 0x3000;
/** Source state information */
public static final int AL_SOURCE_STATE = 0x1010;
/** Source state information */
public static final int AL_INITIAL = 0x1011;
/** Source state information */
public static final int AL_PLAYING = 0x1012;
/** Source state information */
public static final int AL_PAUSED = 0x1013;
/** Source state information */
public static final int AL_STOPPED = 0x1014;
/** Buffer Queue params */
public static final int AL_BUFFERS_QUEUED = 0x1015;
/** Buffer Queue params */
public static final int AL_BUFFERS_PROCESSED = 0x1016;
/** Sound buffers: format specifier. */
public static final int AL_FORMAT_MONO8 = 0x1100;
/** Sound buffers: format specifier. */
public static final int AL_FORMAT_MONO16 = 0x1101;
/** Sound buffers: format specifier. */
public static final int AL_FORMAT_STEREO8 = 0x1102;
/** Sound buffers: format specifier. */
public static final int AL_FORMAT_STEREO16 = 0x1103;
/**
* Sound buffers: frequency, in units of Hertz [Hz].
* This is the number of samples per second. Half of the
* sample frequency marks the maximum significant
* frequency component.
*/
public static final int AL_FREQUENCY = 0x2001;
/**
* Sound buffers: frequency, in units of Hertz [Hz].
* This is the number of samples per second. Half of the
* sample frequency marks the maximum significant
* frequency component.
*/
public static final int AL_BITS = 0x2002;
/**
* Sound buffers: frequency, in units of Hertz [Hz].
* This is the number of samples per second. Half of the
* sample frequency marks the maximum significant
* frequency component.
*/
public static final int AL_CHANNELS = 0x2003;
/**
* Sound buffers: frequency, in units of Hertz [Hz].
* This is the number of samples per second. Half of the
* sample frequency marks the maximum significant
* frequency component.
*/
public static final int AL_SIZE = 0x2004;
/**
* Sound buffers: frequency, in units of Hertz [Hz].
* This is the number of samples per second. Half of the
* sample frequency marks the maximum significant
* frequency component.
*/
public static final int AL_DATA = 0x2005;
/**
* Buffer state.
*
* Not supported for public use (yet).
*/
public static final int AL_UNUSED = 0x2010;
/**
* Buffer state.
*
* Not supported for public use (yet).
*/
public static final int AL_PENDING = 0x2011;
/**
* Buffer state.
*
* Not supported for public use (yet).
*/
public static final int AL_PROCESSED = 0x2012;
/** Errors: No Error. */
public static final int AL_NO_ERROR = AL_FALSE;
/** Illegal name passed as an argument to an AL call. */
public static final int AL_INVALID_NAME = 0xA001;
/** Illegal enum passed as an argument to an AL call. */
public static final int AL_INVALID_ENUM = 0xA002;
/**
* Illegal value passed as an argument to an AL call.
* Applies to parameter values, but not to enumerations.
*/
public static final int AL_INVALID_VALUE = 0xA003;
/**
* 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 AL_INVALID_OPERATION = 0xA004;
/**
* A function could not be completed,
* because there is not enough memory available.
*/
public static final int AL_OUT_OF_MEMORY = 0xA005;
/** Context strings: Vendor */
public static final int AL_VENDOR = 0xB001;
/** Context strings: Version */
public static final int AL_VERSION = 0xB002;
/** Context strings: Renderer */
public static final int AL_RENDERER = 0xB003;
/** Context strings: Extensions */
public static final int AL_EXTENSIONS = 0xB004;
/** Doppler scale. Default 1.0 */
public static final int AL_DOPPLER_FACTOR = 0xC000;
/** Doppler velocity. Default 1.0 */
public static final int AL_DOPPLER_VELOCITY = 0xC001;
/** Distance model. Default INVERSE_DISTANCE_CLAMPED */
public static final int AL_DISTANCE_MODEL = 0xD000;
/** Distance model */
public static final int AL_INVERSE_DISTANCE = 0xD001;
/** Distance model */
public static final int AL_INVERSE_DISTANCE_CLAMPED = 0xD002;
}

View File

@ -0,0 +1,878 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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 java.nio.FloatBuffer;
/**
* $Id$
* <br>
* This is the core OpenAL class. This class implements
* AL.h version 1.0
*
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public abstract class CoreAL extends BaseAL implements BaseALConstants {
/**
* The application can temporarily disable certain AL capabilities on a per Context
* basis. This allows the driver implementation to optimize for certain subsets of
* operations. Enabling and disabling capabilities is handled using a function pair.
*
* @param capability name of a capability to enable
*/
public static native void alEnable(int capability);
/**
* The application can temporarily disable certain AL capabilities on a per Context
* basis. This allows the driver implementation to optimize for certain subsets of
* operations. Enabling and disabling capabilities is handled using a function pair.
*
* @param capability name of a capability to disable
*/
public static native void alDisable(int capability);
/**
* The application can also query whether a given capability is currently enabled or
* not.
* <p>
* If the token used to specify target is not legal, an AL_INVALID_ENUM error will be
* generated.
* </p>
* <p>
* At this time, this mechanism is not used. There are no valid targets.
* </p>
*
* @param capability name of a capability to check
* @return true if named feature is enabled
*/
public static native boolean alIsEnabled(int capability);
/**
* Hinting for implementation
* NOTE: This method is a NOP, but is provided for completeness.
*
* @param target The target to hint
* @param mode Mode to hint
*/
public static native void alHint(int target, int mode);
/**
* Like OpenGL, AL uses a simplified interface for querying global state.
*
* Legal values are e.g. AL_DOPPLER_FACTOR, AL_DOPPLER_VELOCITY,
* AL_DISTANCE_MODEL.
* <p>
* <code>null</code> destinations are quietly ignored. AL_INVALID_ENUM is the response to errors
* in specifying pName. The amount of memory required in the destination
* depends on the actual state requested.
* </p>
*
* @return boolean state described by pname will be returned.
*/
public static native boolean alGetBoolean(int pname);
/**
* Like OpenGL, AL uses a simplified interface for querying global state.
*
* Legal values are e.g. AL_DOPPLER_FACTOR, AL_DOPPLER_VELOCITY,
* AL_DISTANCE_MODEL.
* <p>
* <code>null</code> destinations are quietly ignored. AL_INVALID_ENUM is the response to errors
* in specifying pName. The amount of memory required in the destination
* depends on the actual state requested.
* </p>
*
* @return int state described by pname will be returned.
*/
public static native int alGetInteger(int pname);
/**
* Like OpenGL, AL uses a simplified interface for querying global state.
*
* Legal values are e.g. AL_DOPPLER_FACTOR, AL_DOPPLER_VELOCITY,
* AL_DISTANCE_MODEL.
* <p>
* <code>null</code> destinations are quietly ignored. AL_INVALID_ENUM is the response to errors
* in specifying pName. The amount of memory required in the destination
* depends on the actual state requested.
* </p>
*
* @return float state described by pname will be returned.
*/
public static native float alGetFloat(int pname);
private static native void nalGetBooleanv(int pname, ByteBuffer data, int offset);
/**
* Like OpenGL, AL uses a simplified interface for querying global state.
*
* Legal values are e.g. AL_DOPPLER_FACTOR, AL_DOPPLER_VELOCITY,
* AL_DISTANCE_MODEL.
* <p>
* <code>null</code> destinations are quietly ignored. AL_INVALID_ENUM is the response to errors
* in specifying pName. The amount of memory required in the destination
* depends on the actual state requested.
* </p>
*
* @param pname state to be queried
* @param data Buffer to place the integers in
*/
public static void alGetInteger(int pname, IntBuffer data) {
assert data.remaining() > 0;
nalGetIntegerv(pname, data, data.position());
}
private static native void nalGetIntegerv(int pname, IntBuffer data, int offset);
/**
* Like OpenGL, AL uses a simplified interface for querying global state.
*
* Legal values are e.g. AL_DOPPLER_FACTOR, AL_DOPPLER_VELOCITY,
* AL_DISTANCE_MODEL.
* <p>
* <code>null</code> destinations are quietly ignored. AL_INVALID_ENUM is the response to errors
* in specifying pName. The amount of memory required in the destination
* depends on the actual state requested.
* </p>
*
* @param pname state to be queried
* @param data Buffer to place the floats in
*/
public static void alGetFloat(int pname, FloatBuffer data) {
assert data.remaining() > 0;
nalGetFloatv(pname, data, data.position());
}
private static native void nalGetFloatv(int pname, FloatBuffer data, int position);
/**
* The application can retrieve state information global to the current AL Context.
* GetString will return a pointer to a constant string. Valid values for param are
* VERSION, RENDERER, VENDOR, and EXTENSIONS, as well as the error codes
* defined by AL. The application can use GetString to retrieve a string for an error
* code.
*
* @param pname The property to be returned
* @return OpenAL String property
*/
public static native String alGetString(int pname);
/**
* The AL detects only a subset of those conditions that could be considered errors.
* This is because in many cases error checking would adversely impact the
* performance of an error-free program.
* <p>
* Each detectable error is assigned a numeric
* code. When an error is detected by AL, a flag is set and the error code is recorded.
* Further errors, if they occur, do not affect this recorded code. When GetError is
* called, the code is returned and the flag is cleared, so that a further error will again
* record its code. If a call to GetError returns AL_NO_ERROR then there has been no
* detectable error since the last call to GetError (or since the AL was initialized).
* </p>
* <p>
* Error codes can be mapped to strings. The GetString function returns a pointer to a
* constant (literal) string that is identical to the identifier used for the enumeration
* value, as defined in the specification.
* </p>
* <p>
* AL_NO_ERROR - "No Error" token.<br>
* AL_INVALID_NAME - Invalid Name parameter.<br>
* AL_INVALID_ENUM - Invalid parameter.<br>
* AL_INVALID_VALUE - Invalid enum parameter value.<br>
* AL_INVALID_OPERATION - Illegal call.<br>
* AL_OUT_OF_MEMORY - Unable to allocate memory.<br>
* </p>
* <p>
* The table summarizes the AL errors. Currently, when an error flag is set, results of
* AL operations are undefined only if AL_OUT_OF_MEMORY has occured. In other
* cases, the command generating the error is ignored so that it has no effect on AL
* state or output buffer contents. If the error generating command returns a value, it
* returns zero. If the generating command modifies values through a pointer
* argument, no change is made to these values. These error semantics apply only to
* AL errors, not to system errors such as memory access errors.
* </p>
* <p>
* Several error generation conditions are implicit in the description of the various AL
* commands. First, if a command that requires an enumerated value is passed a value
* that is not one of those specified as allowable for that command, the error
* AL_INVALID_ENUM results. This is the case even if the argument is a pointer to a
* symbolic constant if that value is not allowable for the given command. This will
* occur whether the value is allowable for other functions, or an invalid integer value.
* </p>
* <p>
* Integer parameters that are used as names for AL objects such as Buffers and
* Sources are checked for validity. If an invalid name parameter is specified in an AL
* command, an AL_INVALID_NAME error will be generated, and the command is
* ignored.
* </p>
* <p>
* If a negative integer is provided where an argument of type sizei is specified, the
* error AL_INVALID_VALUE results. The same error will result from attempts to set
* integral and floating point values for attributes exceeding the legal range for these.
* The specification does not guarantee that the implementation emits
* AL_INVALID_VALUE if a NaN or Infinity value is passed in for a float or double
* argument (as the specification does not enforce possibly expensive testing of
* floating point values).
* </p>
* <p>
* Commands can be invalid. For example, certain commands might not be applicable
* to a given object. There are also illegal combinations of tokens and values as
* arguments to a command. AL responds to any such illegal command with an
* AL_INVALID_OPERATION error.
* </p>
* <p>
* If memory is exhausted as a side effect of the execution of an AL command, either
* on system level or by exhausting the allocated resources at AL's internal disposal,
* the error AL_OUT_OF_MEMORY may be generated. This can also happen independent
* of recent commands if AL has to request memory for an internal task and fails to
* allocate the required memory from the operating system.
* </p>
* <p>
* Otherwise errors are generated only for conditions that are explicitely described in
* this specification.
* </p>
*
* @return current error state
*/
public static native int alGetError();
/**
* To verify that a given extension is available for the current context and the device it
* is associated with, use this method.
* <p>
* A <code>null</code> name argument returns AL_FALSE, as do invalid and unsupported string
* tokens. A <code>null</code> deviceHandle will result in an INVALID_DEVICE error.
* </p>
*
* @param fname String describing the desired extension
* @return true if extension is available, false if not
*/
public static native boolean alIsExtensionPresent(String fname);
/**
* <p>
* To obtain enumeration values for extensions, the application has to use
* GetEnumValue of an extension token. Enumeration values are defined within the
* AL namespace and allocated according to specification of the core API and the
* extensions, thus they are context-independent.
* </p>
* <p>
* Returns 0 if the enumeration can not be found. The presence of an enum value does
* not guarantee the applicability of an extension to the current context. A non-zero
* return indicates merely that the implementation is aware of the existence of this
* extension. Implementations should not attempt to return 0 to indicate that the
* extensions is not supported for the current context.
* </p>
*
* @param ename String describing an OpenAL enum
* @return Actual int for the described enumeration name
*/
public static native int alGetEnumValue(String ename);
/**
* Listener attributes are changed using the Listener group of commands.
*
* @param pname name of the attribute to be set
* @param value value to set the attribute to
*/
public static native void alListeneri(int pname, int value);
/**
* Listener attributes are changed using the Listener group of commands.
*
* @param pname name of the attribute to be set
* @param value floating point value to set the attribute to
*/
public static native void alListenerf(int pname, float value);
/**
* 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 float value 3
*/
public static native void alListener3f(int pname, float v1, float v2, float v3);
/**
* Listener state is maintained inside the AL implementation and can be queried in
* full.
*
* @param pname name of the attribute to be retrieved
* @return int
*/
public static native int alGetListeneri(int pname);
/**
* Listener state is maintained inside the AL implementation and can be queried in
* full.
*
* @param pname name of the attribute to be retrieved
* @return float
*/
public static native float alGetListenerf(int pname);
/**
* Listener state is maintained inside the AL implementation and can be queried in
* full.
*
* @param pname name of the attribute to be retrieved
* @param floatdata Buffer to write floats to
*/
public static void alGetListener(int pname, FloatBuffer floatdata) {
nalGetListenerfv(pname, floatdata, floatdata.position());
}
private static native void nalGetListenerfv(int pname, FloatBuffer floatdata, int offset);
/**
* The application requests a number of Sources using GenSources.
*
* @param sources array holding sources
*/
public static void alGenSources(IntBuffer sources) {
nalGenSources(sources.remaining(), sources, sources.position());
}
private static native void nalGenSources(int n, IntBuffer sources, int offset);
/**
* The application requests deletion of a number of Sources by DeleteSources.
*
* @param source Source array to delete from
*/
public static void alDeleteSources(IntBuffer source) {
nalDeleteSources(source.remaining(), source, source.position());
}
private static native void nalDeleteSources(int n, IntBuffer source, int offset);
/**
* The application can verify whether a source name is valid using the IsSource query.
*
* @param id id of source to be testes for validity
* @return true if id is valid, false if not
*/
public static native boolean alIsSource(int id);
/**
* Specifies the position and other properties as taken into account during
* sound processing.
*
* @param source Source to det property on
* @param pname property to set
* @param value value of property
*/
public static native void alSourcei(int source, int pname, int value);
/**
* Specifies the position and other properties as taken into account during
* sound processing.
*
* @param source Source to det property on
* @param pname property to set
* @param value value of property
*/
public static native void alSourcef(int source, int pname, float value);
/**
* 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
*/
public static native void alSource3f(
int source,
int pname,
float v1,
float v2,
float v3);
/**
* Source state is maintained inside the AL implementation, and the current attributes
* can be queried. The performance of such queries is implementation dependent, no
* performance guarantees are made.
*
* @param source source to get property from
* @param pname name of property
* @return int
*/
public static native int alGetSourcei(int source, int pname);
/**
* Source state is maintained inside the AL implementation, and the current attributes
* can be queried. The performance of such queries is implementation dependent, no
* performance guarantees are made.
*
* @param source source to get property from
* @param pname name of property
* @return float
*/
public static native float alGetSourcef(int source, int pname);
/**
* Source state is maintained inside the AL implementation, and the current attributes
* can be queried. The performance of such queries is implementation dependent, no
* performance guarantees are made.
*
* @param source Source to get property from
* @param pname property to get
* @param floatdata Buffer to write floats to
*/
public static void alGetSource(int source, int pname, FloatBuffer floatdata) {
assert floatdata.remaining() > 0;
nalGetSourcefv(source, pname, floatdata, floatdata.position());
}
private static native void nalGetSourcefv(int source, int pname, FloatBuffer floatdata, int position);
/**
* Play() applied to an AL_INITIAL Source will promote the Source to AL_PLAYING, thus
* the data found in the Buffer will be fed into the processing, starting at the
* beginning. Play() applied to a AL_PLAYING Source will restart the Source from the
* beginning. It will not affect the configuration, and will leave the Source in
* AL_PLAYING state, but reset the sampling offset to the beginning. Play() applied to a
* AL_PAUSED Source will resume processing using the Source state as preserved at the
* Pause() operation. Play() applied to a AL_STOPPED Source will propagate it to
* AL_INITIAL then to AL_PLAYING immediately.
*
* @param sources array of sources to play
*/
public static void alSourcePlay(int n, IntBuffer sources) {
nalSourcePlayv(sources.remaining(), sources, sources.position());
}
private static native void nalSourcePlayv(int n, IntBuffer sources, int offset);
/**
* Pause() applied to an AL_INITIAL Source is a legal NOP. Pause() applied to a
* AL_PLAYING Source will change its state to AL_PAUSED. The Source is exempt from
* processing, its current state is preserved. Pause() applied to a AL_PAUSED Source is a
* legal NOP. Pause() applied to a AL_STOPPED Source is a legal NOP.
*
* @param sources array of sources to pause
*/
public static void alSourcePause(IntBuffer sources) {
nalSourcePausev(sources.remaining(), sources, sources.position());
}
private static native void nalSourcePausev(int n, IntBuffer sources, int offset);
/**
* Stop() applied to an AL_INITIAL Source is a legal NOP. Stop() applied to a AL_PLAYING
* Source will change its state to AL_STOPPED. The Source is exempt from processing,
* its current state is preserved. Stop() applied to a AL_PAUSED Source will change its
* state to AL_STOPPED, with the same consequences as on a AL_PLAYING Source. Stop()
* applied to a AL_STOPPED Source is a legal NOP.
*
* @param sources array of sources to stop
*/
public static void alSourceStop(IntBuffer sources) {
nalSourceStopv(sources.remaining(), sources, sources.position());
}
private static native void nalSourceStopv(int n, IntBuffer sources, int offset);
/**
* Rewind() applied to an AL_INITIAL Source is a legal NOP. Rewind() applied to a
* AL_PLAYING Source will change its state to AL_STOPPED then AL_INITIAL. The Source is
* exempt from processing, its current state is preserved, with the exception of the
* sampling offset which is reset to the beginning. Rewind() applied to a AL_PAUSED
* Source will change its state to AL_INITIAL, with the same consequences as on a
* AL_PLAYING Source. Rewind() applied to a AL_STOPPED Source promotes the Source to
* AL_INITIAL, resetting the sampling offset to the beginning.
*
* @param n number of sources to rewind
* @param sources array of sources to rewind
*/
public static void alSourceRewind(IntBuffer sources) {
nalSourceRewindv(sources.remaining(), sources, sources.position());
}
private static native void nalSourceRewindv(int n, IntBuffer sources, int offset);
/**
* Play() applied to an AL_INITIAL Source will promote the Source to AL_PLAYING, thus
* the data found in the Buffer will be fed into the processing, starting at the
* beginning. Play() applied to a AL_PLAYING Source will restart the Source from the
* beginning. It will not affect the configuration, and will leave the Source in
* AL_PLAYING state, but reset the sampling offset to the beginning. Play() applied to a
* AL_PAUSED Source will resume processing using the Source state as preserved at the
* Pause() operation. Play() applied to a AL_STOPPED Source will propagate it to
* AL_INITIAL then to AL_PLAYING immediately.
*
* @param source Source to play
*/
public static native void alSourcePlay(int source);
/**
* Pause() applied to an AL_INITIAL Source is a legal NOP. Pause() applied to a
* AL_PLAYING Source will change its state to AL_PAUSED. The Source is exempt from
* processing, its current state is preserved. Pause() applied to a AL_PAUSED Source is a
* legal NOP. Pause() applied to a AL_STOPPED Source is a legal NOP.
*
* @param source Source to pause
*/
public static native void alSourcePause(int source);
/**
* Stop() applied to an AL_INITIAL Source is a legal NOP. Stop() applied to a AL_PLAYING
* Source will change its state to AL_STOPPED. The Source is exempt from processing,
* its current state is preserved. Stop() applied to a AL_PAUSED Source will change its
* state to AL_STOPPED, with the same consequences as on a AL_PLAYING Source. Stop()
* applied to a AL_STOPPED Source is a legal NOP.
*
* @param source Source to stop
*/
public static native void alSourceStop(int source);
/**
* Rewind() applied to an AL_INITIAL Source is a legal NOP. Rewind() applied to a
* AL_PLAYING Source will change its state to AL_STOPPED then AL_INITIAL. The Source is
* exempt from processing, its current state is preserved, with the exception of the
* sampling offset which is reset to the beginning. Rewind() applied to a AL_PAUSED
* Source will change its state to AL_INITIAL, with the same consequences as on a
* AL_PLAYING Source. Rewind() applied to a AL_STOPPED Source promotes the Source to
* AL_INITIAL, resetting the sampling offset to the beginning.
*
* @param source Source to rewind
*/
public static native void alSourceRewind(int source);
/**
* The application requests a number of Buffers using GenBuffers.
*
* @param buffers holding buffers
*/
public static void alGenBuffers(IntBuffer buffers) {
nalGenBuffers(buffers.remaining(), buffers, buffers.position());
}
private static native void nalGenBuffers(int n, IntBuffer buffers, int offset);
/**
* <p>
* The application requests deletion of a number of Buffers by calling DeleteBuffers.
* </p>
* <p>
* Once deleted, Names are no longer valid for use with AL function calls. Any such
* use will cause an AL_INVALID_NAME error. The implementation is free to defer actual
* release of resources.
* </p>
* <p>
* IsBuffer(bname) can be used to verify deletion of a buffer. Deleting bufferName 0 is
* a legal NOP in both scalar and vector forms of the command. The same is true for
* unused buffer names, e.g. such as not allocated yet, or as released already.
*
* @param buffers Buffer to delete from
*/
public static void alDeleteBuffers(IntBuffer buffers) {
nalDeleteBuffers(buffers.remaining(), buffers, buffers.position());
}
private static native void nalDeleteBuffers(int n, IntBuffer buffers, int offset);
/**
* The application can verify whether a buffer Name is valid using the IsBuffer query.
*
* @param buffer buffer to be tested for validity
* @return true if supplied buffer is valid, false if not
*/
public static native boolean alIsBuffer(int buffer);
/**
* <p>
* A special case of Buffer state is the actual sound sample data stored in asociation
* with the Buffer. Applications can specify sample data using BufferData.
* </p>
* <p>
* The data specified is copied to an internal software, or if possible, hardware buffer.
* The implementation is free to apply decompression, conversion, resampling, and
* filtering as needed. The internal format of the Buffer is not exposed to the
* application, and not accessible. Valid formats are AL_FORMAT_MONO8,
* AL_FORMAT_MONO16, AL_FORMAT_STEREO8, and AL_FORMAT_STEREO16. An
* implementation may expose other formats, see the chapter on Extensions for
* information on determining if additional formats are supported.
* </p>
* <p>
* Applications should always check for an error condition after attempting to specify
* buffer data in case an implementation has to generate an AL_OUT_OF_MEMORY or
* conversion related AL_INVALID_VALUE error. The application is free to reuse the
* memory specified by the data pointer once the call to BufferData returns. The
* implementation has to dereference, e.g. copy, the data during BufferData execution.
* </p>
*
* @param buffer Buffer to fill
* @param format format sound data is in
* @param data location of data
* @param freq frequency of data
*/
public static void alBufferData(
int buffer,
int format,
ByteBuffer data,
int size,
int freq) {
// TODO: add an assertion here?
nalBufferData(buffer, format, data, data.position(), data.remaining(), freq);
}
private static native void nalBufferData(
int buffer,
int format,
ByteBuffer data,
int offset,
int size,
int freq);
/**
* Buffer state is maintained inside the AL implementation and can be queried in full.<br>
* ALC_FREQUENCY - specified in samples per second, i.e. units of Hertz [Hz].<br>
* ALC_SIZE - Size in bytes of the buffer data.<br>
*
* @param buffer buffer to get property from
* @param pname name of property to retrieve
* @param int
*/
public static native int alGetBufferi(int buffer, int pname);
/**
* Buffer state is maintained inside the AL implementation and can be queried in full.<br>
* ALC_FREQUENCY - specified in samples per second, i.e. units of Hertz [Hz].<br>
* ALC_SIZE - Size in bytes of the buffer data.<br>
*
* @param buffer buffer to get property from
* @param pname name of property to retrieve
* @return float
*/
public static native float alGetBufferf(int buffer, int pname);
/**
* <p>
* The application can queue up one or multiple buffer names using
* SourceQueueBuffers. The buffers will be queued in the sequence in which they
* appear in the array.
* </p>
* <p>
* This command is legal on a Source in any state (to allow for streaming, queueing
* has to be possible on a AL_PLAYING Source). Queues are read-only with exception of
* the unqueue operation. The Buffer Name AL_NONE (i.e. 0) can be queued.
* </p>
*
* @param source source to queue buffers onto
* @param buffers buffers to be queued
*/
public static void alSourceQueueBuffers(int source, IntBuffer buffers) {
nalSourceQueueBuffers(source, buffers.remaining(), buffers, buffers.position());
}
private static native void nalSourceQueueBuffers(int source, int n, IntBuffer buffers, int offset);
/**
* <p>
* Once a queue entry for a buffer has been appended to a queue and is pending
* processing, it should not be changed. Removal of a given queue entry is not possible
* unless either the Source is AL_STOPPED (in which case then entire queue is considered
* processed), or if the queue entry has already been processed (AL_PLAYING or AL_PAUSED
* Source).
* </p>
* <p>
* The Unqueue command removes a number of buffers entries that have nished
* processing, in the order of appearance, from the queue. The operation will fail if
* more buffers are requested than available, leaving the destination arguments
* unchanged. An AL_INVALID_VALUE error will be thrown. If no error, the destination
* argument will have been updated accordingly.
* </p>
*
* @param source source to unqueue buffers from
* @param buffers buffers to be unqueued
*/
public static void alSourceUnqueueBuffers(int source, IntBuffer buffers) {
nalSourceUnqueueBuffers(source, buffers.remaining(), buffers, buffers.position());
}
private static native void nalSourceUnqueueBuffers(int source, int n, IntBuffer buffers, int offset);
/**
* <p>
* Samples usually use the entire dynamic range of the chosen format/encoding,
* independent of their real world intensity. In other words, a jet engine and a
* clockwork both will have samples with full amplitude. The application will then
* have to adjust Source AL_GAIN accordingly to account for relative differences.
* </p>
* <p>
* Source AL_GAIN is then attenuated by distance. The effective attenuation of a Source
* depends on many factors, among which distance attenuation and source and
* Listener AL_GAIN are only some of the contributing factors. Even if the source and
* Listener AL_GAIN exceed 1.0 (amplification beyond the guaranteed dynamic range),
* distance and other attenuation might ultimately limit the overall AL_GAIN to a value
* below 1.0.
* </p>
* <p>
* AL currently supports three modes of operation with respect to distance
* attenuation. It supports two distance-dependent attenuation models, one which is
* similar to the IASIG I3DL2 (and DS3D) model. The application choses one of these
* two models (or can chose to disable distance-dependent attenuation effects model)
* on a per-context basis.
* </p>
* <p>
* Legal arguments are AL_NONE, AL_INVERSE_DISTANCE, and
* AL_INVERSE_DISTANCE_CLAMPED.
* <br>
* <br>
* AL_NONE bypasses all distance attenuation
* calculation for all Sources. The implementation is expected to optimize this
* situation.
* <br>
* <br>
* AL_INVERSE_DISTANCE_CLAMPED is the DS3D model, with
* AL_REFERENCE_DISTANCE indicating both the reference distance and the distance
* below which gain will be clamped.
* <br>
* <br>
* AL_INVERSE_DISTANCE is equivalent to the DS3D
* model with the exception that AL_REFERENCE_DISTANCE does not imply any
* clamping.
* <br>
* <br>
* The AL implementation is still free to apply any range clamping as
* necessary. The current distance model chosen can be queried using GetIntegerv and
* AL_DISTANCE_MODEL.
* </p>
*
* @param value distance model to be set
*/
public static native void alDistanceModel(int value);
/**
* The Doppler Effect depends on the velocities of Source and Listener relative to the
* medium, and the propagation speed of sound in that medium. The application
* might want to emphasize or de-emphasize the Doppler Effect as physically accurate
* calculation might not give the desired results. The amount of frequency shift (pitch
* change) is proportional to the speed of listener and source along their line of sight.
* The application can increase or decrease that frequency shift by specifying the
* scaling factor AL should apply to the result of the calculation.
* <br>
* <br>
* The Doppler Effect as implemented by AL is described by the formula below. Effects
* of the medium (air, water) moving with respect to listener and source are ignored.
* AL_DOPPLER_VELOCITY is the propagation speed relative to which the Source
* velocities are interpreted.
*
* <p>
* <pre>
* VD: AL_DOPPLER_VELOCITY
* DF: AL_DOPPLER_FACTOR
* vl: Listener velocity (scalar, projected on source-listener vector)
* vs: Source verlocity (scalar, projected on source-listener vector)
* f: Frequency in sample
* f': effective Doppler shifted frequency
*
* f' = DF * f * (VD-vl)/(VD+vs)
*
* vl<0, vs>0 : source and listener approaching each other
* vl>0, vs<0 : source and listener moving away from each other
* </pre>
* </p>
* <p>
* The implementation has to clamp the projected Listener velocity vl, if abs(vl) is
* greater or equal VD. It similarly has to clamp the projected Source velocity vs if
* abs(vs) is greater or equal VD.
* </p>
* <p>
* There are two API calls global to the current context that provide control of the two
* related parameters.
* </p>
* <p>
* AL_DOPPLER_FACTOR is a simple scaling to exaggerate or
* deemphasize the Doppler (pitch) shift resulting from the calculation.
* </p>
* <p>
* A negative value will result in an AL_INVALID_VALUE error, the command is then
* ignored. The default value is 1. The current setting can be queried using GetFloatv
* and AL_DOPPLER_FACTOR. The implementation is free to optimize the case of
* AL_DOPPLER_FACTOR being set to zero, as this effectively disables the effect.
* </p>
*
* @param value Doppler scale value to set
*/
public static native void alDopplerFactor(float value);
/**
* The Doppler Effect depends on the velocities of Source and Listener relative to the
* medium, and the propagation speed of sound in that medium. The application
* might want to emphasize or de-emphasize the Doppler Effect as physically accurate
* calculation might not give the desired results. The amount of frequency shift (pitch
* change) is proportional to the speed of listener and source along their line of sight.
* The application can increase or decrease that frequency shift by specifying the
* scaling factor AL should apply to the result of the calculation.
* <br>
* <br>
* The Doppler Effect as implemented by AL is described by the formula below. Effects
* of the medium (air, water) moving with respect to listener and source are ignored.
* AL_DOPPLER_VELOCITY is the propagation speed relative to which the Source
* velocities are interpreted.
*
* <p>
* <pre>
* VD: AL_DOPPLER_VELOCITY
* DF: AL_DOPPLER_FACTOR
* vl: Listener velocity (scalar, projected on source-listener vector)
* vs: Source verlocity (scalar, projected on source-listener vector)
* f: Frequency in sample
* f': effective Doppler shifted frequency
*
* f' = DF * f * (VD-vl)/(VD+vs)
*
* vl<0, vs>0 : source and listener approaching each other
* vl>0, vs<0 : source and listener moving away from each other
* </pre>
* </p>
* <p>
* The implementation has to clamp the projected Listener velocity vl, if abs(vl) is
* greater or equal VD. It similarly has to clamp the projected Source velocity vs if
* abs(vs) is greater or equal VD.
* </p>
* <p>
* There are two API calls global to the current context that provide control of the two
* related parameters.
* </p>
* <p>
* AL_DOPPLER_VELOCITY allows the application to change the reference (propagation)
* velocity used in the Doppler Effect calculation. This permits the application to use a
* velocity scale appropriate to its purposes.
* </p>
* <p>
* A negative or zero value will result in an AL_INVALID_VALUE error, the command is
* then ignored. The default value is 1. The current setting can be queried using
* GetFloatv and AL_DOPPLER_VELOCITY.
* </p>
*
* @param value Doppler velocity value to set
*/
public static native void alDopplerVelocity(float value);
}

View File

@ -0,0 +1,76 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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;
/**
* $Id$
* <br>
* Thrown by the debug build library of the LWJGL if any OpenAL operation
* causes an error.
*
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public class OpenALException extends RuntimeException {
/**
* Constructor for OpenALException.
*/
public OpenALException() {
super();
}
/**
* Constructor for OpenALException.
* @param message
*/
public OpenALException(String message) {
super(message);
}
/**
* Constructor for OpenALException.
* @param message
* @param cause
*/
public OpenALException(String message, Throwable cause) {
super(message, cause);
}
/**
* Constructor for OpenALException.
* @param cause
*/
public OpenALException(Throwable cause) {
super(cause);
}
}

View File

@ -1,108 +1,107 @@
/* /*
* Copyright (c) 2002 Lightweight Java Game Library Project * Copyright (c) 2002 Lightweight Java Game Library Project
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are * modification, are permitted provided that the following conditions are
* met: * met:
* *
* * Redistributions of source code must retain the above copyright * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* *
* * Redistributions in binary form must reproduce the above copyright * * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* *
* * Neither the name of 'Light Weight Java Game Library' nor the names of * * Neither the name of 'Light Weight Java Game Library' nor the names of
* its contributors may be used to endorse or promote products derived * its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission. * from this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
package org.lwjgl.test.openal; package org.lwjgl.openal.eax;
import org.lwjgl.openal.AL;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.IntBuffer;
import java.nio.FloatBuffer;
/** /**
* $Id$ * $Id$
* *
* This is a basic test, which contains the most used stuff * The base OpenAL EAX functionality.
*
* This has been provided as a base class that we can use for either the
* full EAX specification or as a cut-down OpenAL EAX embedded spec. (aka
* a mini-driver).
* *
* @author Brian Matzon <brian@matzon.dk> * @author Brian Matzon <brian@matzon.dk>
* @version $Revision$ * @version $Revision$
*/ */
public abstract class BasicTest { public abstract class BaseEAX {
/** /** Has the EAX object been created? */
* Creates an instance of PlayTest protected static boolean created;
*/
public BasicTest() {
try {
AL.create();
} catch (Exception e) {
e.printStackTrace();
return;
}
}
/** static {
* Shutdowns OpenAL initialize();
*/ }
protected void alExit() {
AL.destroy();
}
/** /**
* Creates an integer buffer to hold specified ints * Override to provide any initialization code after creation.
* - strictly a utility method */
* protected static void init() {
* @param size how many int to contain }
* @return created IntBuffer
*/
protected IntBuffer createIntBuffer(int size) {
ByteBuffer temp = ByteBuffer.allocateDirect(4 * size);
temp.order(ByteOrder.nativeOrder());
return temp.asIntBuffer(); /**
} * Static initialization
*/
private static void initialize() {
System.loadLibrary(org.lwjgl.Sys.getLibraryName());
}
/** /**
* Creates a float buffer to hold specified floats * Loads the EAX functions
* - strictly a utility method *
* * @throws Exception if the EAX extensions couldn't be loaded
* @param size how many floats to contain */
* @return created FloatBuffer public static void create() throws Exception {
*/ if (created) {
protected FloatBuffer createFloatBuffer(int size) { return;
ByteBuffer temp = ByteBuffer.allocateDirect(4 * size); }
temp.order(ByteOrder.nativeOrder());
return temp.asFloatBuffer(); if (!nCreate()) {
} throw new Exception("EAX instance could not be created.");
}
created = true;
init();
}
/** /**
* Exits the test NOW, printing errorcode to stdout * Native method to create EAX instance
* *
* @param error Error code causing exit * @return true if the EAX extensions could be found
*/ */
protected void exit(int error) { protected static native boolean nCreate();
System.out.println("OpenAL Error: " + AL.alGetString(error));
alExit(); /**
System.exit(-1); * "Destroy" the EAX object
} */
public static void destroy() {
if (!created) {
return;
}
created = false;
nDestroy();
}
/**
* Native method the destroy the EAX
*/
protected static native void nDestroy();
} }

View File

@ -0,0 +1,110 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.eax;
/**
* $Id$
*
* This class implements the basic EAX extension constants.
*
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public interface BaseEAXConstants {
public static final int EAX_ENVIRONMENT_GENERIC = 0;
public static final int EAX_ENVIRONMENT_PADDEDCELL = 1;
public static final int EAX_ENVIRONMENT_ROOM = 2;
public static final int EAX_ENVIRONMENT_BATHROOM = 3;
public static final int EAX_ENVIRONMENT_LIVINGROOM = 4;
public static final int EAX_ENVIRONMENT_STONEROOM = 5;
public static final int EAX_ENVIRONMENT_AUDITORIUM = 6;
public static final int EAX_ENVIRONMENT_CONCERTHALL = 7;
public static final int EAX_ENVIRONMENT_CAVE = 8;
public static final int EAX_ENVIRONMENT_ARENA = 9;
public static final int EAX_ENVIRONMENT_HANGAR = 10;
public static final int EAX_ENVIRONMENT_CARPETEDHALLWAY = 11;
public static final int EAX_ENVIRONMENT_HALLWAY = 12;
public static final int EAX_ENVIRONMENT_STONECORRIDOR = 13;
public static final int EAX_ENVIRONMENT_ALLEY = 14;
public static final int EAX_ENVIRONMENT_FOREST = 15;
public static final int EAX_ENVIRONMENT_CITY = 16;
public static final int EAX_ENVIRONMENT_MOUNTAINS = 17;
public static final int EAX_ENVIRONMENT_QUARRY = 18;
public static final int EAX_ENVIRONMENT_PLAIN = 19;
public static final int EAX_ENVIRONMENT_PARKINGLOT = 20;
public static final int EAX_ENVIRONMENT_SEWERPIPE = 21;
public static final int EAX_ENVIRONMENT_UNDERWATER = 22;
public static final int EAX_ENVIRONMENT_DRUGGED = 23;
public static final int EAX_ENVIRONMENT_DIZZY = 24;
public static final int EAX_ENVIRONMENT_PSYCHOTIC = 25;
public static final int EAX_ENVIRONMENT_COUNT = 26;
// Single window material preset
public static final int EAX_MATERIAL_SINGLEWINDOW = -2800;
public static final float EAX_MATERIAL_SINGLEWINDOWLF = 0.71f;
public static final float EAX_MATERIAL_SINGLEWINDOWROOMRATIO = 0.43f;
// Double window material preset
public static final int EAX_MATERIAL_DOUBLEWINDOW = -5000;
public static final float EAX_MATERIAL_DOUBLEWINDOWHF = 0.40f;
public static final float EAX_MATERIAL_DOUBLEWINDOWROOMRATIO = 0.24f;
// Thin door material preset
public static final int EAX_MATERIAL_THINDOOR = -1800;
public static final float EAX_MATERIAL_THINDOORLF = 0.66f;
public static final float EAX_MATERIAL_THINDOORROOMRATIO = 0.66f;
// Thick door material preset
public static final int EAX_MATERIAL_THICKDOOR = -4400;
public static final float EAX_MATERIAL_THICKDOORLF = 0.64f;
public static final float EAX_MATERIAL_THICKDOORROOMRTATION = 0.27f;
// Wood wall material preset
public static final int EAX_MATERIAL_WOODWALL = -4000;
public static final float EAX_MATERIAL_WOODWALLLF = 0.50f;
public static final float EAX_MATERIAL_WOODWALLROOMRATIO = 0.30f;
// Brick wall material preset
public static final int EAX_MATERIAL_BRICKWALL = -5000;
public static final float EAX_MATERIAL_BRICKWALLLF = 0.60f;
public static final float EAX_MATERIAL_BRICKWALLROOMRATIO = 0.24f;
// Stone wall material preset
public static final int EAX_MATERIAL_STONEWALL = -6000;
public static final float EAX_MATERIAL_STONEWALLLF = 0.68f;
public static final float EAX_MATERIAL_STONEWALLROOMRATIO = 0.20f;
// Curtain material preset
public static final int EAX_MATERIAL_CURTAIN = -1200;
public static final float EAX_MATERIAL_CURTAINLF = 0.15f;
public static final float EAX_MATERIAL_CURTAINROOMRATIO = 1.00f;
}

View File

@ -0,0 +1,93 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.eax;
import java.nio.Buffer;
/**
* $Id$
*
* This is the OpenAL EAX class. It extends the latest core.
*
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public class CoreEAX extends BaseEAX implements BaseEAXConstants {
/** GUID for buffer */
public static int BUFFER_GUID;
/** GUID for listener */
public static int LISTENER_GUID;
/**
* Load extensions
*/
protected static void init() {
determineAvailableExtensions();
setGUID();
}
/**
* Determines available EAX extensions
*/
protected static native void determineAvailableExtensions();
/**
* Sets the GUID's for the buffer and listener objects
*/
protected static native void setGUID();
/**
* Retrieves an EAX Value
*
* @param propertySetID adress to the property set GUID of the object being queried (a listener or a source)
* @param property property being queried
* @param source the source to be queried
* @param data Buffer to write value to
* @param size size of area being written to
* @return OpenAL Error code
*/
public static native int eaxGet(int propertySetID, int property, int source, Buffer data, int size);
/**
* Sets an EAX Value
*
* @param propertySetID adress to the property set GUID of the object being queried (a listener or a source)
* @param property property being queried
* @param source the source to be queried
* @param data Buffer to write value to
* @param size size of area being written to
* @return OpenAL Error code
*/
public static native int eaxSet(int propertySetID, int property, int source, Buffer data, int size);
}

View File

@ -1,80 +1,43 @@
/* /*
* Copyright (c) 2002 Lightweight Java Game Library Project * Copyright (c) 2002 Lightweight Java Game Library Project
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are * modification, are permitted provided that the following conditions are
* met: * met:
* *
* * Redistributions of source code must retain the above copyright * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* *
* * Redistributions in binary form must reproduce the above copyright * * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* *
* * Neither the name of 'Light Weight Java Game Library' nor the names of * * Neither the name of 'Light Weight Java Game Library' nor the names of
* its contributors may be used to endorse or promote products derived * its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission. * from this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
package org.lwjgl.test.openal; package org.lwjgl.openal.eax;
import org.lwjgl.openal.eax.EAX;
/** /**
* $Id$ * $Id$
* *
* This test initializes EAX and tries to get and set some EAX values * This is the OpenAL EAX class. It extends the latest core.
* *
* @author Brian Matzon <brian@matzon.dk> * @author Brian Matzon <brian@matzon.dk>
* @version $Revision$ * @version $Revision$
*/ */
public class EAXTest extends BasicTest { public class EAX extends CoreEAX {
/**
* Creates an instance of EAXTest
*/
public EAXTest() {
super();
}
/**
* Runs the actual test, using supplied arguments
*/
protected void execute(String[] args) {
try {
System.out.print("Testing EAX support...");
EAX.create();
System.out.println("supported!");
} catch (Exception e) {
System.out.println("no supported!");
}
//shutdown
alExit();
System.out.println("test done.");
}
/**
* main entry point
*
* @param args String array containing arguments
*/
public static void main(String[] args) {
EAXTest eaxTest = new EAXTest();
eaxTest.execute(args);
}
} }

View File

@ -0,0 +1,519 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.eax;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
/**
* $Id$
*
* This class encapsultaes the EAXBUFFERPROPERTIES struct. Since longs
* are 64 bit in Java and "typically" 32 on other platforms, we cheat by reading an
* int when reading a long field.
*
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public class EAXBufferProperties {
/** ByteBuffer representing EAXBUFFERPROPERTIES */
protected ByteBuffer eaxBufferProperties;
/** size needed by ByteBuffer to contain EAXBUFFERPROPERTIES */
protected static int EAXBUFFERPROPERTIES_SIZE;
/** direct path level offset */
protected static int direct_offset;
/** direct path level at high frequencies offset */
protected static int directHF_offset;
/** room effect level offset */
protected static int room_offset;
/** room effect level at high frequencies offset */
protected static int roomHF_offset;
/** like DS3D flRolloffFactor but for room effect offset */
protected static int roomRolloffFactor_offset;
/** main obstruction control (attenuation at high frequencies) offset */
protected static int obstruction_offset;
/** obstruction low-frequency level re. main control offset */
protected static int obstructionLFRatio_offset;
/** main occlusion control (attenuation at high frequencies) offset */
protected static int occlusion_offset;
/** occlusion low-frequency level re. main control offset */
protected static int occlusionLFRatio_offset;
/** occlusion room effect level re. main control offset */
protected static int occlusionRoomRatio_offset;
/** outside sound cone level at high frequencies offset */
protected static int outsideVolumeHF_offset;
/** multiplies DSPROPERTY_EAXLISTENER_AIRABSORPTIONHF offset */
protected static int airAbsorptionFactor_offset;
/** modifies the behavior of properties offset */
protected static int flags_offset;
public static final int EAXBUFFER_NONE = 0;
public static final int EAXBUFFER_ALLPARAMETERS = 1;
public static final int EAXBUFFER_DIRECT = 2;
public static final int EAXBUFFER_DIRECTHF = 3;
public static final int EAXBUFFER_ROOM = 4;
public static final int EAXBUFFER_ROOMHF = 5;
public static final int EAXBUFFER_ROOMROLLOFFFACTOR = 6;
public static final int EAXBUFFER_OBSTRUCTION = 7;
public static final int EAXBUFFER_OBSTRUCTIONLFRATIO = 8;
public static final int EAXBUFFER_OCCLUSION = 9;
public static final int EAXBUFFER_OCCLUSIONLFRATIO = 10;
public static final int EAXBUFFER_OCCLUSIONROOMRATIO = 11;
public static final int EAXBUFFER_OUTSIDEVOLUMEHF = 12;
public static final int EAXBUFFER_AIRABSORPTIONFACTOR = 13;
public static final int EAXBUFFER_FLAGS = 14;
/** changes take effect immediately */
public static final int EAXBUFFER_IMMEDIATE = 0x00000000;
/** changes take effect later */
public static final int EAXBUFFER_DEFERRED = 0x80000000;
public static final int EAXBUFFER_COMMITDEFERREDSETTINGS =
(EAXBUFFER_NONE | EAXBUFFER_IMMEDIATE);
/** affects DSPROPERTY_EAXBUFFER_DIRECTHF */
public static final int EAXBUFFER_FLAGS_DIRECTHFAUTO = 0x00000001;
/** affects DSPROPERTY_EAXBUFFER_ROOM */
public static final int EAXBUFFER_FLAGS_ROOMAUTO = 0x00000002;
/** affects DSPROPERTY_EAXBUFFER_ROOMHF */
public static final int EAXBUFFER_FLAGS_ROOMHFAUTO = 0x00000004;
/** reserved future use */
public static final int EAXBUFFER_FLAGS_RESERVED = 0xFFFFFFF8;
// property ranges and defaults:
public static final int EAXBUFFER_MINDIRECT = -10000;
public static final int EAXBUFFER_MAXDIRECT = 1000;
public static final int EAXBUFFER_DEFAULTDIRECT = 0;
public static final int EAXBUFFER_MINDIRECTHF = -10000;
public static final int EAXBUFFER_MAXDIRECTHF = 0;
public static final int EAXBUFFER_DEFAULTDIRECTHF = 0;
public static final int EAXBUFFER_MINROOM = -10000;
public static final int EAXBUFFER_MAXROOM = 1000;
public static final int EAXBUFFER_DEFAULTROOM = 0;
public static final int EAXBUFFER_MINROOMHF = -10000;
public static final int EAXBUFFER_MAXROOMHF = 0;
public static final int EAXBUFFER_DEFAULTROOMHF = 0;
public static final float EAXBUFFER_MINROOMROLLOFFFACTOR = 0.0f;
public static final float EAXBUFFER_MAXROOMROLLOFFFACTOR = 10.f;
public static final float EAXBUFFER_DEFAULTROOMROLLOFFFACTOR = 0.0f;
public static final int EAXBUFFER_MINOBSTRUCTION = -10000;
public static final int EAXBUFFER_MAXOBSTRUCTION = 0;
public static final int EAXBUFFER_DEFAULTOBSTRUCTION = 0;
public static final float EAXBUFFER_MINOBSTRUCTIONLFRATIO = 0.0f;
public static final float EAXBUFFER_MAXOBSTRUCTIONLFRATIO = 1.0f;
public static final float EAXBUFFER_DEFAULTOBSTRUCTIONLFRATIO = 0.0f;
public static final int EAXBUFFER_MINOCCLUSION = -10000;
public static final int EAXBUFFER_MAXOCCLUSION = 0;
public static final int EAXBUFFER_DEFAULTOCCLUSION = 0;
public static final float EAXBUFFER_MINOCCLUSIONLFRATIO = 0.0f;
public static final float EAXBUFFER_MAXOCCLUSIONLFRATIO = 1.0f;
public static final float EAXBUFFER_DEFAULTOCCLUSIONLFRATIO = 0.25f;
public static final float EAXBUFFER_MINOCCLUSIONROOMRATIO = 0.0f;
public static final float EAXBUFFER_MAXOCCLUSIONROOMRATIO = 10.0f;
public static final float EAXBUFFER_DEFAULTOCCLUSIONROOMRATIO = 0.5f;
public static final int EAXBUFFER_MINOUTSIDEVOLUMEHF = -10000;
public static final int EAXBUFFER_MAXOUTSIDEVOLUMEHF = 0;
public static final int EAXBUFFER_DEFAULTOUTSIDEVOLUMEHF = 0;
public static final float EAXBUFFER_MINAIRABSORPTIONFACTOR = 0.0f;
public static final float EAXBUFFER_MAXAIRABSORPTIONFACTOR = 10.0f;
public static final float EAXBUFFER_DEFAULTAIRABSORPTIONFACTOR = 1.0f;
public static final int EAXBUFFER_DEFAULTFLAGS =
(EAXBUFFER_FLAGS_DIRECTHFAUTO
| EAXBUFFER_FLAGS_ROOMAUTO
| EAXBUFFER_FLAGS_ROOMHFAUTO);
static {
System.loadLibrary(org.lwjgl.Sys.getLibraryName());
EAXBUFFERPROPERTIES_SIZE = sizeOfEaxBufferProperties();
assignOffsets();
}
public EAXBufferProperties() {
eaxBufferProperties = ByteBuffer.allocateDirect(EAXBUFFERPROPERTIES_SIZE);
eaxBufferProperties.order(ByteOrder.nativeOrder());
}
/**
* Sets an EAX Value
*
* @param property property being queried
* @param source the source to be queried
*/
public void eaxSet(int property, int source) {
EAX.eaxSet(
CoreEAX.BUFFER_GUID,
property,
source,
eaxBufferProperties,
EAXBUFFERPROPERTIES_SIZE);
}
/**
* Sets an EAX Value
*
* @param property property being queried
* @param source the source to be queried
*/
public void eaxGet(int property, int source) {
EAX.eaxGet(
CoreEAX.BUFFER_GUID,
property,
source,
eaxBufferProperties,
EAXBUFFERPROPERTIES_SIZE);
}
/**
* Retireves the direct path level
*
* @return direct path level
*/
public int getDirect() {
return eaxBufferProperties.getInt(direct_offset);
}
/**
* Sets the direct path level
*
* @param direct direct path level to set to
*/
public void setDirect(int direct) {
eaxBufferProperties.putInt(direct_offset, direct);
}
/**
* Retireves the direct path level at high frequencies
*
* @return direct path level at high frequencies
*/
public int getDirectHF() {
return eaxBufferProperties.getInt(directHF_offset);
}
/**
* Sets the direct path level at high frequencies
*
* @param directHF direct path level at high frequencies to set to
*/
public void setDirectHF(int directHF) {
eaxBufferProperties.putInt(directHF_offset, directHF);
}
/**
* Retireves the room effect level
*
* @return room effect level
*/
public int getRoom() {
return eaxBufferProperties.getInt(room_offset);
}
/**
* Sets the room effect level
*
* @param room room effect level to set to
*/
public void setRoom(int room) {
eaxBufferProperties.putInt(room_offset, room);
}
/**
* Retireves the room effect level at high frequencies
*
* @return room effect level at high frequencies
*/
public int getRoomHF() {
return eaxBufferProperties.getInt(roomHF_offset);
}
/**
* Sets the room effect level at high frequencies
*
* @param roomHF room effect level at high frequencies to set to
*/
public void setRoomHF(int roomHF) {
eaxBufferProperties.putInt(roomHF_offset, roomHF);
}
/**
* Retireves the DS3D flRolloffFactor for room effect
*
* @return DS3D flRolloffFactor for room effect
*/
public float getRoomRolloffFactor() {
return eaxBufferProperties.getFloat(roomRolloffFactor_offset);
}
/**
* Sets the DS3D flRolloffFactor for room effect
*
* @param roomRolloffFactor DS3D flRolloffFactor for room effect to set to
*/
public void setRoomRolloffFactor(float roomRolloffFactor) {
eaxBufferProperties.putFloat(roomRolloffFactor_offset, roomRolloffFactor);
}
/**
* Retireves the main obstruction control (attenuation at high frequencies)
*
* @return main obstruction control (attenuation at high frequencies)
*/
public int getObstruction() {
return eaxBufferProperties.getInt(obstruction_offset);
}
/**
* Sets the main obstruction control (attenuation at high frequencies)
*
* @param obstruction main obstruction control (attenuation at high frequencies) to set to
*/
public void setObstruction(int obstruction) {
eaxBufferProperties.putInt(obstruction_offset, obstruction);
}
/**
* Retireves the obstruction low-frequency level re. main control
*
* @return obstruction low-frequency level re. main control
*/
public float getObstructionLFRatio() {
return eaxBufferProperties.getFloat(obstructionLFRatio_offset);
}
/**
* Sets the obstruction low-frequency level re. main control
*
* @param obstructionLFRatio obstruction low-frequency level re. main control to set to
*/
public void setObstructionLFRatio(float obstructionLFRatio) {
eaxBufferProperties.putFloat(obstructionLFRatio_offset, obstructionLFRatio);
}
/**
* Retireves the main occlusion control (attenuation at high frequencies)
*
* @return main occlusion control (attenuation at high frequencies)
*/
public int getOcclusion() {
return eaxBufferProperties.getInt(occlusion_offset);
}
/**
* Sets the main occlusion control (attenuation at high frequencies)
*
* @param occlusion main occlusion control (attenuation at high frequencies) to set to
*/
public void setOcclusion(int occlusion) {
eaxBufferProperties.putInt(occlusion_offset, occlusion);
}
/**
* Retireves the occlusion low-frequency level re. main control
*
* @return occlusion low-frequency level re. main control
*/
public float getOcclusionLFRatio() {
return eaxBufferProperties.getFloat(occlusionLFRatio_offset);
}
/**
* Sets the occlusion low-frequency level re. main control
*
* @param occlusionLFRatio occlusion low-frequency level re. main control to set to
*/
public void setOcclusionLFRatio(float occlusionLFRatio) {
eaxBufferProperties.putFloat(occlusionLFRatio_offset, occlusionLFRatio);
}
/**
* Retireves the occlusion room effect level re. main control
*
* @return occlusion room effect level re. main control
*/
public float getOcclusionRoomRatio() {
return eaxBufferProperties.getFloat(occlusionRoomRatio_offset);
}
/**
* Sets the OcclusionRoomRatio
*
* @param occlusionRoomRatio OcclusionRoomRatio to set to
*/
public void setOcclusionRoomRatio(float occlusionRoomRatio) {
eaxBufferProperties.putFloat(occlusionRoomRatio_offset, occlusionRoomRatio);
}
/**
* Retireves the OutsideVolumeHF
*
* @return OutsideVolumeHF
*/
public int getOutsideVolumeHF() {
return eaxBufferProperties.getInt(outsideVolumeHF_offset);
}
/**
* Sets the OutsideVolumeHF
*
* @param outsideVolumeHF OutsideVolumeHF to set to
*/
public void setOutsideVolumeHF(int outsideVolumeHF) {
eaxBufferProperties.putInt(outsideVolumeHF_offset, outsideVolumeHF);
}
/**
* Retireves the multiplier for DSPROPERTY_EAXLISTENER_AIRABSORPTIONHF
*
* @return multiplier for DSPROPERTY_EAXLISTENER_AIRABSORPTIONHF
*/
public float getAirAbsorptionFactor() {
return eaxBufferProperties.getFloat(airAbsorptionFactor_offset);
}
/**
* Sets the multiplier for DSPROPERTY_EAXLISTENER_AIRABSORPTIONHF
*
* @param airAbsorptionFactor multiplier for DSPROPERTY_EAXLISTENER_AIRABSORPTIONHF to set to
*/
public void setAirAbsorptionFactor(float airAbsorptionFactor) {
eaxBufferProperties.putFloat(
airAbsorptionFactor_offset,
airAbsorptionFactor);
}
/**
* Retireves the modifier for behavior of properties
*
* @return modifier for behavior of properties
*/
public int getFlags() {
return eaxBufferProperties.getInt(flags_offset);
}
/**
* Sets the modifier for behavior of properties
*
* @param flags modifier for behavior of properties to set to
*/
public void setFlags(int flags) {
eaxBufferProperties.putInt(flags_offset, flags);
}
/**
* Retrieves the size of the containing ByteBuffer
*/
public static int getSize() {
return EAXBUFFERPROPERTIES_SIZE;
}
/**
* Retrieves the size of the EAXBUFFERPROPERTIES
*/
protected static native int sizeOfEaxBufferProperties();
/**
* Sets the offsets to the fields
*/
protected static native void assignOffsets();
/**
* Retrieves the size of the property
*
* @param property Property to determine size of
* @return size of property
*/
private static int getSizeOfProperty(int property) {
switch (property) {
case EAXBufferProperties.EAXBUFFER_NONE :
return 0;
/* long */
case EAXBufferProperties.EAXBUFFER_DIRECT :
case EAXBufferProperties.EAXBUFFER_DIRECTHF :
case EAXBufferProperties.EAXBUFFER_ROOM :
case EAXBufferProperties.EAXBUFFER_ROOMHF :
case EAXBufferProperties.EAXBUFFER_OBSTRUCTION :
case EAXBufferProperties.EAXBUFFER_OCCLUSION :
case EAXBufferProperties.EAXBUFFER_OUTSIDEVOLUMEHF :
/* float */
case EAXBufferProperties.EAXBUFFER_ROOMROLLOFFFACTOR :
case EAXBufferProperties.EAXBUFFER_OBSTRUCTIONLFRATIO :
case EAXBufferProperties.EAXBUFFER_OCCLUSIONLFRATIO :
case EAXBufferProperties.EAXBUFFER_OCCLUSIONROOMRATIO :
case EAXBufferProperties.EAXBUFFER_AIRABSORPTIONFACTOR :
/* unsigned long */
case EAXBufferProperties.EAXBUFFER_FLAGS :
return 4;
case EAXBufferProperties.EAXBUFFER_ALLPARAMETERS :
return EAXBufferProperties.EAXBUFFERPROPERTIES_SIZE;
default :
throw new IllegalArgumentException(
"No such property '" + property + "'");
}
}
}

View File

@ -0,0 +1,516 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.eax;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
/**
* $Id$
*
* This class encapsultaes the EAXLISTENERPROPERTIES struct
*
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public class EAXListenerProperties {
/** ByteBuffer representing EAXLISTENERPROPERTIES */
protected ByteBuffer eaxListenerProperties;
/** size needed by ByteBuffer to contain EAXLISTENERPROPERTIES */
protected static int EAXLISTENERPROPERTIES_SIZE;
/** room effect level offset */
protected static int room_offset;
/** room effect level at high frequencies offset */
protected static int roomHF_offset;
/**like DS3D flRolloffFactor but for room effect offset */
protected static int roomRolloffFactor_offset;
/** reverberation decay time at low frequencies offset */
protected static int decayTime_offset;
/** high-frequency to low-frequency decay time ratio offset */
protected static int decayHFRatio_offset;
/** early reflections level relative to room effect offset */
protected static int reflections_offset;
/** initial reflection delay time offset */
protected static int reflectionsDelay_offset;
/** late reverberation level relative to room effect offset */
protected static int reverb_offset;
/** late reverberation delay time relative to initial reflection offset */
protected static int reverbDelay_offset;
/** sets all listener properties offset */
protected static int environment_offset;
/** environment size in meters offset */
protected static int environmentSize_offset;
/** environment diffusion offset */
protected static int environmentDiffusion_offset;
/** change in level per meter at 5 kHz offset */
protected static int airAbsorptionHF_offset;
/** modifies the behavior of properties offset */
protected static int flags_offset;
public static final int EAXLISTENER_NONE = 0;
public static final int EAXLISTENER_ALLPARAMETERS = 1;
public static final int EAXLISTENER_ROOM = 2;
public static final int EAXLISTENER_ROOMHF = 3;
public static final int EAXLISTENER_ROOMROLLOFFFACTOR = 4;
public static final int EAXLISTENER_DECAYTIME = 5;
public static final int EAXLISTENER_DECAYHFRATIO = 6;
public static final int EAXLISTENER_REFLECTIONS = 7;
public static final int EAXLISTENER_REFLECTIONSDELAY = 8;
public static final int EAXLISTENER_REVERB = 9;
public static final int EAXLISTENER_REVERBDELAY = 10;
public static final int EAXLISTENER_ENVIRONMENT = 11;
public static final int EAXLISTENER_ENVIRONMENTSIZE = 12;
public static final int EAXLISTENER_ENVIRONMENTDIFFUSION = 13;
public static final int EAXLISTENER_AIRABSORPTIONHF = 14;
public static final int EAXLISTENER_FLAGS = 15;
/** changes take effect immediately */
public static final int EAXLISTENER_IMMEDIATE = 0x00000000;
/** changes take effect later */
public static final int EAXLISTENER_DEFERRED = 0x80000000;
public static final int EAXLISTENER_COMMITDEFERREDSETTINGS =
(EAXLISTENER_NONE | EAXLISTENER_IMMEDIATE);
/** reverberation decay time */
public static final int EAXLISTENERFLAGS_DECAYTIMESCALE = 0x00000001;
/** reflection level */
public static final int EAXLISTENERFLAGS_REFLECTIONSSCALE = 0x00000002;
/** initial reflection delay time */
public static final int EAXLISTENERFLAGS_REFLECTIONSDELAYSCALE = 0x00000004;
/** reflections level */
public static final int EAXLISTENERFLAGS_REVERBSCALE = 0x00000008;
/** late reverberation delay time */
public static final int EAXLISTENERFLAGS_REVERBDELAYSCALE = 0x00000010;
/** This flag limits high-frequency decay time according to air absorption. */
public static final int EAXLISTENERFLAGS_DECAYHFLIMIT = 0x00000020;
/** reserved future use */
public static final int EAXLISTENERFLAGS_RESERVED = 0xFFFFFFC0;
// property ranges and defaults:
public static final int EAXLISTENER_MINROOM = -10000;
public static final int EAXLISTENER_MAXROOM = 0;
public static final int EAXLISTENER_DEFAULTROOM = -1000;
public static final int EAXLISTENER_MINROOMHF = -10000;
public static final int EAXLISTENER_MAXROOMHF = 0;
public static final int EAXLISTENER_DEFAULTROOMHF = -100;
public static final float EAXLISTENER_MINROOMROLLOFFFACTOR = 0.0f;
public static final float EAXLISTENER_MAXROOMROLLOFFFACTOR = 10.0f;
public static final float EAXLISTENER_DEFAULTROOMROLLOFFFACTOR = 0.0f;
public static final float EAXLISTENER_MINDECAYTIME = 0.1f;
public static final float EAXLISTENER_MAXDECAYTIME = 20.0f;
public static final float EAXLISTENER_DEFAULTDECAYTIME = 1.49f;
public static final float EAXLISTENER_MINDECAYHFRATIO = 0.1f;
public static final float EAXLISTENER_MAXDECAYHFRATIO = 2.0f;
public static final float EAXLISTENER_DEFAULTDECAYHFRATIO = 0.83f;
public static final int EAXLISTENER_MINREFLECTIONS = -10000;
public static final int EAXLISTENER_MAXREFLECTIONS = 1000;
public static final int EAXLISTENER_DEFAULTREFLECTIONS = -2602;
public static final float EAXLISTENER_MINREFLECTIONSDELAY = 0.0f;
public static final float EAXLISTENER_MAXREFLECTIONSDELAY = 0.3f;
public static final float EAXLISTENER_DEFAULTREFLECTIONSDELAY = 0.007f;
public static final int EAXLISTENER_MINREVERB = -10000;
public static final int EAXLISTENER_MAXREVERB = 2000;
public static final int EAXLISTENER_DEFAULTREVERB = 200;
public static final float EAXLISTENER_MINREVERBDELAY = 0.0f;
public static final float EAXLISTENER_MAXREVERBDELAY = 0.1f;
public static final float EAXLISTENER_DEFAULTREVERBDELAY = 0.011f;
public static final int EAXLISTENER_MINENVIRONMENT = 0;
public static final int EAXLISTENER_MAXENVIRONMENT =
(EAX.EAX_ENVIRONMENT_COUNT - 1);
public static final int EAXLISTENER_DEFAULTENVIRONMENT =
EAX.EAX_ENVIRONMENT_GENERIC;
public static final float EAXLISTENER_MINENVIRONMENTSIZE = 1.0f;
public static final float EAXLISTENER_MAXENVIRONMENTSIZE = 100.0f;
public static final float EAXLISTENER_DEFAULTENVIRONMENTSIZE = 7.5f;
public static final float EAXLISTENER_MINENVIRONMENTDIFFUSION = 0.0f;
public static final float EAXLISTENER_MAXENVIRONMENTDIFFUSION = 1.0f;
public static final float EAXLISTENER_DEFAULTENVIRONMENTDIFFUSION = 1.0f;
public static final float EAXLISTENER_MINAIRABSORPTIONHF = -100.0f;
public static final float EAXLISTENER_MAXAIRABSORPTIONHF = 0.0f;
public static final float EAXLISTENER_DEFAULTAIRABSORPTIONHF = -5.0f;
public static final int EAXLISTENER_DEFAULTFLAGS =
(EAXLISTENERFLAGS_DECAYTIMESCALE
| EAXLISTENERFLAGS_REFLECTIONSSCALE
| EAXLISTENERFLAGS_REFLECTIONSDELAYSCALE
| EAXLISTENERFLAGS_REVERBSCALE
| EAXLISTENERFLAGS_REVERBDELAYSCALE
| EAXLISTENERFLAGS_DECAYHFLIMIT);
static {
System.loadLibrary(org.lwjgl.Sys.getLibraryName());
EAXLISTENERPROPERTIES_SIZE = sizeOfEaxListenerProperties();
assignOffsets();
}
public EAXListenerProperties() {
eaxListenerProperties =
ByteBuffer.allocateDirect(EAXLISTENERPROPERTIES_SIZE);
eaxListenerProperties.order(ByteOrder.nativeOrder());
}
/**
* Sets an EAX Value
*
* @param property property being queried
* @param source the source to be queried
*/
public void eaxSet(int property, int source) {
EAX.eaxSet(
CoreEAX.LISTENER_GUID,
property,
source,
eaxListenerProperties,
EAXLISTENERPROPERTIES_SIZE);
}
/**
* Gets an EAX Value
*
* @param property property being queried
* @param source the source to be queried
*/
public void eaxGet(int property, int source) {
EAX.eaxGet(
CoreEAX.LISTENER_GUID,
property,
source,
eaxListenerProperties,
EAXLISTENERPROPERTIES_SIZE);
}
/**
* Retireves the room effect level
*
* @return room effect level
*/
public int getRoom() {
return eaxListenerProperties.getInt(room_offset);
}
/**
* Sets the room effect level
*
* @param room room effect level to set to
*/
public void setRoom(int room) {
eaxListenerProperties.putInt(room_offset, room);
}
/**
* Retireves the room effect level at high frequencies
*
* @return room effect level at high frequencies
*/
public int getRoomHF() {
return eaxListenerProperties.getInt(roomHF_offset);
}
/**
* Sets the room effect level at high frequencies
*
* @param roomHF room effect level at high frequencies to set to
*/
public void setRoomHF(int roomHF) {
eaxListenerProperties.putInt(roomHF_offset, roomHF);
}
/**
* Retireves the DS3D flRolloffFactor for room effect
*
* @return DS3D flRolloffFactor for room effect
*/
public float getRoomRolloffFactor() {
return eaxListenerProperties.getFloat(roomRolloffFactor_offset);
}
/**
* Sets the DS3D flRolloffFactor for room effect
*
* @param roomRolloffFactor DS3D flRolloffFactor for room effect to set to
*/
public void setRoomRolloffFactor(float roomRolloffFactor) {
eaxListenerProperties.putFloat(roomRolloffFactor_offset, roomRolloffFactor);
}
/**
* Retireves the reverberation decay time at low frequencies
*
* @return reverberation decay time at low frequencies
*/
public float getDecayTime() {
return eaxListenerProperties.getFloat(decayTime_offset);
}
/**
* Sets the reverberation decay time at low frequencies
*
* @param decayTime reverberation decay time at low frequencies to set to
*/
public void setDecayTime(float decayTime) {
eaxListenerProperties.putFloat(decayTime_offset, decayTime);
}
/**
* Retireves the high-frequency to low-frequency decay time ratio
*
* @return high-frequency to low-frequency decay time ratio
*/
public float getDecayTimeHFRatio() {
return eaxListenerProperties.getFloat(decayHFRatio_offset);
}
/**
* Sets the high-frequency to low-frequency decay time ratio
*
* @param decayTimeHFRatio high-frequency to low-frequency decay time ratio to set to
*/
public void setDecayTimeHFRatio(float decayTimeHFRatio) {
eaxListenerProperties.putFloat(decayHFRatio_offset, decayTimeHFRatio);
}
/**
* Retireves the early reflections level relative to room effect
*
* @return early reflections level relative to room effect
*/
public int getReflections() {
return eaxListenerProperties.getInt(reflections_offset);
}
/**
* Sets the early reflections level relative to room effect
*
* @param reflections early reflections level relative to room effect to set to
*/
public void setReflections(int reflections) {
eaxListenerProperties.putInt(reflections_offset, reflections);
}
/**
* Retireves the initial reflection delay time
*
* @return initial reflection delay time
*/
public float getReflectionsDelay() {
return eaxListenerProperties.getFloat(reflectionsDelay_offset);
}
/**
* Sets the initial reflection delay time
*
* @param reflectionsDelay initial reflection delay time to set to
*/
public void setReflectionsDelay(float reflectionsDelay) {
eaxListenerProperties.putFloat(reflectionsDelay_offset, reflectionsDelay);
}
/**
* Retireves the late reverberation level relative to room effect
*
* @return late reverberation level relative to room effect
*/
public int getReverb() {
return eaxListenerProperties.getInt(reverb_offset);
}
/**
* Sets the late reverberation level relative to room effect
*
* @param reverb late reverberation level relative to room effect to set to
*/
public void setReverb(int reverb) {
eaxListenerProperties.putInt(reverb_offset, reverb);
}
/**
* Retireves the late reverberation delay time relative to initial reflection
*
* @return late reverberation delay time relative to initial reflection
*/
public float getReverbDelay() {
return eaxListenerProperties.getFloat(reverbDelay_offset);
}
/**
* Sets the late reverberation delay time relative to initial reflection
*
* @param reverbDelay late reverberation delay time relative to initial reflection
*/
public void setReverbDelay(float reverbDelay) {
eaxListenerProperties.putFloat(reverbDelay_offset, reverbDelay);
}
/**
* Retireves the listener properties
*
* @return listener properties
*/
public int getEnvironment() {
return eaxListenerProperties.getInt(environment_offset);
}
/**
* Sets the listener properties
*
* @param environment listener properties to set to
*/
public void setEnvironment(int environment) {
eaxListenerProperties.putInt(environment_offset, environment);
}
/**
* Retireves the environment size in meters
*
* @return environment size in meters
*/
public float getEnvironmentSize() {
return eaxListenerProperties.getFloat(environmentSize_offset);
}
/**
* Sets the environment size in meters
*
* @param environmentSize environment size in meters to set to
*/
public void setEnvironmentSize(float environmentSize) {
eaxListenerProperties.putFloat(environmentSize_offset, environmentSize);
}
/**
* Retireves the environment diffusion
*
* @return environment diffusion
*/
public float getEnvironmentDiffusion() {
return eaxListenerProperties.getFloat(environmentDiffusion_offset);
}
/**
* Sets the environment diffusion
*
* @param environmentDiffusion environment diffusion to set to
*/
public void setEnvironmentDiffusion(float environmentDiffusion) {
eaxListenerProperties.putFloat(
environmentDiffusion_offset,
environmentDiffusion);
}
/**
* Retireves the change in level per meter at 5 kHz
*
* @return change in level per meter at 5 kHz
*/
public float getAirAbsorptionHF() {
return eaxListenerProperties.getFloat(airAbsorptionHF_offset);
}
/**
* Sets the change in level per meter at 5 kHz
*
* @param airAbsorptionHF change in level per meter at 5 kHz to set to
*/
public void setAirAbsorptionFactor(float airAbsorptionHF) {
eaxListenerProperties.putFloat(airAbsorptionHF_offset, airAbsorptionHF);
}
/**
* Retireves the modifier for behavior of properties
*
* @return modifier for behavior of properties
*/
public int getFlags() {
return eaxListenerProperties.getInt(flags_offset);
}
/**
* Sets the modifier for behavior of properties
*
* @param flags modifier for behavior of properties to set to
*/
public void setFlags(int flags) {
eaxListenerProperties.putInt(flags_offset, flags);
}
/**
* Retrieves the size of the containing ByteBuffer
*/
public int getSize() {
return EAXLISTENERPROPERTIES_SIZE;
}
/**
* Retrieves the size of the EAXLISTENERPROPERTIES
*/
protected static native int sizeOfEaxListenerProperties();
/**
* Sets the offsets to the fields
*/
protected static native void assignOffsets();
}

View File

@ -0,0 +1,590 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.opengl;
import java.nio.*;
import java.nio.ByteBuffer;
import java.nio.IntBuffer;
import java.nio.FloatBuffer;
import java.nio.DoubleBuffer;
import java.nio.Buffer;
/**
* $Id: CoreGL.java,v 1.23 2003/07/23 14:51:19 elias_naur Exp $
*
* The core OpenGL1.1 API.
*
* @author cix_foo <cix_foo@users.sourceforge.net>
* @version $Revision: 1.23 $
*/
public abstract class CoreGL11 implements CoreGL11Constants {
public static native void glAccum(int op, float value);
public static native void glAlphaFunc(int func, float ref);
public static native void glClearColor(float red, float green, float blue, float alpha);
public static native void glClearAccum(float red, float green, float blue, float alpha);
public static native void glClear(int mask);
public static void glCallLists(ByteBuffer lists) {
nglCallLists(lists.remaining(), GL_UNSIGNED_BYTE, lists, lists.position());
}
public static void glCallLists(ShortBuffer lists) {
nglCallLists(lists.remaining(), GL_UNSIGNED_SHORT, lists, lists.position() << 1);
}
public static void glCallLists(int n, IntBuffer lists) {
nglCallLists(lists.remaining(), GL_UNSIGNED_INT, lists, lists.position() << 2);
}
private static native void nglCallLists(int n, int type, Buffer lists, int lists_offset);
public static native void glCallList(int list);
public static native void glBlendFunc(int sfactor, int dfactor);
public static void glBitmap(int width, int height, float xorig, float yorig, float xmove, float ymove, ByteBuffer bitmap) {
nglBitmap(width, height, xorig, yorig, xmove, ymove, bitmap, bitmap.position());
}
private static native void nglBitmap(int width, int height, float xorig, float yorig, float xmove, float ymove, ByteBuffer bitmap, int bitmap_offset);
public static native void glBindTexture(int target, int texture);
public static native void glBegin(int mode);
public static native void glEnd();
public static native void glArrayElement(int i);
public static native void glClearDepth(double depth);
public static native void glDeleteLists(int list, int range);
public static void glDeleteTextures(IntBuffer textures) {
nglDeleteTextures(textures.remaining(), textures, textures.position());
}
private static native void nglDeleteTextures(int n, IntBuffer textures, int textures_offset);
public static native void glCullFace(int mode);
public static native void glCopyTexSubImage2D(int target, int level, int xoffset, int yoffset, int x, int y, int width, int height);
public static native void glCopyTexSubImage1D(int target, int level, int xoffset, int x, int y, int width);
public static native void glCopyTexImage2D(int target, int level, int internalFormat, int x, int y, int width, int height, int border);
public static native void glCopyTexImage1D(int target, int level, int internalFormat, int x, int y, int width, int border);
public static native void glCopyPixels(int x, int y, int width, int height, int type);
public static void glColorPointer(int size, boolean unsigned, int stride, ByteBuffer pointer) {
assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled";
nglColorPointer(size, unsigned ? GL_UNSIGNED_BYTE : GL_BYTE, stride, pointer, pointer.position());
}
public static void glColorPointer(int size, int stride, FloatBuffer pointer) {
assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled";
nglColorPointer(size, GL_FLOAT, stride, pointer, pointer.position() << 2);
}
private static native void nglColorPointer(int size, int type, int stride, Buffer pointer, int pointer_offset);
public static void glColorPointer(int size, int type, int stride, int buffer_offset) {
assert VBOTracker.getVBOArrayStack().getState() != 0: "Cannot use int offsets when VBO is disabled";
nglColorPointerVBO(size, type, stride, buffer_offset);
}
private static native void nglColorPointerVBO(int size, int type, int stride, int buffer_offset);
public static native void glColorMaterial(int face, int mode);
public static native void glColorMask(boolean red, boolean green, boolean blue, boolean alpha);
public static native void glColor3b(byte red, byte green, byte blue);
public static native void glColor3f(float red, float green, float blue);
public static native void glColor3ub(byte red, byte green, byte blue);
public static native void glColor4b(byte red, byte green, byte blue, byte alpha);
public static native void glColor4f(float red, float green, float blue, float alpha);
public static native void glColor4ub(byte red, byte green, byte blue, byte alpha);
public static void glClipPlane(int plane, DoubleBuffer equation) {
nglClipPlane(plane, equation, equation.position() << 3);
}
private static native void nglClipPlane(int plane, DoubleBuffer equation, int equation_offset);
public static native void glClearStencil(int s);
public static native void glClearIndex(float c);
public static native void glEvalPoint1(int i);
public static native void glEvalPoint2(int i, int j);
public static native void glEvalMesh1(int mode, int i1, int i2);
public static native void glEvalMesh2(int mode, int i1, int i2, int j1, int j2);
public static native void glEvalCoord1f(float u);
public static native void glEvalCoord2f(float u, float v);
public static native void glEnableClientState(int cap);
public static native void glDisableClientState(int cap);
public static native void glEnable(int cap);
public static native void glDisable(int cap);
public static void glEdgeFlagPointer(int stride, ByteBuffer pointer) {
assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled";
nglEdgeFlagPointer(stride, pointer, pointer.position());
}
private static native void nglEdgeFlagPointer(int stride, Buffer pointer, int pointer_offset);
public static void glEdgeFlagPointer(int stride, int buffer_offset) {
assert VBOTracker.getVBOArrayStack().getState() != 0: "Cannot use int offsets when VBO is disabled";
nglEdgeFlagPointerVBO(stride, buffer_offset);
}
private static native void nglEdgeFlagPointerVBO(int stride, int buffer_offset);
public static native void glEdgeFlag(boolean flag);
public static void glDrawPixels(int width, int height, int format, int type, ByteBuffer pixels) {
nglDrawPixels(width, height, format, type, pixels, pixels.position());
}
public static void glDrawPixels(int width, int height, int format, int type, ShortBuffer pixels) {
nglDrawPixels(width, height, format, type, pixels, pixels.position() << 1);
}
public static void glDrawPixels(int width, int height, int format, int type, IntBuffer pixels) {
nglDrawPixels(width, height, format, type, pixels, pixels.position() << 2);
}
private static native void nglDrawPixels(int width, int height, int format, int type, Buffer pixels, int pixels_offset);
public static void glDrawElements(int mode, ByteBuffer indices) {
assert VBOTracker.getVBOElementStack().getState() == 0: "Cannot use Buffers when VBO is enabled";
nglDrawElements(mode, indices.remaining(), GL_UNSIGNED_BYTE, indices, indices.position());
}
public static void glDrawElements(int mode, ShortBuffer indices) {
assert VBOTracker.getVBOElementStack().getState() == 0: "Cannot use Buffers when VBO is enabled";
nglDrawElements(mode, indices.remaining(), GL_UNSIGNED_SHORT, indices, indices.position() << 1);
}
public static void glDrawElements(int mode, IntBuffer indices) {
assert VBOTracker.getVBOElementStack().getState() == 0: "Cannot use Buffers when VBO is enabled";
nglDrawElements(mode, indices.remaining(), GL_UNSIGNED_INT, indices, indices.position() << 2);
}
private static native void nglDrawElements(int mode, int count, int type, Buffer indices, int indices_offset);
public static void glDrawElements(int mode, int count, int type, int buffer_offset) {
assert VBOTracker.getVBOElementStack().getState() != 0: "Cannot use int offsets when VBO is disabled";
nglDrawElementsVBO(mode, count, type, buffer_offset);
}
private static native void nglDrawElementsVBO(int mode, int count, int type, int buffer_offset);
public static native void glDrawBuffer(int mode);
public static native void glDrawArrays(int mode, int first, int count);
public static native void glDepthRange(double zNear, double zFar);
public static native void glDepthMask(boolean flag);
public static native void glDepthFunc(int func);
public static void glFeedbackBuffer(int type, FloatBuffer buffer) {
nglFeedbackBuffer(buffer.remaining(), type, buffer, buffer.position());
}
private static native void nglFeedbackBuffer(int size, int type, FloatBuffer buffer, int buffer_offset);
public static void glGetPixelMap(int map, FloatBuffer values) {
nglGetPixelMapfv(map, values, values.position());
}
private static native void nglGetPixelMapfv(int map, FloatBuffer values, int values_offset);
public static void glGetPixelMap(int map, IntBuffer values) {
nglGetPixelMapuiv(map, values, values.position());
}
private static native void nglGetPixelMapuiv(int map, IntBuffer values, int values_offset);
public static void glGetPixelMap(int map, ShortBuffer values) {
nglGetPixelMapusv(map, values, values.position());
}
private static native void nglGetPixelMapusv(int map, ShortBuffer values, int values_offset);
public static void glGetMaterial(int face, int pname, FloatBuffer params) {
nglGetMaterialfv(face, pname, params, params.position());
}
private static native void nglGetMaterialfv(int face, int pname, FloatBuffer params, int params_offset);
public static void glGetMaterial(int face, int pname, IntBuffer params) {
nglGetMaterialiv(face, pname, params, params.position());
}
private static native void nglGetMaterialiv(int face, int pname, IntBuffer params, int params_offset);
public static void glGetMap(int target, int query, FloatBuffer v) {
nglGetMapfv(target, query, v, v.position());
}
public static void glGetMap(int target, int query, IntBuffer v) {
nglGetMapiv(target, query, v, v.position());
}
private static native void nglGetMapfv(int target, int query, FloatBuffer v, int v_offset);
private static native void nglGetMapiv(int target, int query, IntBuffer v, int v_offset);
public static void glGetLight(int light, int pname, FloatBuffer params) {
nglGetLightfv(light, pname, params, params.position());
}
private static native void nglGetLightfv(int light, int pname, FloatBuffer params, int params_offset);
public static void glGetLight(int light, int pname, IntBuffer params) {
nglGetLightiv(light, pname, params, params.position());
}
private static native void nglGetLightiv(int light, int pname, IntBuffer params, int params_offset);
public static native int glGetError();
public static void glGetClipPlane(int plane, DoubleBuffer equation) {
nglGetClipPlane(plane, equation, equation.position());
}
private static native void nglGetClipPlane(int plane, DoubleBuffer equation, int equation_offset);
public static void glGetBoolean(int pname, ByteBuffer params) {
nglGetBooleanv(pname, params, params.position());
}
private static native void nglGetBooleanv(int pname, ByteBuffer params, int params_offset);
public static void glGetDouble(int pname, DoubleBuffer params) {
nglGetDoublev(pname, params, params.position());
}
private static native void nglGetDoublev(int pname, DoubleBuffer params, int params_offset);
public static void glGetFloat(int pname, FloatBuffer params) {
nglGetFloatv(pname, params, params.position());
}
private static native void nglGetFloatv(int pname, FloatBuffer params, int params_offset);
public static void glGetInteger(int pname, IntBuffer params) {
nglGetIntegerv(pname, params, params.position());
}
private static native void nglGetIntegerv(int pname, IntBuffer params, int params_offset);
public static void glGenTextures(IntBuffer textures) {
nglGenTextures(textures.remaining(), textures, textures.position());
}
private static native void nglGenTextures(int n, IntBuffer textures, int textures_offset);
public static native int glGenLists(int range);
public static native void glFrustum(double left, double right, double bottom, double top, double zNear, double zFar);
public static native void glFrontFace(int mode);
public static native void glFogf(int pname, float param);
public static native void glFogi(int pname, int param);
public static void glFog(int pname, FloatBuffer params) {
nglFogfv(pname, params, params.position());
}
private static native void nglFogfv(int pname, FloatBuffer params, int params_offset);
public static void glFog(int pname, IntBuffer params) {
nglFogiv(pname, params, params.position());
}
private static native void nglFogiv(int pname, IntBuffer params, int params_offset);
public static native void glFlush();
public static native void glFinish();
/**
* Fetch a pointer from OpenGL. Will return a ByteBuffer representing the pointer, where
* the size argument specifies the buffer size in bytes.
*
* @param size The size of the memory area pointed to. This is the size of the returned ByteBuffer.
* @return The ByteBuffer of the specified size pointing to the returned address.
*/
public static native ByteBuffer glGetPointerv(int pname, int size);
public static native boolean glIsEnabled(int cap);
public static void glInterleavedArrays(int format, int stride, ByteBuffer pointer) {
assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled";
nglInterleavedArrays(format, stride, pointer, pointer.position());
}
public static void glInterleavedArrays(int format, int stride, ShortBuffer pointer) {
assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled";
nglInterleavedArrays(format, stride, pointer, pointer.position() << 1);
}
public static void glInterleavedArrays(int format, int stride, IntBuffer pointer) {
assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled";
nglInterleavedArrays(format, stride, pointer, pointer.position() << 2);
}
public static void glInterleavedArrays(int format, int stride, FloatBuffer pointer) {
assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled";
nglInterleavedArrays(format, stride, pointer, pointer.position() << 2);
}
private static native void nglInterleavedArrays(int format, int stride, Buffer pointer, int pointer_offset);
public static void glInterleavedArrays(int format, int stride, int buffer_offset) {
assert VBOTracker.getVBOArrayStack().getState() != 0: "Cannot use int offsets when VBO is disabled";
nglInterleavedArraysVBO(format, stride, buffer_offset);
}
private static native void nglInterleavedArraysVBO(int format, int stride, int buffer_offset);
public static native void glInitNames();
public static native void glHint(int target, int mode);
public static void glGetTexParameter(int target, int pname, FloatBuffer params) {
nglGetTexParameterfv(target, pname, params, params.position());
}
private static native void nglGetTexParameterfv(int target, int pname, FloatBuffer params, int params_offset);
public static void glGetTexParameter(int target, int pname, IntBuffer params) {
nglGetTexParameteriv(target, pname, params, params.position());
}
private static native void nglGetTexParameteriv(int target, int pname, IntBuffer params, int params_offset);
public static void glGetTexLevelParameter(int target, int level, int pname, FloatBuffer params) {
nglGetTexLevelParameterfv(target, level, pname, params, params.position());
}
private static native void nglGetTexLevelParameterfv(int target, int level, int pname, FloatBuffer params, int params_offset);
public static void glGetTexLevelParameter(int target, int level, int pname, IntBuffer params) {
nglGetTexLevelParameteriv(target, level, pname, params, params.position());
}
private static native void nglGetTexLevelParameteriv(int target, int level, int pname, IntBuffer params, int params_offset);
public static void glGetTexImage(int target, int level, int format, int type, ByteBuffer pixels) {
nglGetTexImage(target, level, format, type, pixels, pixels.position());
}
public static void glGetTexImage(int target, int level, int format, int type, ShortBuffer pixels) {
nglGetTexImage(target, level, format, type, pixels, pixels.position() << 1);
}
public static void glGetTexImage(int target, int level, int format, int type, IntBuffer pixels) {
nglGetTexImage(target, level, format, type, pixels, pixels.position() << 2);
}
private static native void nglGetTexImage(int target, int level, int format, int type, Buffer pixels, int pixels_offset);
public static void glGetTexGen(int coord, int pname, FloatBuffer params) {
nglGetTexGenfv(coord, pname, params, params.position());
}
private static native void nglGetTexGenfv(int coord, int pname, FloatBuffer params, int params_offset);
public static void glGetTexEnv(int coord, int pname, IntBuffer params) {
nglGetTexEnviv(coord, pname, params, params.position());
}
private static native void nglGetTexEnviv(int coord, int pname, IntBuffer params, int params_offset);
public static void glGetTexEnv(int coord, int pname, FloatBuffer params) {
nglGetTexEnvfv(coord, pname, params, params.position());
}
private static native void nglGetTexEnvfv(int coord, int pname, FloatBuffer params, int params_offset);
public static native String glGetString(int name);
public static void glGetPolygonStipple(ByteBuffer mask) {
nglGetPolygonStipple(mask, mask.position());
}
private static native void nglGetPolygonStipple(ByteBuffer mask, int mask_offset);
public static native boolean glIsList(int list);
public static native void glMaterialf(int face, int pname, float param);
public static native void glMateriali(int face, int pname, int param);
public static void glMaterial(int face, int pname, FloatBuffer params) {
nglMaterialfv(face, pname, params, params.position());
}
private static native void nglMaterialfv(int face, int pname, FloatBuffer params, int params_offset);
public static void glMaterial(int face, int pname, IntBuffer params) {
nglMaterialiv(face, pname, params, params.position());
}
private static native void nglMaterialiv(int face, int pname, IntBuffer params, int params_offset);
public static native void glMapGrid1f(int un, float u1, float u2);
public static native void glMapGrid2f(int un, float u1, float u2, int vn, float v1, float v2);
public static void glMap2f(int target, float u1, float u2, int ustride, int uorder, float v1, float v2, int vstride, int vorder, FloatBuffer points) {
nglMap2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points, points.position());
}
private static native void nglMap2f(int target, float u1, float u2, int ustride, int uorder, float v1, float v2, int vstride, int vorder, FloatBuffer points, int points_offset);
public static void glMap1f(int target, float u1, float u2, int stride, int order, FloatBuffer points) {
nglMap1f(target, u1, u2, stride, order, points, points.position());
}
private static native void nglMap1f(int target, float u1, float u2, int stride, int order, FloatBuffer points, int points_offset);
public static native void glLogicOp(int opcode);
public static native void glLoadName(int name);
public static void glLoadMatrixf(FloatBuffer m) {
nglLoadMatrixf(m, m.position());
}
private static native void nglLoadMatrixf(FloatBuffer m, int m_offset);
public static native void glLoadIdentity();
public static native void glListBase(int base);
public static native void glLineWidth(float width);
public static native void glLineStipple(int factor, short pattern);
public static native void glLightModelf(int pname, float param);
public static native void glLightModeli(int pname, int param);
public static void glLightModel(int pname, FloatBuffer params) {
nglLightModelfv( pname, params, params.position());
}
private static native void nglLightModelfv(int pname, FloatBuffer params, int params_offset);
public static void glLightModel(int pname, IntBuffer params) {
nglLightModeliv(pname, params, params.position());
}
private static native void nglLightModeliv(int pname, IntBuffer params, int params_offset);
public static native void glLightf(int light, int pname, float param);
public static native void glLighti(int light, int pname, int param);
public static void glLightfv(int light, int pname, FloatBuffer params) {
nglLightfv(light, pname, params, params.position());
}
private static native void nglLightfv(int light, int pname, FloatBuffer params, int params_offset);
public static void glLightiv(int light, int pname, IntBuffer params) {
nglLightiv(light, pname, params, params.position());
}
private static native void nglLightiv(int light, int pname, IntBuffer params, int params_offset);
public static native boolean glIsTexture(int texture);
public static native void glMatrixMode(int mode);
public static void glPolygonStipple(ByteBuffer mask) {
nglPolygonStipple(mask, mask.position());
}
private static native void nglPolygonStipple(ByteBuffer mask, int mask_offset);
public static native void glPolygonOffset(float factor, float units);
public static native void glPolygonMode(int face, int mode);
public static native void glPointSize(float size);
public static native void glPixelZoom(float xfactor, float yfactor);
public static native void glPixelTransferf(int pname, float param);
public static native void glPixelTransferi(int pname, int param);
public static native void glPixelStoref(int pname, float param);
public static native void glPixelStorei(int pname, int param);
public static void glPixelMap(int map, FloatBuffer values) {
nglPixelMapfv(map, values.remaining(), values, values.position());
}
private static native void nglPixelMapfv(int map, int mapsize, FloatBuffer values, int values_offset);
public static void glPixelMap(int map, IntBuffer values) {
nglPixelMapuiv(map, values.remaining(), values, values.position());
}
private static native void nglPixelMapuiv(int map, int mapsize, IntBuffer values, int values_offset);
public static void glPixelMap(int map, ShortBuffer values) {
nglPixelMapusv(map, values.remaining(), values, values.position());
}
private static native void nglPixelMapusv(int map, int mapsize, ShortBuffer values, int values_offset);
public static native void glPassThrough(float token);
public static native void glOrtho(double left, double right, double bottom, double top, double zNear, double zFar);
public static void glNormalPointer(int stride, ByteBuffer pointer) {
assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled";
nglNormalPointer(GL_BYTE, stride, pointer, pointer.position());
}
public static void glNormalPointer(int stride, IntBuffer pointer) {
assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled";
nglNormalPointer(GL_INT, stride, pointer, pointer.position() << 2);
}
public static void glNormalPointer(int stride, FloatBuffer pointer) {
assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled";
nglNormalPointer(GL_FLOAT, stride, pointer, pointer.position() << 2);
}
private static native void nglNormalPointer(int type, int stride, Buffer pointer, int pointer_offset);
public static void glNormalPointer(int type, int stride, int buffer_offset) {
assert VBOTracker.getVBOArrayStack().getState() != 0: "Cannot use int offsets when VBO is disabled";
nglNormalPointerVBO(type, stride, buffer_offset);
}
private static native void nglNormalPointerVBO(int type, int stride, int buffer_offset);
public static native void glNormal3b(byte nx, byte ny, byte nz);
public static native void glNormal3f(float nx, float ny, float nz);
public static native void glNormal3i(int nx, int ny, int nz);
public static native void glNewList(int list, int mode);
public static native void glEndList();
public static void glMultMatrixf(FloatBuffer m) {
nglMultMatrixf(m, m.position());
}
private static native void nglMultMatrixf(FloatBuffer m, int m_offset);
public static native void glShadeModel(int mode);
public static void glSelectBuffer(IntBuffer buffer) {
nglSelectBuffer(buffer.remaining(), buffer, buffer.position());
}
private static native void nglSelectBuffer(int size, IntBuffer buffer, int buffer_offset);
public static native void glScissor(int x, int y, int width, int height);
public static native void glScalef(float x, float y, float z);
public static native void glRotatef(float angle, float x, float y, float z);
public static native int glRenderMode(int mode);
public static native void glRectf(float x1, float y1, float x2, float y2);
public static native void glRecti(int x1, int y1, int x2, int y2);
public static void glReadPixels(int x, int y, int width, int height, int format, int type, ByteBuffer pixels) {
nglReadPixels(x, y, width, height, format, type, pixels, pixels.position());
}
public static void glReadPixels(int x, int y, int width, int height, int format, int type, ShortBuffer pixels) {
nglReadPixels(x, y, width, height, format, type, pixels, pixels.position() << 1);
}
public static void glReadPixels(int x, int y, int width, int height, int format, int type, IntBuffer pixels) {
nglReadPixels(x, y, width, height, format, type, pixels, pixels.position() << 2);
}
private static native void nglReadPixels(int x, int y, int width, int height, int format, int type, Buffer pixels, int pixels_offset);
public static native void glReadBuffer(int mode);
public static native void glRasterPos2f(float x, float y);
public static native void glRasterPos2i(int x, int y);
public static native void glRasterPos3f(float x, float y, float z);
public static native void glRasterPos3i(int x, int y, int z);
public static native void glRasterPos4f(float x, float y, float z, float w);
public static native void glRasterPos4i(int x, int y, int z, int w);
public static native void glPushName(int name);
public static native void glPopName();
public static native void glPushMatrix();
public static native void glPopMatrix();
public static void glPushClientAttrib(int mask) {
VBOTracker.getClientAttribStack().pushState();
VBOTracker.getClientAttribStack().setState(mask);
if ((mask & GL_CLIENT_VERTEX_ARRAY_BIT) != 0) {
VBOTracker.getVBOArrayStack().pushState();
VBOTracker.getVBOElementStack().pushState();
}
nglPushClientAttrib(mask);
}
private static native void nglPushClientAttrib(int mask);
public static void glPopClientAttrib() {
if ((VBOTracker.getClientAttribStack().popState() & GL_CLIENT_VERTEX_ARRAY_BIT) != 0) {
VBOTracker.getVBOArrayStack().popState();
VBOTracker.getVBOElementStack().popState();
}
nglPopClientAttrib();
}
private static native void nglPopClientAttrib();
public static native void glPushAttrib(int mask);
public static native void glPopAttrib();
public static native void glStencilFunc(int func, int ref, int mask);
public static void glVertexPointer(int size, int stride, FloatBuffer pointer) {
assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled";
nglVertexPointer(size, GL_FLOAT, stride, pointer, pointer.position() << 2);
}
public static void glVertexPointer(int size, int stride, IntBuffer pointer) {
assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled";
nglVertexPointer(size, GL_INT, stride, pointer, pointer.position() << 2);
}
private static native void nglVertexPointer(int size, int type, int stride, Buffer pointer, int pointer_offset);
public static void glVertexPointer(int size, int type, int stride, int buffer_offset) {
assert VBOTracker.getVBOArrayStack().getState() != 0: "Cannot use int offsets when VBO is disabled";
nglVertexPointerVBO(size, type, stride, buffer_offset);
}
private static native void nglVertexPointerVBO(int size, int type, int stride, int buffer_offset);
public static native void glVertex2f(float x, float y);
public static native void glVertex2i(int x, int y);
public static native void glVertex3f(float x, float y, float z);
public static native void glVertex3i(int x, int y, int z);
public static native void glVertex4f(float x, float y, float z, float w);
public static native void glVertex4i(int x, int y, int z, int w);
public static native void glTranslatef(float x, float y, float z);
public static void glTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, ByteBuffer pixels) {
nglTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels, pixels.position());
}
public static void glTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, ShortBuffer pixels) {
nglTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels, pixels.position() << 1);
}
public static void glTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, IntBuffer pixels) {
nglTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels, pixels.position() << 2);
}
private static native void nglTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, Buffer pixels, int pixels_offset);
public static void glTexSubImage1D(int target, int level, int xoffset, int width, int format, int type, ByteBuffer pixels) {
nglTexSubImage1D(target, level, xoffset, width, format, type, pixels, pixels.position());
}
public static void glTexSubImage1D(int target, int level, int xoffset, int width, int format, int type, ShortBuffer pixels) {
nglTexSubImage1D(target, level, xoffset, width, format, type, pixels, pixels.position() << 1);
}
public static void glTexSubImage1D(int target, int level, int xoffset, int width, int format, int type, IntBuffer pixels) {
nglTexSubImage1D(target, level, xoffset, width, format, type, pixels, pixels.position() << 2);
}
private static native void nglTexSubImage1D(int target, int level, int xoffset, int width, int format, int type, Buffer pixels, int pixels_offset);
public static native void glTexParameterf(int target, int pname, float param);
public static native void glTexParameteri(int target, int pname, int param);
public static void glTexImage2D(int target, int level, int internalformat, int width, int height, int border, int format, int type, ByteBuffer pixels) {
nglTexImage2D(target, level, internalformat, width, height, border, format, type, pixels, pixels.position());
}
public static void glTexImage2D(int target, int level, int internalformat, int width, int height, int border, int format, int type, ShortBuffer pixels) {
nglTexImage2D(target, level, internalformat, width, height, border, format, type, pixels, pixels.position() << 1);
}
public static void glTexImage2D(int target, int level, int internalformat, int width, int height, int border, int format, int type, IntBuffer pixels) {
nglTexImage2D(target, level, internalformat, width, height, border, format, type, pixels, pixels.position() << 2);
}
private static native void nglTexImage2D(int target, int level, int internalformat, int width, int height, int border, int format, int type, Buffer pixels, int pixels_offset);
public static void glTexImage1D(int target, int level, int internalformat, int width, int border, int format, int type, ByteBuffer pixels) {
nglTexImage1D(target, level, internalformat, width, border, format, type, pixels, pixels.position());
}
public static void glTexImage1D(int target, int level, int internalformat, int width, int border, int format, int type, ShortBuffer pixels) {
nglTexImage1D(target, level, internalformat, width, border, format, type, pixels, pixels.position() << 1);
}
public static void glTexImage1D(int target, int level, int internalformat, int width, int border, int format, int type, IntBuffer pixels) {
nglTexImage1D(target, level, internalformat, width, border, format, type, pixels, pixels.position() << 2);
}
private static native void nglTexImage1D(int target, int level, int internalformat, int width, int border, int format, int type, Buffer pixels, int pixels_offset);
public static native void glTexGenf(int coord, int pname, float param);
public static void glTexGen(int coord, int pname, FloatBuffer params) {
nglTexGenfv(coord, pname, params, params.position());
}
private static native void nglTexGenfv(int coord, int pname, FloatBuffer params, int params_offset);
public static native void glTexGeni(int coord, int pname, int param);
public static void glTexGen(int coord, int pname, IntBuffer params) {
nglTexGeniv(coord, pname, params, params.position());
}
private static native void nglTexGeniv(int coord, int pname, IntBuffer params, int params_offset);
public static native void glTexEnvf(int target, int pname, float param);
public static native void glTexEnvi(int target, int pname, int param);
public static void glTexEnv(int target, int pname, FloatBuffer params) {
nglTexEnvfv(target, pname, params, params.position());
}
private static native void nglTexEnvfv(int target, int pname, FloatBuffer params, int params_offset);
public static void glTexEnv(int target, int pname, IntBuffer params) {
nglTexEnviv(target, pname, params, params.position());
}
private static native void nglTexEnviv(int target, int pname, IntBuffer params, int params_offset);
public static void glTexCoordPointer(int size, int stride, FloatBuffer pointer) {
assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled";
nglTexCoordPointer(size, GL_FLOAT, stride, pointer, pointer.position() << 2);
}
private static native void nglTexCoordPointer(int size, int type, int stride, Buffer pointer, int pointer_offset);
public static void glTexCoordPointer(int size, int type, int stride, int buffer_offset) {
assert VBOTracker.getVBOArrayStack().getState() != 0: "Cannot use int offsets when VBO is disabled";
nglTexCoordPointerVBO(size, type, stride, buffer_offset);
}
private static native void nglTexCoordPointerVBO(int size, int type, int stride, int buffer_offset);
public static native void glTexCoord1f(float s);
public static native void glTexCoord2f(float s, float t);
public static native void glTexCoord3f(float s, float t, float r);
public static native void glTexCoord4f(float s, float t, float r, float q);
public static native void glStencilOp(int fail, int zfail, int zpass);
public static native void glStencilMask(int mask);
public static native void glViewport(int x, int y, int width, int height);
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,233 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.opengl;
import java.nio.*;
import java.nio.IntBuffer;
import java.nio.FloatBuffer;
import java.nio.Buffer;
/**
* $Id: CoreGL.java,v 1.23 2003/07/23 14:51:19 elias_naur Exp $
*
* The core OpenGL1.2.1 API, with the imaging subset.
*
* @author cix_foo <cix_foo@users.sourceforge.net>
* @version $Revision: 1.23 $
*/
public abstract class CoreGL12 extends CoreGL11 implements CoreGL12Constants {
public static void glColorTable(int target, int internalFormat, int width, int format, int type, ByteBuffer data) {
nglColorTable(target, internalFormat, width, format, type, data, data.position());
}
public static void glColorTable(int target, int internalFormat, int width, int format, int type, FloatBuffer data) {
nglColorTable(target, internalFormat, width, format, type, data, data.position() << 2);
}
private static native void nglColorTable(int target, int internalFormat, int width, int format, int type, Buffer data, int data_offset);
public static void glColorSubTable(int target, int start, int count, int format, int type, ByteBuffer data) {
nglColorSubTable(target, start, count, format, type, data, data.position());
}
public static void glColorSubTable(int target, int start, int count, int format, int type, FloatBuffer data) {
nglColorSubTable(target, start, count, format, type, data, data.position() << 2);
}
private static native void nglColorSubTable(int target, int start, int count, int format, int type, Buffer data, int data_offset);
public static void glColorTableParameter(int target, int pname, IntBuffer params) {
nglColorTableParameteriv(target, pname, params, params.position());
}
private static native void nglColorTableParameteriv(int target, int pname, IntBuffer params, int data_offset);
public static void glColorTableParameter(int target, int pname, FloatBuffer params) {
nglColorTableParameterfv(target, pname, params, params.position());
}
private static native void nglColorTableParameterfv(int target, int pname, FloatBuffer params, int data_offset);
public static native void glCopyColorSubTable(int target, int start, int x, int y, int width);
public static native void glCopyColorTable(int target, int internalformat, int x, int y, int width);
public static void glGetColorTable(int target, int format, int type, ByteBuffer data) {
nglGetColorTable(target, format, type, data, data.position());
}
public static void glGetColorTable(int target, int format, int type, FloatBuffer data) {
nglGetColorTable(target, format, type, data, data.position());
}
private static native void nglGetColorTable(int target, int format, int type, Buffer data, int data_offset);
public static void glGetColorTableParameter(int target, int pname, IntBuffer params) {
nglGetColorTableParameteriv(target, pname, params, params.position());
}
private static native void nglGetColorTableParameteriv(int target, int pname, IntBuffer params, int params_offset);
public static void glGetColorTableParameter(int target, int pname, FloatBuffer params) {
nglGetColorTableParameterfv(target, pname, params, params.position());
}
private static native void nglGetColorTableParameterfv(int target, int pname, FloatBuffer params, int params_offset);
public static native void glBlendEquation(int mode);
public static native void glBlendColor(float red, float green, float blue, float alpha);
public static native void glHistogram(int target, int width, int internalformat, boolean sink);
public static native void glResetHistogram(int target);
public static void glGetHistogram(int target, boolean reset, int format, int type, ByteBuffer values) {
nglGetHistogram(target, reset, format, type, values, values.position());
}
public static void glGetHistogram(int target, boolean reset, int format, int type, ShortBuffer values) {
nglGetHistogram(target, reset, format, type, values, values.position() << 1);
}
public static void glGetHistogram(int target, boolean reset, int format, int type, IntBuffer values) {
nglGetHistogram(target, reset, format, type, values, values.position() << 2);
}
public static void glGetHistogram(int target, boolean reset, int format, int type, FloatBuffer values) {
nglGetHistogram(target, reset, format, type, values, values.position() << 2);
}
private static native void nglGetHistogram(int target, boolean reset, int format, int type, Buffer values, int values_offset);
public static void glGetHistogramParameter(int target, int pname, FloatBuffer params) {
nglGetHistogramParameterfv(target, pname, params, params.position());
}
private static native void nglGetHistogramParameterfv(int target, int pname, FloatBuffer params, int params_offset);
public static void glGetHistogramParameter(int target, int pname, IntBuffer params) {
nglGetHistogramParameteriv(target, pname, params, params.position());
}
private static native void nglGetHistogramParameteriv(int target, int pname, IntBuffer params, int params_offset);
public static native void glMinmax(int target, int internalformat, boolean sink);
public static native void glResetMinmax(int target);
public static void glGetMinmax(int target, boolean reset, int format, int types, ByteBuffer values) {
nglGetMinmax(target, reset, format, types, values, values.position());
}
public static void glGetMinmax(int target, boolean reset, int format, int types, ShortBuffer values) {
nglGetMinmax(target, reset, format, types, values, values.position() << 1);
}
public static void glGetMinmax(int target, boolean reset, int format, int types, IntBuffer values) {
nglGetMinmax(target, reset, format, types, values, values.position() << 2);
}
public static void glGetMinmax(int target, boolean reset, int format, int types, FloatBuffer values) {
nglGetMinmax(target, reset, format, types, values, values.position() << 2);
}
private static native void nglGetMinmax(int target, boolean reset, int format, int types, Buffer values, int values_offset);
public static void glGetMinmaxParameter(int target, int pname, FloatBuffer params) {
nglGetMinmaxParameterfv(target, pname, params, params.position());
}
private static native void nglGetMinmaxParameterfv(int target, int pname, FloatBuffer params, int params_offset);
public static void glGetMinmaxParameter(int target, int pname, IntBuffer params) {
nglGetMinmaxParameteriv(target, pname, params, params.position());
}
private static native void nglGetMinmaxParameteriv(int target, int pname, IntBuffer params, int params_offset);
public static void glConvolutionFilter1D(int target, int internalformat, int width, int format, int type, ByteBuffer image) {
nglConvolutionFilter1D(target, internalformat, width, format, type, image, image.position());
}
public static void glConvolutionFilter1D(int target, int internalformat, int width, int format, int type, ShortBuffer image) {
nglConvolutionFilter1D(target, internalformat, width, format, type, image, image.position());
}
public static void glConvolutionFilter1D(int target, int internalformat, int width, int format, int type, IntBuffer image) {
nglConvolutionFilter1D(target, internalformat, width, format, type, image, image.position());
}
public static void glConvolutionFilter1D(int target, int internalformat, int width, int format, int type, FloatBuffer image) {
nglConvolutionFilter1D(target, internalformat, width, format, type, image, image.position());
}
private static native void nglConvolutionFilter1D(int target, int internalformat, int width, int format, int type, Buffer image, int image_offset);
public static void glConvolutionFilter2D(int target, int internalformat, int width, int height, int format, int type, Buffer image) {
}
private static native void nglConvolutionFilter2D(int target, int internalformat, int width, int height, int format, int type, Buffer image, int image_offset);
public static native void glConvolutionParameterf(int target, int pname, float params);
public static void glConvolutionParameter(int target, int pname, FloatBuffer params) {
}
private static native void nglConvolutionParameterfv(int target, int pname, FloatBuffer params, int params_offset);
public static native void glConvolutionParameteri(int target, int pname, int params);
public static void glConvolutionParameteriv(int target, int pname, IntBuffer params) {
nglConvolutionParameteriv(target, pname, params, params.position());
}
private static native void nglConvolutionParameteriv(int target, int pname, IntBuffer params, int params_offset);
public static native void glCopyConvolutionFilter1D(int target, int internalformat, int x, int y, int width);
public static native void glCopyConvolutionFilter2D(int target, int internalformat, int x, int y, int width, int height);
public static void glGetConvolutionFilter(int target, int format, int type, ByteBuffer image) {
nglGetConvolutionFilter(target, format, type, image, image.position());
}
public static void glGetConvolutionFilter(int target, int format, int type, ShortBuffer image) {
nglGetConvolutionFilter(target, format, type, image, image.position() << 1);
}
public static void glGetConvolutionFilter(int target, int format, int type, IntBuffer image) {
nglGetConvolutionFilter(target, format, type, image, image.position() << 2);
}
public static void glGetConvolutionFilter(int target, int format, int type, FloatBuffer image) {
nglGetConvolutionFilter(target, format, type, image, image.position() << 2);
}
private static native void nglGetConvolutionFilter(int target, int format, int type, Buffer image, int image_offset);
public static void glGetConvolutionParameter(int target, int pname, FloatBuffer params) {
nglGetConvolutionParameterfv(target, pname, params, params.position());
}
private static native void nglGetConvolutionParameterfv(int target, int pname, FloatBuffer params, int params_offset);
public static void glGetConvolutionParameter(int target, int pname, IntBuffer params) {
nglGetConvolutionParameteriv(target, pname, params, params.position());
}
private static native void nglGetConvolutionParameteriv(int target, int pname, IntBuffer params, int params_offset);
public static void glSeparableFilter2D(int target, int internalformat, int width, int height, int format, int type, Buffer row, Buffer column) {
nglSeparableFilter2D(target, internalformat, width, height, format, type, row, Util.getOffset(row), column, Util.getOffset(column));
}
private static native void nglSeparableFilter2D(int target, int internalformat, int width, int height, int format, int type, Buffer row, int row_offset, Buffer column, int column_offset);
public static void glGetSeparableFilter(int target, int format, int type, Buffer row, Buffer column, Buffer span) {
nglGetSeparableFilter(target, format, type, row, Util.getOffset(row), column, Util.getOffset(column), span, Util.getOffset(span));
}
private static native void nglGetSeparableFilter(int target, int format, int type, Buffer row, int row_offset, Buffer column, int column_offset, Buffer span, int span_offset);
public static void glDrawRangeElements(int mode, int start, int end, ByteBuffer indices) {
assert VBOTracker.getVBOElementStack().getState() == 0: "Cannot use Buffers when VBO is enabled";
nglDrawRangeElements(mode, start, end, indices.remaining(), GL_UNSIGNED_BYTE, indices, indices.position());
}
public static void glDrawRangeElements(int mode, int start, int end, ShortBuffer indices) {
assert VBOTracker.getVBOElementStack().getState() == 0: "Cannot use Buffers when VBO is enabled";
nglDrawRangeElements(mode, start, end, indices.remaining(), GL_UNSIGNED_SHORT, indices, indices.position() << 1);
}
public static void glDrawRangeElements(int mode, int start, int end, IntBuffer indices) {
assert VBOTracker.getVBOElementStack().getState() == 0: "Cannot use Buffers when VBO is enabled";
nglDrawRangeElements(mode, start, end, indices.remaining(), GL_UNSIGNED_INT, indices, indices.position() << 2);
}
private static native void nglDrawRangeElements(int mode, int start, int end, int count, int type, Buffer indices, int indices_offset);
public static void glDrawRangeElements(int mode, int start, int end, int count, int type, int buffer_offset) {
assert VBOTracker.getVBOElementStack().getState() != 0: "Cannot use int offsets when VBO is disabled";
nglDrawRangeElementsVBO(mode, start, end, count, type, buffer_offset);
}
private static native void nglDrawRangeElementsVBO(int mode, int start, int end, int count, int type, int buffer_offset);
public static void glTexImage3D(int target, int level, int internalFormat, int width, int height, int depth, int border, int format, int type, ByteBuffer pixels) {
nglTexImage3D(target, level, internalFormat, width, height, depth, border, format, type, pixels, pixels.position());
}
public static void glTexImage3D(int target, int level, int internalFormat, int width, int height, int depth, int border, int format, int type, ShortBuffer pixels) {
nglTexImage3D(target, level, internalFormat, width, height, depth, border, format, type, pixels, pixels.position() << 1);
}
public static void glTexImage3D(int target, int level, int internalFormat, int width, int height, int depth, int border, int format, int type, IntBuffer pixels) {
nglTexImage3D(target, level, internalFormat, width, height, depth, border, format, type, pixels, pixels.position() << 2);
}
private static native void nglTexImage3D(int target, int level, int internalFormat, int width, int height, int depth, int border, int format, int type, Buffer pixels, int pixels_offset);
public static void glTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, ByteBuffer pixels) {
nglTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels, pixels.position());
}
public static void glTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, ShortBuffer pixels) {
nglTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels, pixels.position() << 1);
}
public static void glTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, IntBuffer pixels) {
nglTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels, pixels.position() << 2);
}
private static native void nglTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, Buffer pixels, int pixels_offset);
public static native void glCopyTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int x, int y, int width, int height);
}

View File

@ -0,0 +1,156 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.opengl;
/**
* $Id$
*
* Core OpenGL 1.1 constants.
*
* @author cix_foo <cix_foo@users.sourceforge.net>
* @version $Revision$
*/
public interface CoreGL12Constants extends CoreGL11Constants {
public static final int GL_RESCALE_NORMAL = 0x803A;
public static final int GL_CLAMP_TO_EDGE = 0x812F;
public static final int GL_MAX_ELEMENTS_VERTICES = 0x80E8;
public static final int GL_MAX_ELEMENTS_INDICES = 0x80E9;
public static final int GL_BGR = 0x80E0;
public static final int GL_BGRA = 0x80E1;
public static final int GL_UNSIGNED_BYTE_3_3_2 = 0x8032;
public static final int GL_UNSIGNED_BYTE_2_3_3_REV = 0x8362;
public static final int GL_UNSIGNED_SHORT_5_6_5 = 0x8363;
public static final int GL_UNSIGNED_SHORT_5_6_5_REV = 0x8364;
public static final int GL_UNSIGNED_SHORT_4_4_4_4 = 0x8033;
public static final int GL_UNSIGNED_SHORT_4_4_4_4_REV = 0x8365;
public static final int GL_UNSIGNED_SHORT_5_5_5_1 = 0x8034;
public static final int GL_UNSIGNED_SHORT_1_5_5_5_REV = 0x8366;
public static final int GL_UNSIGNED_INT_8_8_8_8 = 0x8035;
public static final int GL_UNSIGNED_INT_8_8_8_8_REV = 0x8367;
public static final int GL_UNSIGNED_INT_10_10_10_2 = 0x8036;
public static final int GL_UNSIGNED_INT_2_10_10_10_REV = 0x8368;
public static final int GL_LIGHT_MODEL_COLOR_CONTROL = 0x81F8;
public static final int GL_SINGLE_COLOR = 0x81F9;
public static final int GL_SEPARATE_SPECULAR_COLOR = 0x81FA;
public static final int GL_TEXTURE_MIN_LOD = 0x813A;
public static final int GL_TEXTURE_MAX_LOD = 0x813B;
public static final int GL_TEXTURE_BASE_LEVEL = 0x813C;
public static final int GL_TEXTURE_MAX_LEVEL = 0x813D;
public static final int GL_SMOOTH_POINT_SIZE_RANGE = 0x0B12;
public static final int GL_SMOOTH_POINT_SIZE_GRANULARITY = 0x0B13;
public static final int GL_SMOOTH_LINE_WIDTH_RANGE = 0x0B22;
public static final int GL_SMOOTH_LINE_WIDTH_GRANULARITY = 0x0B23;
public static final int GL_ALIASED_POINT_SIZE_RANGE = 0x846D;
public static final int GL_ALIASED_LINE_WIDTH_RANGE = 0x846E;
public static final int GL_PACK_SKIP_IMAGES = 0x806B;
public static final int GL_PACK_IMAGE_HEIGHT = 0x806C;
public static final int GL_UNPACK_SKIP_IMAGES = 0x806D;
public static final int GL_UNPACK_IMAGE_HEIGHT = 0x806E;
public static final int GL_TEXTURE_3D = 0x806F;
public static final int GL_PROXY_TEXTURE_3D = 0x8070;
public static final int GL_TEXTURE_DEPTH = 0x8071;
public static final int GL_TEXTURE_WRAP_R = 0x8072;
public static final int GL_MAX_3D_TEXTURE_SIZE = 0x8073;
public static final int GL_TEXTURE_BINDING_3D = 0x806A;
public static final int GL_COLOR_TABLE = 0x80D0;
public static final int GL_POST_CONVOLUTION_COLOR_TABLE = 0x80D1;
public static final int GL_POST_COLOR_MATRIX_COLOR_TABLE = 0x80D2;
public static final int GL_PROXY_COLOR_TABLE = 0x80D3;
public static final int GL_PROXY_POST_CONVOLUTION_COLOR_TABLE = 0x80D4;
public static final int GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE = 0x80D5;
public static final int GL_COLOR_TABLE_SCALE = 0x80D6;
public static final int GL_COLOR_TABLE_BIAS = 0x80D7;
public static final int GL_COLOR_TABLE_FORMAT = 0x80D8;
public static final int GL_COLOR_TABLE_WIDTH = 0x80D9;
public static final int GL_COLOR_TABLE_RED_SIZE = 0x80DA;
public static final int GL_COLOR_TABLE_GREEN_SIZE = 0x80DB;
public static final int GL_COLOR_TABLE_BLUE_SIZE = 0x80DC;
public static final int GL_COLOR_TABLE_ALPHA_SIZE = 0x80DD;
public static final int GL_COLOR_TABLE_LUMINANCE_SIZE = 0x80DE;
public static final int GL_COLOR_TABLE_INTENSITY_SIZE = 0x80DF;
public static final int GL_CONVOLUTION_1D = 0x8010;
public static final int GL_CONVOLUTION_2D = 0x8011;
public static final int GL_SEPARABLE_2D = 0x8012;
public static final int GL_CONVOLUTION_BORDER_MODE = 0x8013;
public static final int GL_CONVOLUTION_FILTER_SCALE = 0x8014;
public static final int GL_CONVOLUTION_FILTER_BIAS = 0x8015;
public static final int GL_REDUCE = 0x8016;
public static final int GL_CONVOLUTION_FORMAT = 0x8017;
public static final int GL_CONVOLUTION_WIDTH = 0x8018;
public static final int GL_CONVOLUTION_HEIGHT = 0x8019;
public static final int GL_MAX_CONVOLUTION_WIDTH = 0x801A;
public static final int GL_MAX_CONVOLUTION_HEIGHT = 0x801B;
public static final int GL_POST_CONVOLUTION_RED_SCALE = 0x801C;
public static final int GL_POST_CONVOLUTION_GREEN_SCALE = 0x801D;
public static final int GL_POST_CONVOLUTION_BLUE_SCALE = 0x801E;
public static final int GL_POST_CONVOLUTION_ALPHA_SCALE = 0x801F;
public static final int GL_POST_CONVOLUTION_RED_BIAS = 0x8020;
public static final int GL_POST_CONVOLUTION_GREEN_BIAS = 0x8021;
public static final int GL_POST_CONVOLUTION_BLUE_BIAS = 0x8022;
public static final int GL_POST_CONVOLUTION_ALPHA_BIAS = 0x8023;
public static final int GL_CONSTANT_BORDER = 0x8151;
public static final int GL_REPLICATE_BORDER = 0x8153;
public static final int GL_CONVOLUTION_BORDER_COLOR = 0x8154;
public static final int GL_COLOR_MATRIX = 0x80B1;
public static final int GL_COLOR_MATRIX_STACK_DEPTH = 0x80B2;
public static final int GL_MAX_COLOR_MATRIX_STACK_DEPTH = 0x80B3;
public static final int GL_POST_COLOR_MATRIX_RED_SCALE = 0x80B4;
public static final int GL_POST_COLOR_MATRIX_GREEN_SCALE = 0x80B5;
public static final int GL_POST_COLOR_MATRIX_BLUE_SCALE = 0x80B6;
public static final int GL_POST_COLOR_MATRIX_ALPHA_SCALE = 0x80B7;
public static final int GL_POST_COLOR_MATRIX_RED_BIAS = 0x80B8;
public static final int GL_POST_COLOR_MATRIX_GREEN_BIAS = 0x80B9;
public static final int GL_POST_COLOR_MATRIX_BLUE_BIAS = 0x80BA;
public static final int GL_POST_COLOR_MATRIX_ALPHA_BIAS = 0x80BB;
public static final int GL_HISTOGRAM = 0x8024;
public static final int GL_PROXY_HISTOGRAM = 0x8025;
public static final int GL_HISTOGRAM_WIDTH = 0x8026;
public static final int GL_HISTOGRAM_FORMAT = 0x8027;
public static final int GL_HISTOGRAM_RED_SIZE = 0x8028;
public static final int GL_HISTOGRAM_GREEN_SIZE = 0x8029;
public static final int GL_HISTOGRAM_BLUE_SIZE = 0x802A;
public static final int GL_HISTOGRAM_ALPHA_SIZE = 0x802B;
public static final int GL_HISTOGRAM_LUMINANCE_SIZE = 0x802C;
public static final int GL_HISTOGRAM_SINK = 0x802D;
public static final int GL_MINMAX = 0x802E;
public static final int GL_MINMAX_FORMAT = 0x802F;
public static final int GL_MINMAX_SINK = 0x8030;
public static final int GL_TABLE_TOO_LARGE = 0x8031;
public static final int GL_BLEND_EQUATION = 0x8009;
public static final int GL_MIN = 0x8007;
public static final int GL_MAX = 0x8008;
public static final int GL_FUNC_ADD = 0x8006;
public static final int GL_FUNC_SUBTRACT = 0x800A;
public static final int GL_FUNC_REVERSE_SUBTRACT = 0x800B;
public static final int GL_BLEND_COLOR = 0x8005;
}

View File

@ -0,0 +1,133 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.opengl;
import java.nio.*;
/**
* $Id: CoreGL.java,v 1.23 2003/07/23 14:51:19 elias_naur Exp $
*
* The core OpenGL1.3 API.
*
* @author cix_foo <cix_foo@users.sourceforge.net>
* @version $Revision: 1.23 $
*/
public abstract class CoreGL13 extends CoreGL12 implements CoreGL13Constants {
public static native void glActiveTexture(int texture);
public static native void glClientActiveTexture(int texture);
public static void glCompressedTexImage1D(int target, int level, int internalformat, int width, int border, int imageSize, ByteBuffer data) {
nglCompressedTexImage1D(target, level, internalformat, width, border, imageSize, data, data.position());
}
public static void glCompressedTexImage1D(int target, int level, int internalformat, int width, int border, int imageSize, ShortBuffer data) {
nglCompressedTexImage1D(target, level, internalformat, width, border, imageSize, data, data.position() << 1);
}
public static void glCompressedTexImage1D(int target, int level, int internalformat, int width, int border, int imageSize, FloatBuffer data) {
nglCompressedTexImage1D(target, level, internalformat, width, border, imageSize, data, data.position() << 2);
}
private static native void nglCompressedTexImage1D(int target, int level, int internalformat, int width, int border, int imageSize, Buffer data, int data_offset);
public static void glCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, int imageSize, ByteBuffer data) {
nglCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data, data.position());
}
public static void glCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, int imageSize, ShortBuffer data) {
nglCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data, data.position() << 1);
}
public static void glCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, int imageSize, IntBuffer data) {
nglCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data, data.position() << 2);
}
private static native void nglCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, int imageSize, Buffer data, int data_offset);
public static void glCompressedTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, ByteBuffer data) {
nglCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data, data.position());
}
public static void glCompressedTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, ShortBuffer data) {
nglCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data, data.position() << 1);
}
public static void glCompressedTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, IntBuffer data) {
nglCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data, data.position() << 2);
}
private static native void nglCompressedTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, Buffer data, int data_offset);
public static void glCompressedTexSubImage1D(int target, int level, int xoffset, int width, int format, int imageSize, ByteBuffer data) {
nglCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, data, data.position());
}
public static void glCompressedTexSubImage1D(int target, int level, int xoffset, int width, int format, int imageSize, ShortBuffer data) {
nglCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, data, data.position() << 1);
}
public static void glCompressedTexSubImage1D(int target, int level, int xoffset, int width, int format, int imageSize, IntBuffer data) {
nglCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, data, data.position() << 2);
}
private static native void nglCompressedTexSubImage1D(int target, int level, int xoffset, int width, int format, int imageSize, Buffer data, int data_offset);
public static void glCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, ByteBuffer data) {
nglCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data, data.position());
}
public static void glCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, ShortBuffer data) {
nglCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data, data.position() << 1);
}
public static void glCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, IntBuffer data) {
nglCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data, data.position() << 2);
}
private static native void nglCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, Buffer data, int data_offset);
public static void glCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, ByteBuffer data) {
nglCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data, data.position());
}
public static void glCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, ShortBuffer data) {
nglCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data, data.position() << 1);
}
public static void glCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, IntBuffer data) {
nglCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data, data.position() << 2);
}
private static native void nglCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, Buffer data, int data_offset);
public static void glGetCompressedTexImage(int target, int lod, ByteBuffer img) {
nglGetCompressedTexImage(target, lod, img, img.position());
}
public static void glGetCompressedTexImage(int target, int lod, ShortBuffer img) {
nglGetCompressedTexImage(target, lod, img, img.position() << 1);
}
public static void glGetCompressedTexImage(int target, int lod, IntBuffer img) {
nglGetCompressedTexImage(target, lod, img, img.position() << 2);
}
private static native void nglGetCompressedTexImage(int target, int lod, Buffer img, int img_offset);
public static native void glMultiTexCoord1f(int target, float s);
public static native void glMultiTexCoord2f(int target, float s, float t);
public static native void glMultiTexCoord3f(int target, float s, float t, float r);
public static native void glMultiTexCoord4f(int target, float s, float t, float r, float q);
public static void glLoadTransposeMatrix(FloatBuffer m) {
nglLoadTransposeMatrixf(m, m.position());
}
private static native void nglLoadTransposeMatrixf(FloatBuffer m, int m_offset);
public static void glMultTransposeMatrix(FloatBuffer m) {
nglMultTransposeMatrixf(m, m.position());
}
private static native void nglMultTransposeMatrixf(FloatBuffer m, int m_offset);
public static native void glSampleCoverage(float value, boolean invert);
}

View File

@ -0,0 +1,145 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.opengl;
/**
* $Id$
*
* Core OpenGL 1.1 constants.
*
* @author cix_foo <cix_foo@users.sourceforge.net>
* @version $Revision$
*/
public interface CoreGL13Constants extends CoreGL12Constants {
public static final int GL_TEXTURE0 = 0x84C0;
public static final int GL_TEXTURE1 = 0x84C1;
public static final int GL_TEXTURE2 = 0x84C2;
public static final int GL_TEXTURE3 = 0x84C3;
public static final int GL_TEXTURE4 = 0x84C4;
public static final int GL_TEXTURE5 = 0x84C5;
public static final int GL_TEXTURE6 = 0x84C6;
public static final int GL_TEXTURE7 = 0x84C7;
public static final int GL_TEXTURE8 = 0x84C8;
public static final int GL_TEXTURE9 = 0x84C9;
public static final int GL_TEXTURE10 = 0x84CA;
public static final int GL_TEXTURE11 = 0x84CB;
public static final int GL_TEXTURE12 = 0x84CC;
public static final int GL_TEXTURE13 = 0x84CD;
public static final int GL_TEXTURE14 = 0x84CE;
public static final int GL_TEXTURE15 = 0x84CF;
public static final int GL_TEXTURE16 = 0x84D0;
public static final int GL_TEXTURE17 = 0x84D1;
public static final int GL_TEXTURE18 = 0x84D2;
public static final int GL_TEXTURE19 = 0x84D3;
public static final int GL_TEXTURE20 = 0x84D4;
public static final int GL_TEXTURE21 = 0x84D5;
public static final int GL_TEXTURE22 = 0x84D6;
public static final int GL_TEXTURE23 = 0x84D7;
public static final int GL_TEXTURE24 = 0x84D8;
public static final int GL_TEXTURE25 = 0x84D9;
public static final int GL_TEXTURE26 = 0x84DA;
public static final int GL_TEXTURE27 = 0x84DB;
public static final int GL_TEXTURE28 = 0x84DC;
public static final int GL_TEXTURE29 = 0x84DD;
public static final int GL_TEXTURE30 = 0x84DE;
public static final int GL_TEXTURE31 = 0x84DF;
public static final int GL_ACTIVE_TEXTURE = 0x84E0;
public static final int GL_CLIENT_ACTIVE_TEXTURE = 0x84E1;
public static final int GL_MAX_TEXTURE_UNITS = 0x84E2;
public static final int GL_NORMAL_MAP = 0x8511;
public static final int GL_REFLECTION_MAP = 0x8512;
public static final int GL_TEXTURE_CUBE_MAP = 0x8513;
public static final int GL_TEXTURE_BINDING_CUBE_MAP = 0x8514;
public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515;
public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516;
public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517;
public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518;
public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519;
public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A;
public static final int GL_PROXY_TEXTURE_CUBE_MAP = 0x851B;
public static final int GL_MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C;
public static final int GL_COMPRESSED_ALPHA = 0x84E9;
public static final int GL_COMPRESSED_LUMINANCE = 0x84EA;
public static final int GL_COMPRESSED_LUMINANCE_ALPHA = 0x84EB;
public static final int GL_COMPRESSED_INTENSITY = 0x84EC;
public static final int GL_COMPRESSED_RGB = 0x84ED;
public static final int GL_COMPRESSED_RGBA = 0x84EE;
public static final int GL_TEXTURE_COMPRESSION_HINT = 0x84EF;
public static final int GL_TEXTURE_COMPRESSED_IMAGE_SIZE = 0x86A0;
public static final int GL_TEXTURE_COMPRESSED = 0x86A1;
public static final int GL_NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2;
public static final int GL_COMPRESSED_TEXTURE_FORMATS = 0x86A3;
public static final int GL_MULTISAMPLE = 0x809D;
public static final int GL_SAMPLE_ALPHA_TO_COVERAGE = 0x809E;
public static final int GL_SAMPLE_ALPHA_TO_ONE = 0x809F;
public static final int GL_SAMPLE_COVERAGE = 0x80A0;
public static final int GL_SAMPLE_BUFFERS = 0x80A8;
public static final int GL_SAMPLES = 0x80A9;
public static final int GL_SAMPLE_COVERAGE_VALUE = 0x80AA;
public static final int GL_SAMPLE_COVERAGE_INVERT = 0x80AB;
public static final int GL_MULTISAMPLE_BIT = 0x20000000;
public static final int GL_TRANSPOSE_MODELVIEW_MATRIX = 0x84E3;
public static final int GL_TRANSPOSE_PROJECTION_MATRIX = 0x84E4;
public static final int GL_TRANSPOSE_TEXTURE_MATRIX = 0x84E5;
public static final int GL_TRANSPOSE_COLOR_MATRIX = 0x84E6;
public static final int GL_COMBINE = 0x8570;
public static final int GL_COMBINE_RGB = 0x8571;
public static final int GL_COMBINE_ALPHA = 0x8572;
public static final int GL_SOURCE0_RGB = 0x8580;
public static final int GL_SOURCE1_RGB = 0x8581;
public static final int GL_SOURCE2_RGB = 0x8582;
public static final int GL_SOURCE0_ALPHA = 0x8588;
public static final int GL_SOURCE1_ALPHA = 0x8589;
public static final int GL_SOURCE2_ALPHA = 0x858A;
public static final int GL_OPERAND0_RGB = 0x8590;
public static final int GL_OPERAND1_RGB = 0x8591;
public static final int GL_OPERAND2_RGB = 0x8592;
public static final int GL_OPERAND0_ALPHA = 0x8598;
public static final int GL_OPERAND1_ALPHA = 0x8599;
public static final int GL_OPERAND2_ALPHA = 0x859A;
public static final int GL_RGB_SCALE = 0x8573;
public static final int GL_ADD_SIGNED = 0x8574;
public static final int GL_INTERPOLATE = 0x8575;
public static final int GL_SUBTRACT = 0x84E7;
public static final int GL_CONSTANT = 0x8576;
public static final int GL_PRIMARY_COLOR = 0x8577;
public static final int GL_PREVIOUS = 0x8578;
public static final int GL_DOT3_RGB = 0x86AE;
public static final int GL_DOT3_RGBA = 0x86AF;
public static final int GL_CLAMP_TO_BORDER = 0x812D;
}

View File

@ -0,0 +1,94 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.opengl;
import java.nio.*;
import java.nio.IntBuffer;
import java.nio.FloatBuffer;
import java.nio.Buffer;
/**
* $Id: CoreGL.java,v 1.23 2003/07/23 14:51:19 elias_naur Exp $
*
* The core OpenGL1.4 API.
*
* @author cix_foo <cix_foo@users.sourceforge.net>
* @version $Revision: 1.23 $
*/
public abstract class CoreGL14 extends CoreGL13 implements CoreGL14Constants {
public static native void glFogCoordf(float coord);
public static void glFogCoordPointer(int stride, FloatBuffer data) {
assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled";
nglFogCoordPointer(GL_FLOAT, stride, data, data.position() << 2);
}
private static native void nglFogCoordPointer(int type, int stride, Buffer data, int data_offset);
public static void glFogCoordPointer(int type, int stride, int buffer_offset) {
assert VBOTracker.getVBOArrayStack().getState() != 0: "Cannot use int offsets when VBO is disabled";
nglFogCoordPointerVBO(type, stride, buffer_offset);
}
private static native void nglFogCoordPointerVBO(int type, int stride, int buffer_offset);
public static void glMultiDrawArrays(int mode, IntBuffer piFirst, IntBuffer piCount) {
assert piFirst.remaining() == piCount.remaining(): "piFirst.remaining() != piCount.remaining()";
nglMultiDrawArrays(mode, piFirst, piFirst.position(), piCount, piCount.position(), piFirst.remaining());
}
private static native void nglMultiDrawArrays(int mode, IntBuffer piFirst, int piFirst_offset, IntBuffer piCount, int piCount_offset, int primcount);
/* public static native void glMultiDrawElements(int mode, int piCount, int type, int pIndices, int primcount);*/
public static native void glPointParameterf (int pname, float param);
public static void glPointParameter(int pname, FloatBuffer params) {
nglPointParameterfv(pname, params, params.position());
}
private static native void nglPointParameterfv(int pname, FloatBuffer params, int params_offset);
public static native void glSecondaryColor3b (byte red, byte green, byte blue);
public static native void glSecondaryColor3f (float red, float green, float blue);
public static native void glSecondaryColor3ub (byte red, byte green, byte blue);
public static void glSecondaryColorPointer(int size, boolean unsigned, int stride, ByteBuffer data) {
assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled";
nglSecondaryColorPointer(size, unsigned ? GL_UNSIGNED_BYTE : GL_BYTE, stride, data, data.position());
}
public static void glSecondaryColorPointer(int size, int stride, FloatBuffer data) {
assert VBOTracker.getVBOArrayStack().getState() == 0: "Cannot use Buffers when VBO is enabled";
nglSecondaryColorPointer(size, GL_FLOAT, stride, data, data.position() << 2);
}
private static native void nglSecondaryColorPointer (int size, int type, int stride, Buffer data, int data_offset);
public static void glSecondaryColorPointer(int size, int type, int stride, int buffer_offset) {
assert VBOTracker.getVBOArrayStack().getState() != 0: "Cannot use int offsets when VBO is disabled";
nglSecondaryColorPointerVBO(size, type, stride, buffer_offset);
}
private static native void nglSecondaryColorPointerVBO(int size, int type, int stride, int buffer_offset);
public static native void glBlendFuncSeparate (int sfactorRGB, int dfactorRGB, int sfactorAlpha, int dfactorAlpha);
public static native void glWindowPos2f (float x, float y);
public static native void glWindowPos2i (int x, int y);
public static native void glWindowPos3f (float x, float y, float z);
public static native void glWindowPos3i (int x, int y, int z);
}

View File

@ -0,0 +1,83 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.opengl;
/**
* $Id$
*
* Core OpenGL 1.1 constants.
*
* @author cix_foo <cix_foo@users.sourceforge.net>
* @version $Revision$
*/
public interface CoreGL14Constants extends CoreGL13Constants {
public static final int GL_GENERATE_MIPMAP = 0x8191;
public static final int GL_GENERATE_MIPMAP_HINT = 0x8192;
public static final int GL_DEPTH_COMPONENT16 = 0x81A5;
public static final int GL_DEPTH_COMPONENT24 = 0x81A6;
public static final int GL_DEPTH_COMPONENT32 = 0x81A7;
public static final int GL_TEXTURE_DEPTH_SIZE = 0x884A;
public static final int GL_DEPTH_TEXTURE_MODE = 0x884B;
public static final int GL_TEXTURE_COMPARE_MODE = 0x884C;
public static final int GL_TEXTURE_COMPARE_FUNC = 0x884D;
public static final int GL_COMPARE_R_TO_TEXTURE = 0x884E;
public static final int GL_FOG_COORDINATE_SOURCE = 0x8450;
public static final int GL_FOG_COORDINATE = 0x8451;
public static final int GL_FRAGMENT_DEPTH = 0x8452;
public static final int GL_CURRENT_FOG_COORDINATE = 0x8453;
public static final int GL_FOG_COORDINATE_ARRAY_TYPE = 0x8454;
public static final int GL_FOG_COORDINATE_ARRAY_STRIDE = 0x8455;
public static final int GL_FOG_COORDINATE_ARRAY_POINTER = 0x8456;
public static final int GL_FOG_COORDINATE_ARRAY = 0x8457;
public static final int GL_POINT_SIZE_MIN = 0x8126;
public static final int GL_POINT_SIZE_MAX = 0x8127;
public static final int GL_POINT_FADE_THRESHOLD_SIZE = 0x8128;
public static final int GL_POINT_DISTANCE_ATTENUATION = 0x8129;
public static final int GL_COLOR_SUM = 0x8458;
public static final int GL_CURRENT_SECONDARY_COLOR = 0x8459;
public static final int GL_SECONDARY_COLOR_ARRAY_SIZE = 0x845A;
public static final int GL_SECONDARY_COLOR_ARRAY_TYPE = 0x845B;
public static final int GL_SECONDARY_COLOR_ARRAY_STRIDE = 0x845C;
public static final int GL_SECONDARY_COLOR_ARRAY_POINTER = 0x845D;
public static final int GL_SECONDARY_COLOR_ARRAY = 0x845E;
public static final int GL_BLEND_DST_RGB = 0x80C8;
public static final int GL_BLEND_SRC_RGB = 0x80C9;
public static final int GL_BLEND_DST_ALPHA = 0x80CA;
public static final int GL_BLEND_SRC_ALPHA = 0x80CB;
public static final int GL_INCR_WRAP = 0x8507;
public static final int GL_DECR_WRAP = 0x8508;
public static final int GL_TEXTURE_FILTER_CONTROL = 0x8500;
public static final int GL_TEXTURE_LOD_BIAS = 0x8501;
public static final int GL_MAX_TEXTURE_LOD_BIAS = 0x84FD;
public static final int GL_GL_MIRRORED_REPEAT = 0x8370;
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,265 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.opengl;
import org.lwjgl.Sys;
import java.lang.reflect.*;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.StringTokenizer;
/**
* $Id$
*
* A static class describing all supported GL capabilities.
*
* @author elias_naur <elias_naur@users.sourceforge.net>
* @version $Revision$
*/
public abstract class GLCaps {
/*
* Available extensions
*/
public static boolean GL_ARB_imaging;
public static boolean GL_ARB_depth_texture;
public static boolean GL_ARB_matrix_palette;
public static boolean GL_ARB_multisample;
public static boolean GL_ARB_multitexture;
public static boolean GL_ARB_point_parameters;
public static boolean GL_ARB_shadow;
public static boolean GL_ARB_shadow_ambient;
public static boolean GL_ARB_texture_compression;
public static boolean GL_ARB_texture_env_add;
public static boolean GL_ARB_texture_env_dot3;
public static boolean GL_ARB_texture_env_combine;
public static boolean GL_ARB_texture_env_crossbar;
public static boolean GL_ARB_texture_border_clamp;
public static boolean GL_ARB_texture_cube_map;
public static boolean GL_ARB_texture_mirrored_repeat;
public static boolean GL_ARB_transpose_matrix;
public static boolean GL_ARB_vertex_blend;
public static boolean GL_ARB_vertex_program;
public static boolean GL_ARB_vertex_buffer_object;
public static boolean GL_ARB_window_pos;
public static boolean GL_EXT_abgr;
public static boolean GL_EXT_bgra;
public static boolean GL_EXT_blend_color;
public static boolean GL_EXT_blend_function_separate;
public static boolean GL_EXT_blend_minmax;
public static boolean GL_EXT_blend_subtract;
public static boolean GL_EXT_compiled_vertex_array;
public static boolean GL_EXT_cull_vertex;
public static boolean GL_EXT_draw_range_elements;
public static boolean GL_EXT_fog_coord;
public static boolean GL_EXT_light_max_exponent;
public static boolean GL_EXT_multi_draw_arrays;
public static boolean GL_EXT_packed_pixels;
public static boolean GL_EXT_paletted_texture;
public static boolean GL_EXT_point_parameters;
public static boolean GL_EXT_rescale_normal;
public static boolean GL_EXT_secondary_color;
public static boolean GL_EXT_separate_specular_color;
public static boolean GL_EXT_shadow_funcs;
public static boolean GL_EXT_shared_texture_palette;
public static boolean GL_EXT_stencil_two_side;
public static boolean GL_EXT_stencil_wrap;
public static boolean GL_EXT_texture_compression_s3tc;
public static boolean GL_EXT_texture_env_combine;
public static boolean GL_EXT_texture_env_dot3;
public static boolean GL_EXT_texture_filter_anisotropic;
public static boolean GL_EXT_texture_lod_bias;
public static boolean GL_EXT_vertex_array;
public static boolean GL_EXT_vertex_shader;
public static boolean GL_EXT_vertex_weighting;
public static boolean GL_ATI_element_array;
public static boolean GL_ATI_envmap_bumpmap;
public static boolean GL_ATI_fragment_shader;
public static boolean GL_ATI_pn_triangles;
public static boolean GL_ATI_texture_mirror_once;
public static boolean GL_ATI_vertex_array_object;
public static boolean GL_ATI_vertex_streams;
public static boolean GL_ATIX_point_sprites;
public static boolean GL_ATIX_texture_env_route;
public static boolean GL_HP_occlusion_test;
public static boolean GL_NV_blend_square;
public static boolean GL_NV_copy_depth_to_color;
public static boolean GL_NV_depth_clamp;
public static boolean GL_NV_evaluators;
public static boolean GL_NV_fence;
public static boolean GL_NV_fog_distance;
public static boolean GL_NV_light_max_exponent;
public static boolean GL_NV_occlusion_query;
public static boolean GL_NV_packed_depth_stencil;
public static boolean GL_NV_point_sprite;
public static boolean GL_NV_register_combiners;
public static boolean GL_NV_register_combiners2;
public static boolean GL_NV_texgen_reflection;
public static boolean GL_NV_texture_env_combine4;
public static boolean GL_NV_texture_rectangle;
public static boolean GL_NV_texture_shader;
public static boolean GL_NV_texture_shader2;
public static boolean GL_NV_texture_shader3;
public static boolean GL_NV_vertex_array_range;
public static boolean GL_NV_vertex_array_range2;
public static boolean GL_NV_vertex_program;
public static boolean GL_NV_vertex_program1_1;
public static boolean GL_SGIS_generate_mipmap;
public static boolean GL_SGIX_shadow;
public static boolean GL_SGIX_depth_texture;
public static boolean OpenGL10;
public static boolean OpenGL11;
public static boolean OpenGL12;
public static boolean OpenGL13;
public static boolean OpenGL14;
/*
* Available WGL extensions
*/
public static boolean WGL_ARB_buffer_region;
public static boolean WGL_ARB_extensions_string;
public static boolean WGL_ARB_pbuffer;
public static boolean WGL_ARB_pixel_format;
public static boolean WGL_ARB_render_texture;
public static boolean WGL_EXT_extensions_string;
public static boolean WGL_EXT_swap_control;
static {
System.loadLibrary(Sys.getLibraryName());
}
private static void setExtensionFields(String exts, HashMap field_map) {
StringTokenizer st = new StringTokenizer(exts);
while (st.hasMoreTokens()) {
String ext = st.nextToken();
if(org.lwjgl.Sys.DEBUG) {
System.out.println(ext);
}
Field f = (Field)field_map.get(ext);
if (f != null) {
try {
f.setBoolean(GLCaps.class, true);
} catch (IllegalAccessException e) {
e.printStackTrace(System.err);
}
}
}
}
/**
* Determine which extensions are available. Use this to initialize capability fields.
* Can only be called _after_ a GLWindow or Pbuffer has been created.
*/
public static void determineAvailableExtensions() {
// Grab all the public static booleans out of this class
Field[] fields = GLCaps.class.getDeclaredFields();
HashMap map = new HashMap(fields.length);
for (int i = 0; i < fields.length; i++) {
if (Modifier.isStatic(fields[i].getModifiers())
&& fields[i].getType() == boolean.class) {
map.put(fields[i].getName(), fields[i]);
// reset fields
try {
fields[i].setBoolean(GLCaps.class, false);
} catch (IllegalAccessException e) {
e.printStackTrace(System.err);
}
}
}
determineAvailableWGLExtensions(map);
String exts = CoreGL11.glGetString(CoreGL11.GL_EXTENSIONS);
if(org.lwjgl.Sys.DEBUG) {
System.out.println("Available GL extensions:");
}
setExtensionFields(exts, map);
// Let's see what openGL version we are too:
String version = CoreGL11.glGetString(CoreGL11.GL_VERSION);
int i = version.indexOf("1.");
if (i > -1) {
char c = version.charAt(i + 2);
// Each case intentionally falls through!
switch (c) {
case '4':
OpenGL14 = true;
case '3':
OpenGL13 = true;
case '2':
OpenGL12 = true;
case '1':
OpenGL11 = true;
case '0':
OpenGL10 = true;
break ;
default:
// Unexpected character - ignore
}
}
}
private static native boolean isWGLEXTExtensionsStringAvailable();
private static native boolean isWGLARBExtensionsStringAvailable();
/**
* Determine which WGL extensions are available
*/
private static void determineAvailableWGLExtensions(HashMap field_map) {
// First we must determine if WGL_EXT_extensions_string is available
WGL_ARB_extensions_string = isWGLARBExtensionsStringAvailable();
WGL_EXT_extensions_string = isWGLEXTExtensionsStringAvailable();
if (!WGL_EXT_extensions_string && !WGL_ARB_extensions_string)
return;
final String exts;
if (WGL_ARB_extensions_string)
exts = GL.wglGetExtensionsStringARB();
// Remember - this is an HWND not an HDC, which is what's required. The native
// code on the other side of wglGetExtensionsStringARB gets the HDC from the HWND
// behind the scenes.
else
exts = GL.wglGetExtensionsStringEXT();
if (exts == null)
return;
if(org.lwjgl.Sys.DEBUG) {
System.out.println("Available WGL extensions:");
}
setExtensionFields(exts, field_map);
}
}

View File

@ -0,0 +1,142 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.opengl;
import org.lwjgl.opengl.arb.*;
import org.lwjgl.opengl.ati.*;
import org.lwjgl.opengl.ati.ATIElementArray;
import org.lwjgl.opengl.ati.ATIEnvmapBumpmap;
import org.lwjgl.opengl.atix.ATIXPointSprites;
import org.lwjgl.opengl.atix.ATIXTextureEnvRoute;
import org.lwjgl.opengl.ext.*;
import org.lwjgl.opengl.ext.EXTAbgr;
import org.lwjgl.opengl.ext.EXTCompiledVertexArray;
import org.lwjgl.opengl.nv.*;
import org.lwjgl.opengl.nv.NVCopyDepthToColor;
import org.lwjgl.opengl.nv.NVDepthClamp;
import org.lwjgl.opengl.wgl.*;
import org.lwjgl.opengl.wgl.WGLBufferRegion;
import org.lwjgl.opengl.wgl.WGLMakeCurrentRead;
/**
* $Id$
*
* All GL constants, including all supported extensions.
*
* @author cix_foo <cix_foo@users.sourceforge.net>
* @version $Revision$
*/
public interface GLConstants
extends
ARBCubeMap,
ARBDepthTexture,
ARBMatrixPalette,
ARBMultisample,
ARBMultitexture,
ARBPointParameters,
ARBShadow,
ARBShadowAmbient,
ARBTextureBorderClamp,
ARBTextureCompression,
ARBTextureEnvCombine,
ARBTextureEnvDot3,
ARBTextureMirroredRepeat,
ARBTransposeMatrix,
ARBVertexBlend,
ARBVertexBufferObject,
ARBVertexProgram,
ATIElementArray,
ATIEnvmapBumpmap,
ATIFragmentShader,
ATIPnTriangles,
ATITextureMirrorOnce,
ATIVertexArrayObject,
ATIVertexStreams,
ATIXPointSprites,
ATIXTextureEnvRoute,
EXTAbgr,
EXTBgra,
EXTBlendColor,
EXTBlendMinmax,
EXTCompiledVertexArray,
EXTDrawRangeElements,
EXTFogCoord,
EXTLightMaxExponent,
EXTPackedPixels,
EXTPalettedTexture,
EXTPointParameters,
EXTRescaleNormal,
EXTSecondaryColor,
EXTSeparateSpecularColor,
EXTSharedTexturePalette,
EXTStencilTwoSide,
EXTStencilWrap,
EXTTextureCompressionS3TC,
EXTTextureEnvCombine,
EXTTextureEnvDot3,
EXTTextureFilterAnisotropic,
EXTTextureLODBias,
EXTVertexArray,
EXTVertexShader,
EXTVertexWeighting,
NVCopyDepthToColor,
NVDepthClamp,
NVEvaluators,
NVFence,
NVFogDistance,
NVLightMaxExponent,
NVOcclusionQuery,
NVPackedDepthStencil,
NVPointSprite,
NVRegisterCombiners,
NVRegisterCombiners2,
NVTexgenReflection,
NVTextureEnvCombine4,
NVTextureRectangle,
NVTextureShader,
NVTextureShader2,
NVTextureShader3,
NVVertexArrayRange,
NVVertexArrayRange2,
NVVertexProgram,
WGLBufferRegion,
WGLMakeCurrentRead,
WGLMultisample,
WGLPBuffer,
WGLPixelFormat,
WGLRenderTexture,
CoreGL14Constants
{
}

View File

@ -0,0 +1,204 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.opengl;
import org.lwjgl.Sys;
import java.nio.ByteBuffer;
import java.nio.IntBuffer;
import java.nio.DoubleBuffer;
/**
* $Id$
*
* GL Utilities library.
*
* @author cix_foo <cix_foo@users.sourceforge.net>
* @version $Revision$
*/
public abstract class GLU implements GLUConstants {
static {
System.loadLibrary(Sys.getLibraryName());
}
public static native String gluErrorString(int errCode);
public static native String gluGetString(int name);
public static native void gluOrtho2D(
double left,
double right,
double bottom,
double top);
public static native void gluPerspective(
double fovy,
double aspect,
double zNear,
double zFar);
public static void gluPickMatrix(double x, double y, double width, double height, IntBuffer viewport) {
ngluPickMatrix(x, y, width, height, viewport, viewport.position());
}
private static native void ngluPickMatrix(double x, double y, double width, double height, IntBuffer viewport, int viewport_offset);
public static native void gluLookAt(
double eyex,
double eyey,
double eyez,
double centerx,
double centery,
double centerz,
double upx,
double upy,
double upz);
public static int gluProject(
double objx,
double objy,
double objz,
DoubleBuffer modelMatrix,
DoubleBuffer projMatrix,
IntBuffer viewport,
DoubleBuffer win
) {
return ngluProject(objx, objy, objz, modelMatrix, modelMatrix.position(), projMatrix, projMatrix.position(), viewport, viewport.position(), win, win.position());
}
private static native int ngluProject(
double objx,
double objy,
double objz,
DoubleBuffer modelMatrix,
int modelMatrix_offset,
DoubleBuffer projMatrix,
int projMatrix_offset,
IntBuffer viewport,
int viewport_ofset,
DoubleBuffer win,
int win_offset
);
public static int gluUnProject(
double winx,
double winy,
double winz,
DoubleBuffer modelMatrix,
DoubleBuffer projMatrix,
IntBuffer viewport,
DoubleBuffer obj
) {
return ngluUnProject(winx, winy, winz, modelMatrix, modelMatrix.position(), projMatrix, projMatrix.position(), viewport, viewport.position(), obj, obj.position());
}
private static native int ngluUnProject(
double winx,
double winy,
double winz,
DoubleBuffer modelMatrix,
int modelMatrix_offset,
DoubleBuffer projMatrix,
int projMatrix_offset,
IntBuffer viewport,
int viewport_offset,
DoubleBuffer obj,
int obj_offset
);
public static int gluScaleImage(
int format,
int widthin,
int heightin,
int typein,
ByteBuffer datain,
int widthout, int heightout, int typeout, ByteBuffer dataout
) {
return ngluScaleImage(format, widthin, heightin, typein, datain, datain.position(), widthout, heightout, typeout, dataout, dataout.position());
}
private static native int ngluScaleImage(
int format,
int widthin,
int heightin,
int typein,
ByteBuffer datain,
int datain_offset,
int widthout, int heightout, int typeout, ByteBuffer dataout, int dataout_offset
);
public static int gluBuild1DMipmaps(
int target,
int components,
int width,
int format,
int type,
ByteBuffer data
) {
return ngluBuild1DMipmaps(target, components, width, format, type, data, data.position());
}
private static native int ngluBuild1DMipmaps(
int target,
int components,
int width,
int format,
int type,
ByteBuffer data,
int data_offset
);
public static int gluBuild2DMipmaps(
int target,
int components,
int width,
int height,
int format,
int type,
ByteBuffer data
) {
return ngluBuild2DMipmaps(target, components, width, height, format, type, data, data.position());
}
private static native int ngluBuild2DMipmaps(
int target,
int components,
int width,
int height,
int format,
int type,
ByteBuffer data,
int data_offset
);
}

View File

@ -0,0 +1,59 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.opengl;
/**
* $Id$
*
* GLU constants.
*
* @author cix_foo <cix_foo@users.sourceforge.net>
* @version $Revision$
*/
public interface GLUConstants {
/* Errors: (return value 0 = no error) */
public static final int GLU_INVALID_ENUM = 100900;
public static final int GLU_INVALID_VALUE = 100901;
public static final int GLU_OUT_OF_MEMORY = 100902;
public static final int GLU_INCOMPATIBLE_GL_VERSION = 100903;
/* StringName */
public static final int GLU_VERSION = 100800;
public static final int GLU_EXTENSIONS = 100801;
/* Boolean */
public static final int GLU_TRUE = CoreGL11Constants.GL_TRUE;
public static final int GLU_FALSE = CoreGL11Constants.GL_FALSE;
}

View File

@ -0,0 +1,78 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.opengl;
/**
* $Id$
*
* Thrown by the debug build library of the LWJGL if any OpenGL operation
* causes an error.
*
* @author cix_foo <cix_foo@users.sourceforge.net>
* @version $Revision$
*/
public class OpenGLException extends RuntimeException {
/**
* Constructor for OpenGLException.
*/
public OpenGLException() {
super();
}
/**
* Constructor for OpenGLException.
* @param message
*/
public OpenGLException(String message) {
super(message);
}
/**
* Constructor for OpenGLException.
* @param message
* @param cause
*/
public OpenGLException(String message, Throwable cause) {
super(message, cause);
}
/**
* Constructor for OpenGLException.
* @param cause
*/
public OpenGLException(Throwable cause) {
super(cause);
}
}

View File

@ -0,0 +1,168 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.opengl;
import org.lwjgl.*;
/**
* $Id$
*
* Pbuffer encapsulates an OpenGL pbuffer.
*
* Each instance of GL is only valid in the thread that creates it.
* In addition, only one instance of an OpenGL window or Pbuffer may be
* the current GL context in any one thread. To make a GL instance the
* current context, use makeCurrent().
*
* @author elias_naur <elias_naur@users.sourceforge.net>
* @version $Revision$
*/
public class Pbuffer {
public final static int PBUFFER_SUPPORTED = 1;
/** Current Pbuffer */
private static Pbuffer currentBuffer = null;
/** Handle to the native GL rendering context */
private final int handle;
/** Tracks VBO state */
private final VBOTracker vbo_tracker;
static {
System.loadLibrary(Sys.getLibraryName());
}
/**
* Construct an instance of a Pbuffer. If this fails then an Exception will be thrown.
* The buffer is single-buffered.
*
* NOTE: An OpenGL window must be created before a Pbuffer can be created. The Pbuffer will
* have its own context that shares display lists and textures with the OpenGL window context,
* but it will have its own OpenGL state. Therefore, state changes to a pbuffer will not be seen
* in the window context and vice versa.
*
* NOTE: Some OpenGL implementations requires the shared contexts to use the same pixel format.
* So if possible, use the same bpp, alpha, depth and stencil values used to create the main window.
*
* @param width Pbuffer width
* @param height Pbuffer height
* @param bpp Minimum bits per pixel
* @param alpha Minimum bits per pixel in alpha buffer
* @param depth Minimum bits per pixel in depth buffer
* @param stencil Minimum bits per pixel in stencil buffer
*/
public Pbuffer(int width, int height, int bpp, int alpha, int depth, int stencil) throws Exception {
handle = nCreate(width, height, bpp, alpha, depth, stencil);
vbo_tracker = new VBOTracker();
}
/**
* Method to release the current Pbuffer context and make the OpenGL window current.
*/
public static void releaseContext() {
currentBuffer = null;
VBOTracker.releaseCurrent();
nReleaseContext();
}
/**
* Method to test for validity of the buffer. If this function returns true,
* the buffer contents is lost. The buffer can still be used, but the results are undefined.
* The application is expected to release the buffer if needed, destroy it and recreate a new
* buffer.
*
* @return true if the buffer is lost and destroyed, false if the buffer is valid.
*/
public boolean isBufferLost() {
return nIsBufferLost(handle);
}
/**
* Native method to test for buffer integrity
*/
private native static boolean nIsBufferLost(int handle);
/**
* Native method to release the context.
*/
private native static void nReleaseContext();
/**
* Method to make the Pbuffer context current. All subsequent OpenGL
* calls will go to this buffer.
*/
public void makeCurrent() {
currentBuffer = this;
VBOTracker.setCurrent(vbo_tracker);
nMakeCurrent(handle);
}
/**
* Native method to make a pbuffer current.
*/
private native static void nMakeCurrent(int handle);
/**
* Gets the Pbuffer capabilities. Only the flag PBUFFER_SUPPORTED is
* available, and indicates that Pbuffers can be created.
*
* @return a bitmask of Pbuffer capabilities.
*/
public static native int getPbufferCaps();
/**
* Native method to create a Pbuffer
*/
private native static int nCreate(
int width,
int height,
int bpp,
int alpha,
int depth,
int stencil) throws Exception;
/**
* Destroys the Pbuffer. The buffer must not be current.
*/
public void destroy() {
if (currentBuffer == this)
releaseContext();
nDestroy(handle);
}
/**
* Natively destroy any GL-related stuff
*/
private native static void nDestroy(int handle);
}

View File

@ -0,0 +1,64 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.opengl;
class StateStack {
/** Only int state is tracked */
private final int[] state_stack;
private int stack_pos;
public int getState() {
return state_stack[stack_pos];
}
public void setState(int new_state) {
state_stack[stack_pos] = new_state;
}
public void pushState() {
stack_pos++;
state_stack[stack_pos] = state_stack[stack_pos - 1];
}
public int popState() {
int result = state_stack[stack_pos];
stack_pos--;
return result;
}
public StateStack(int stack_size, int initial_value) {
state_stack = new int[stack_size];
stack_pos = 0;
state_stack[stack_pos] = initial_value;
}
}

View File

@ -0,0 +1,64 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.opengl;
import java.nio.*;
/**
* Simple utility class.
*
* @author cix_foo <cix_foo@users.sourceforge.net>
* @version $Revision$
*/
abstract class Util {
private final static IntBuffer int_buffer = ByteBuffer.allocateDirect(4).order(ByteOrder.nativeOrder()).asIntBuffer();
/**
* A helper function which is used to get the byte offset in an arbitrary buffer
* based on its position
* @return the position of the buffer, in BYTES
*/
static int getOffset(Buffer buffer) {
if (buffer instanceof FloatBuffer || buffer instanceof IntBuffer)
return buffer.position() << 2;
else if (buffer instanceof ShortBuffer || buffer instanceof CharBuffer)
return buffer.position() << 1;
else if (buffer instanceof DoubleBuffer || buffer instanceof LongBuffer)
return buffer.position() << 3;
else
return buffer.position();
}
static int getGLInteger(int enum) {
CoreGL11.glGetInteger(enum, int_buffer);
return int_buffer.get(0);
}
}

View File

@ -0,0 +1,69 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.opengl;
class VBOTracker {
private static VBOTracker default_tracker = new VBOTracker();
private static VBOTracker current_tracker = default_tracker;
private final StateStack vbo_array_stack;
private final StateStack vbo_element_stack;
private final StateStack attrib_stack;
public static void setCurrent(VBOTracker tracker) {
current_tracker = tracker;
}
public static void releaseCurrent() {
current_tracker = default_tracker;
}
public VBOTracker() {
int stack_size = Util.getGLInteger(CoreGL11Constants.GL_MAX_CLIENT_ATTRIB_STACK_DEPTH);
vbo_array_stack = new StateStack(stack_size, 0);
vbo_element_stack = new StateStack(stack_size, 0);
attrib_stack = new StateStack(stack_size, 0);
}
public static StateStack getVBOArrayStack() {
return current_tracker.vbo_array_stack;
}
public static StateStack getVBOElementStack() {
return current_tracker.vbo_element_stack;
}
public static StateStack getClientAttribStack() {
return current_tracker.attrib_stack;
}
}

View File

@ -332,5 +332,5 @@ public final class Window {
* Updates the windows internal state. This must be called at least once per video frame * Updates the windows internal state. This must be called at least once per video frame
* to handle window close requests, moves, paints, etc. * to handle window close requests, moves, paints, etc.
*/ */
public static native void update(); public static native void updateState();
} }

View File

@ -0,0 +1,56 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:11:04
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.arb;
public interface ARBCubeMap
{
public static final int GL_NORMAL_MAP_ARB = 0x8511;
public static final int GL_REFLECTION_MAP_ARB = 0x8512;
public static final int GL_TEXTURE_CUBE_MAP_ARB = 0x8513;
public static final int GL_TEXTURE_BINDING_CUBE_MAP_ARB = 0x8514;
public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB = 0x8515;
public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB = 0x8516;
public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB = 0x8517;
public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB = 0x8518;
public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB = 0x8519;
public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB = 0x851A;
public static final int GL_PROXY_TEXTURE_CUBE_MAP_ARB = 0x851B;
public static final int GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB = 0x851C;
}

View File

@ -0,0 +1,49 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:59:46
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.arb;
public interface ARBDepthTexture
{
public static final int GL_DEPTH_COMPONENT16_ARB = 0x81A5;
public static final int GL_DEPTH_COMPONENT24_ARB = 0x81A6;
public static final int GL_DEPTH_COMPONENT32_ARB = 0x81A7;
public static final int GL_TEXTURE_DEPTH_SIZE_ARB = 0x884A;
public static final int GL_DEPTH_TEXTURE_MODE_ARB = 0x884B;
}

View File

@ -0,0 +1,54 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:32:23
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.arb;
public interface ARBMatrixPalette
{
public static final int GL_MATRIX_PALETTE_ARB = 0x8840;
public static final int GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB = 0x8841;
public static final int GL_MAX_PALETTE_MATRICES_ARB = 0x8842;
public static final int GL_CURRENT_PALETTE_MATRIX_ARB = 0x8843;
public static final int GL_MATRIX_INDEX_ARRAY_ARB = 0x8844;
public static final int GL_CURRENT_MATRIX_INDEX_ARB = 0x8845;
public static final int GL_MATRIX_INDEX_ARRAY_SIZE_ARB = 0x8846;
public static final int GL_MATRIX_INDEX_ARRAY_TYPE_ARB = 0x8847;
public static final int GL_MATRIX_INDEX_ARRAY_STRIDE_ARB = 0x8848;
public static final int GL_MATRIX_INDEX_ARRAY_POINTER_ARB = 0x8849;
}

View File

@ -0,0 +1,53 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:21:23
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.arb;
public interface ARBMultisample
{
public static final int GL_MULTISAMPLE_ARB = 0x809D;
public static final int GL_SAMPLE_ALPHA_TO_COVERAGE_ARB = 0x809E;
public static final int GL_SAMPLE_ALPHA_TO_ONE_ARB = 0x809F;
public static final int GL_SAMPLE_COVERAGE_ARB = 0x80A0;
public static final int GL_SAMPLE_BUFFERS_ARB = 0x80A8;
public static final int GL_SAMPLES_ARB = 0x80A9;
public static final int GL_SAMPLE_COVERAGE_VALUE_ARB = 0x80AA;
public static final int GL_SAMPLE_COVERAGE_INVERT_ARB = 0x80AB;
public static final int GL_MULTISAMPLE_BIT_ARB = 0x20000000;
}

View File

@ -0,0 +1,79 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:06:09
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.arb;
public interface ARBMultitexture
{
public static final int GL_TEXTURE0_ARB = 0x84C0;
public static final int GL_TEXTURE1_ARB = 0x84C1;
public static final int GL_TEXTURE2_ARB = 0x84C2;
public static final int GL_TEXTURE3_ARB = 0x84C3;
public static final int GL_TEXTURE4_ARB = 0x84C4;
public static final int GL_TEXTURE5_ARB = 0x84C5;
public static final int GL_TEXTURE6_ARB = 0x84C6;
public static final int GL_TEXTURE7_ARB = 0x84C7;
public static final int GL_TEXTURE8_ARB = 0x84C8;
public static final int GL_TEXTURE9_ARB = 0x84C9;
public static final int GL_TEXTURE10_ARB = 0x84CA;
public static final int GL_TEXTURE11_ARB = 0x84CB;
public static final int GL_TEXTURE12_ARB = 0x84CC;
public static final int GL_TEXTURE13_ARB = 0x84CD;
public static final int GL_TEXTURE14_ARB = 0x84CE;
public static final int GL_TEXTURE15_ARB = 0x84CF;
public static final int GL_TEXTURE16_ARB = 0x84D0;
public static final int GL_TEXTURE17_ARB = 0x84D1;
public static final int GL_TEXTURE18_ARB = 0x84D2;
public static final int GL_TEXTURE19_ARB = 0x84D3;
public static final int GL_TEXTURE20_ARB = 0x84D4;
public static final int GL_TEXTURE21_ARB = 0x84D5;
public static final int GL_TEXTURE22_ARB = 0x84D6;
public static final int GL_TEXTURE23_ARB = 0x84D7;
public static final int GL_TEXTURE24_ARB = 0x84D8;
public static final int GL_TEXTURE25_ARB = 0x84D9;
public static final int GL_TEXTURE26_ARB = 0x84DA;
public static final int GL_TEXTURE27_ARB = 0x84DB;
public static final int GL_TEXTURE28_ARB = 0x84DC;
public static final int GL_TEXTURE29_ARB = 0x84DD;
public static final int GL_TEXTURE30_ARB = 0x84DE;
public static final int GL_TEXTURE31_ARB = 0x84DF;
public static final int GL_ACTIVE_TEXTURE_ARB = 0x84E0;
public static final int GL_CLIENT_ACTIVE_TEXTURE_ARB = 0x84E1;
public static final int GL_MAX_TEXTURE_UNITS_ARB = 0x84E2;
}

View File

@ -0,0 +1,48 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:31:36
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.arb;
public interface ARBPointParameters
{
public static final int GL_POINT_SIZE_MIN_ARB = 0x8126;
public static final int GL_POINT_SIZE_MAX_ARB = 0x8127;
public static final int GL_POINT_FADE_THRESHOLD_SIZE_ARB = 0x8128;
public static final int GL_POINT_DISTANCE_ATTENUATION_ARB = 0x8129;
}

View File

@ -0,0 +1,47 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:58:50
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.arb;
public interface ARBShadow
{
public static final int GL_TEXTURE_COMPARE_MODE_ARB = 0x884C;
public static final int GL_TEXTURE_COMPARE_FUNC_ARB = 0x884D;
public static final int GL_COMPARE_R_TO_TEXTURE_ARB = 0x884E;
}

View File

@ -0,0 +1,45 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:59:19
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.arb;
public interface ARBShadowAmbient
{
public static final int GL_TEXTURE_COMPARE_FAIL_VALUE_ARB = 0x80BF;
}

View File

@ -0,0 +1,45 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:16:42
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.arb;
public interface ARBTextureBorderClamp
{
public static final int GL_CLAMP_TO_BORDER_ARB = 0x812D;
}

View File

@ -0,0 +1,55 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:10:08
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.arb;
public interface ARBTextureCompression
{
public static final int GL_COMPRESSED_ALPHA_ARB = 0x84E9;
public static final int GL_COMPRESSED_LUMINANCE_ARB = 0x84EA;
public static final int GL_COMPRESSED_LUMINANCE_ALPHA_ARB = 0x84EB;
public static final int GL_COMPRESSED_INTENSITY_ARB = 0x84EC;
public static final int GL_COMPRESSED_RGB_ARB = 0x84ED;
public static final int GL_COMPRESSED_RGBA_ARB = 0x84EE;
public static final int GL_TEXTURE_COMPRESSION_HINT_ARB = 0x84EF;
public static final int GL_TEXTURE_IMAGE_SIZE_ARB = 0x86A0;
public static final int GL_TEXTURE_COMPRESSED_ARB = 0x86A1;
public static final int GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB = 0x86A2;
public static final int GL_COMPRESSED_TEXTURE_FORMATS_ARB = 0x86A3;
}

View File

@ -0,0 +1,65 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:14:40
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.arb;
public interface ARBTextureEnvCombine
{
public static final int GL_COMBINE_ARB = 0x8570;
public static final int GL_COMBINE_RGB_ARB = 0x8571;
public static final int GL_COMBINE_ALPHA_ARB = 0x8572;
public static final int GL_RGB_SCALE_ARB = 0x8573;
public static final int GL_ADD_SIGNED_ARB = 0x8574;
public static final int GL_INTERPOLATE_ARB = 0x8575;
public static final int GL_CONSTANT_ARB = 0x8576;
public static final int GL_PRIMARY_COLOR_ARB = 0x8577;
public static final int GL_PREVIOUS_ARB = 0x8578;
public static final int GL_SOURCE0_RGB_ARB = 0x8580;
public static final int GL_SOURCE1_RGB_ARB = 0x8581;
public static final int GL_SOURCE2_RGB_ARB = 0x8582;
public static final int GL_SOURCE0_ALPHA_ARB = 0x8588;
public static final int GL_SOURCE1_ALPHA_ARB = 0x8589;
public static final int GL_SOURCE2_ALPHA_ARB = 0x858A;
public static final int GL_OPERAND0_RGB_ARB = 0x8590;
public static final int GL_OPERAND1_RGB_ARB = 0x8591;
public static final int GL_OPERAND2_RGB_ARB = 0x8592;
public static final int GL_OPERAND0_ALPHA_ARB = 0x8598;
public static final int GL_OPERAND1_ALPHA_ARB = 0x8599;
public static final int GL_OPERAND2_ALPHA_ARB = 0x859A;
}

View File

@ -0,0 +1,47 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:15:16
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.arb;
public interface ARBTextureEnvDot3
{
public static final int GL_DOT3_RGB_ARB = 0x86AE;
public static final int GL_DOT3_RGBA_ARB = 0x86AF;
}

View File

@ -0,0 +1,45 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:58:27
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.arb;
public interface ARBTextureMirroredRepeat
{
public static final int GL_MIRRORED_REPEAT_ARB = 0x8370;
}

View File

@ -0,0 +1,48 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:08:52
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.arb;
public interface ARBTransposeMatrix
{
public static final int GL_TRANSPOSE_MODELVIEW_MATRIX_ARB = 0x84E3;
public static final int GL_TRANSPOSE_PROJECTION_MATRIX_ARB = 0x84E4;
public static final int GL_TRANSPOSE_TEXTURE_MATRIX_ARB = 0x84E5;
public static final int GL_TRANSPOSE_COLOR_MATRIX_ARB = 0x84E6;
}

View File

@ -0,0 +1,86 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:31:57
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.arb;
public interface ARBVertexBlend
{
public static final int GL_MAX_VERTEX_UNITS_ARB = 0x86A4;
public static final int GL_ACTIVE_VERTEX_UNITS_ARB = 0x86A5;
public static final int GL_WEIGHT_SUM_UNITY_ARB = 0x86A6;
public static final int GL_VERTEX_BLEND_ARB = 0x86A7;
public static final int GL_CURRENT_WEIGHT_ARB = 0x86A8;
public static final int GL_WEIGHT_ARRAY_TYPE_ARB = 0x86A9;
public static final int GL_WEIGHT_ARRAY_STRIDE_ARB = 0x86AA;
public static final int GL_WEIGHT_ARRAY_SIZE_ARB = 0x86AB;
public static final int GL_WEIGHT_ARRAY_POINTER_ARB = 0x86AC;
public static final int GL_WEIGHT_ARRAY_ARB = 0x86AD;
public static final int GL_MODELVIEW0_ARB = 0x1700;
public static final int GL_MODELVIEW1_ARB = 0x850a;
public static final int GL_MODELVIEW2_ARB = 0x8722;
public static final int GL_MODELVIEW3_ARB = 0x8723;
public static final int GL_MODELVIEW4_ARB = 0x8724;
public static final int GL_MODELVIEW5_ARB = 0x8725;
public static final int GL_MODELVIEW6_ARB = 0x8726;
public static final int GL_MODELVIEW7_ARB = 0x8727;
public static final int GL_MODELVIEW8_ARB = 0x8728;
public static final int GL_MODELVIEW9_ARB = 0x8729;
public static final int GL_MODELVIEW10_ARB = 0x872A;
public static final int GL_MODELVIEW11_ARB = 0x872B;
public static final int GL_MODELVIEW12_ARB = 0x872C;
public static final int GL_MODELVIEW13_ARB = 0x872D;
public static final int GL_MODELVIEW14_ARB = 0x872E;
public static final int GL_MODELVIEW15_ARB = 0x872F;
public static final int GL_MODELVIEW16_ARB = 0x8730;
public static final int GL_MODELVIEW17_ARB = 0x8731;
public static final int GL_MODELVIEW18_ARB = 0x8732;
public static final int GL_MODELVIEW19_ARB = 0x8733;
public static final int GL_MODELVIEW20_ARB = 0x8734;
public static final int GL_MODELVIEW21_ARB = 0x8735;
public static final int GL_MODELVIEW22_ARB = 0x8736;
public static final int GL_MODELVIEW23_ARB = 0x8737;
public static final int GL_MODELVIEW24_ARB = 0x8738;
public static final int GL_MODELVIEW25_ARB = 0x8739;
public static final int GL_MODELVIEW26_ARB = 0x873A;
public static final int GL_MODELVIEW27_ARB = 0x873B;
public static final int GL_MODELVIEW28_ARB = 0x873C;
public static final int GL_MODELVIEW29_ARB = 0x873D;
public static final int GL_MODELVIEW30_ARB = 0x873E;
public static final int GL_MODELVIEW31_ARB = 0x873F;
}

View File

@ -0,0 +1,77 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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$
*
* ARB_vertex_buffer_object constants.
*
* @author elias_naur <elias_naur@users.sourceforge.net>
* @version $Revision$
*/
package org.lwjgl.opengl.arb;
public interface ARBVertexBufferObject
{
public static final int GL_ARRAY_BUFFER_ARB = 0x8892;
public static final int GL_ELEMENT_ARRAY_BUFFER_ARB = 0x8893;
public static final int GL_ARRAY_BUFFER_BINDING_ARB = 0x8894;
public static final int GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB = 0x8895;
public static final int GL_VERTEX_ARRAY_BUFFER_BINDING_ARB = 0x8896;
public static final int GL_NORMAL_ARRAY_BUFFER_BINDING_ARB = 0x8897;
public static final int GL_COLOR_ARRAY_BUFFER_BINDING_ARB = 0x8898;
public static final int GL_INDEX_ARRAY_BUFFER_BINDING_ARB = 0x8899;
public static final int GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB = 0x889A;
public static final int GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB = 0x889B;
public static final int GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB = 0x889C;
public static final int GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB = 0x889D;
public static final int GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB = 0x889E;
public static final int GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB = 0x889F;
public static final int GL_STREAM_DRAW_ARB = 0x88E0;
public static final int GL_STREAM_READ_ARB = 0x88E1;
public static final int GL_STREAM_COPY_ARB = 0x88E2;
public static final int GL_STATIC_DRAW_ARB = 0x88E4;
public static final int GL_STATIC_READ_ARB = 0x88E5;
public static final int GL_STATIC_COPY_ARB = 0x88E6;
public static final int GL_DYNAMIC_DRAW_ARB = 0x88E8;
public static final int GL_DYNAMIC_READ_ARB = 0x88E9;
public static final int GL_DYNAMIC_COPY_ARB = 0x88EA;
public static final int GL_READ_ONLY_ARB = 0x88B8;
public static final int GL_WRITE_ONLY_ARB = 0x88B9;
public static final int GL_READ_WRITE_ARB = 0x88BA;
public static final int GL_BUFFER_SIZE_ARB = 0x8764;
public static final int GL_BUFFER_USAGE_ARB = 0x8765;
public static final int GL_BUFFER_ACCESS_ARB = 0x88BB;
public static final int GL_BUFFER_MAPPED_ARB = 0x88BC;
public static final int GL_BUFFER_MAP_POINTER_ARB = 0x88BD;
}

View File

@ -0,0 +1,123 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 16:02:30
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.arb;
public interface ARBVertexProgram
{
public static final int GL_VERTEX_PROGRAM_ARB = 0x8620;
public static final int GL_VERTEX_PROGRAM_POINT_SIZE_ARB = 0x8642;
public static final int GL_VERTEX_PROGRAM_TWO_SIDE_ARB = 0x8643;
public static final int GL_COLOR_SUM_ARB = 0x8458;
public static final int GL_PROGRAM_FORMAT_ASCII_ARB = 0x8875;
public static final int GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB = 0x8622;
public static final int GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB = 0x8623;
public static final int GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB = 0x8624;
public static final int GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB = 0x8625;
public static final int GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB = 0x886A;
public static final int GL_CURRENT_VERTEX_ATTRIB_ARB = 0x8626;
public static final int GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB = 0x8645;
public static final int GL_PROGRAM_LENGTH_ARB = 0x8627;
public static final int GL_PROGRAM_FORMAT_ARB = 0x8876;
public static final int GL_PROGRAM_BINDING_ARB = 0x8677;
public static final int GL_PROGRAM_INSTRUCTIONS_ARB = 0x88A0;
public static final int GL_MAX_PROGRAM_INSTRUCTIONS_ARB = 0x88A1;
public static final int GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB = 0x88A2;
public static final int GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB = 0x88A3;
public static final int GL_PROGRAM_TEMPORARIES_ARB = 0x88A4;
public static final int GL_MAX_PROGRAM_TEMPORARIES_ARB = 0x88A5;
public static final int GL_PROGRAM_NATIVE_TEMPORARIES_ARB = 0x88A6;
public static final int GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB = 0x88A7;
public static final int GL_PROGRAM_PARAMETERS_ARB = 0x88A8;
public static final int GL_MAX_PROGRAM_PARAMETERS_ARB = 0x88A9;
public static final int GL_PROGRAM_NATIVE_PARAMETERS_ARB = 0x88AA;
public static final int GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB = 0x88AB;
public static final int GL_PROGRAM_ATTRIBS_ARB = 0x88AC;
public static final int GL_MAX_PROGRAM_ATTRIBS_ARB = 0x88AD;
public static final int GL_PROGRAM_NATIVE_ATTRIBS_ARB = 0x88AE;
public static final int GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB = 0x88AF;
public static final int GL_PROGRAM_ADDRESS_REGISTERS_ARB = 0x88B0;
public static final int GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB = 0x88B1;
public static final int GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB = 0x88B2;
public static final int GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB = 0x88B3;
public static final int GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB = 0x88B4;
public static final int GL_MAX_PROGRAM_ENV_PARAMETERS_ARB = 0x88B5;
public static final int GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB = 0x88B6;
public static final int GL_PROGRAM_STRING_ARB = 0x8628;
public static final int GL_PROGRAM_ERROR_POSITION_ARB = 0x864B;
public static final int GL_CURRENT_MATRIX_ARB = 0x8641;
public static final int GL_TRANSPOSE_CURRENT_MATRIX_ARB = 0x88B7;
public static final int GL_CURRENT_MATRIX_STACK_DEPTH_ARB = 0x8640;
public static final int GL_MAX_VERTEX_ATTRIBS_ARB = 0x8869;
public static final int GL_MAX_PROGRAM_MATRICES_ARB = 0x862F;
public static final int GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB = 0x862E;
public static final int GL_PROGRAM_ERROR_STRING_ARB = 0x8874;
public static final int GL_MATRIX0_ARB = 0x88C0;
public static final int GL_MATRIX1_ARB = 0x88C1;
public static final int GL_MATRIX2_ARB = 0x88C2;
public static final int GL_MATRIX3_ARB = 0x88C3;
public static final int GL_MATRIX4_ARB = 0x88C4;
public static final int GL_MATRIX5_ARB = 0x88C5;
public static final int GL_MATRIX6_ARB = 0x88C6;
public static final int GL_MATRIX7_ARB = 0x88C7;
public static final int GL_MATRIX8_ARB = 0x88C8;
public static final int GL_MATRIX9_ARB = 0x88C9;
public static final int GL_MATRIX10_ARB = 0x88CA;
public static final int GL_MATRIX11_ARB = 0x88CB;
public static final int GL_MATRIX12_ARB = 0x88CC;
public static final int GL_MATRIX13_ARB = 0x88CD;
public static final int GL_MATRIX14_ARB = 0x88CE;
public static final int GL_MATRIX15_ARB = 0x88CF;
public static final int GL_MATRIX16_ARB = 0x88D0;
public static final int GL_MATRIX17_ARB = 0x88D1;
public static final int GL_MATRIX18_ARB = 0x88D2;
public static final int GL_MATRIX19_ARB = 0x88D3;
public static final int GL_MATRIX20_ARB = 0x88D4;
public static final int GL_MATRIX21_ARB = 0x88D5;
public static final int GL_MATRIX22_ARB = 0x88D6;
public static final int GL_MATRIX23_ARB = 0x88D7;
public static final int GL_MATRIX24_ARB = 0x88D8;
public static final int GL_MATRIX25_ARB = 0x88D9;
public static final int GL_MATRIX26_ARB = 0x88DA;
public static final int GL_MATRIX27_ARB = 0x88DB;
public static final int GL_MATRIX28_ARB = 0x88DC;
public static final int GL_MATRIX29_ARB = 0x88DD;
public static final int GL_MATRIX30_ARB = 0x88DE;
public static final int GL_MATRIX31_ARB = 0x88DF;
}

View File

@ -0,0 +1,47 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:34:52
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.ati;
public interface ATIElementArray
{
public static final int GL_ELEMENT_ARRAY_ATI = 0x8768;
public static final int GL_ELEMENT_ARRAY_TYPE_ATI = 0x8769;
public static final int GL_ELEMENT_ARRAY_POINTER_ATI = 0x876A;
}

View File

@ -0,0 +1,52 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:33:36
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.ati;
public interface ATIEnvmapBumpmap
{
public static final int GL_BUMP_ROT_MATRIX_ATI = 0x8775;
public static final int GL_BUMP_ROT_MATRIX_SIZE_ATI = 0x8776;
public static final int GL_BUMP_NUM_TEX_UNITS_ATI = 0x8777;
public static final int GL_BUMP_TEX_UNITS_ATI = 0x8778;
public static final int GL_DUDV_ATI = 0x8779;
public static final int GL_DU8DV8_ATI = 0x877A;
public static final int GL_BUMP_ENVMAP_ATI = 0x877B;
public static final int GL_BUMP_TARGET_ATI = 0x877C;
}

View File

@ -0,0 +1,152 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:34:05
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*
* Note: 2X_BIT_ATI, 4X_BIT_ATI and 8X_BIT_ATI has been changed to X2_BIT_ATI, X4_BIT_ATI and X8_BIT_ATI
* because variables cannot start with a number.
*
*/
package org.lwjgl.opengl.ati;
public interface ATIFragmentShader
{
public static final int GL_FRAGMENT_SHADER_ATI = 0x8920;
public static final int GL_REG_0_ATI = 0x8921;
public static final int GL_REG_1_ATI = 0x8922;
public static final int GL_REG_2_ATI = 0x8923;
public static final int GL_REG_3_ATI = 0x8924;
public static final int GL_REG_4_ATI = 0x8925;
public static final int GL_REG_5_ATI = 0x8926;
public static final int GL_REG_6_ATI = 0x8927;
public static final int GL_REG_7_ATI = 0x8928;
public static final int GL_REG_8_ATI = 0x8929;
public static final int GL_REG_9_ATI = 0x892A;
public static final int GL_REG_10_ATI = 0x892B;
public static final int GL_REG_11_ATI = 0x892C;
public static final int GL_REG_12_ATI = 0x892D;
public static final int GL_REG_13_ATI = 0x892E;
public static final int GL_REG_14_ATI = 0x892F;
public static final int GL_REG_15_ATI = 0x8930;
public static final int GL_REG_16_ATI = 0x8931;
public static final int GL_REG_17_ATI = 0x8932;
public static final int GL_REG_18_ATI = 0x8933;
public static final int GL_REG_19_ATI = 0x8934;
public static final int GL_REG_20_ATI = 0x8935;
public static final int GL_REG_21_ATI = 0x8936;
public static final int GL_REG_22_ATI = 0x8937;
public static final int GL_REG_23_ATI = 0x8938;
public static final int GL_REG_24_ATI = 0x8939;
public static final int GL_REG_25_ATI = 0x893A;
public static final int GL_REG_26_ATI = 0x893B;
public static final int GL_REG_27_ATI = 0x893C;
public static final int GL_REG_28_ATI = 0x893D;
public static final int GL_REG_29_ATI = 0x893E;
public static final int GL_REG_30_ATI = 0x893F;
public static final int GL_REG_31_ATI = 0x8940;
public static final int GL_CON_0_ATI = 0x8941;
public static final int GL_CON_1_ATI = 0x8942;
public static final int GL_CON_2_ATI = 0x8943;
public static final int GL_CON_3_ATI = 0x8944;
public static final int GL_CON_4_ATI = 0x8945;
public static final int GL_CON_5_ATI = 0x8946;
public static final int GL_CON_6_ATI = 0x8947;
public static final int GL_CON_7_ATI = 0x8948;
public static final int GL_CON_8_ATI = 0x8949;
public static final int GL_CON_9_ATI = 0x894A;
public static final int GL_CON_10_ATI = 0x894B;
public static final int GL_CON_11_ATI = 0x894C;
public static final int GL_CON_12_ATI = 0x894D;
public static final int GL_CON_13_ATI = 0x894E;
public static final int GL_CON_14_ATI = 0x894F;
public static final int GL_CON_15_ATI = 0x8950;
public static final int GL_CON_16_ATI = 0x8951;
public static final int GL_CON_17_ATI = 0x8952;
public static final int GL_CON_18_ATI = 0x8953;
public static final int GL_CON_19_ATI = 0x8954;
public static final int GL_CON_20_ATI = 0x8955;
public static final int GL_CON_21_ATI = 0x8956;
public static final int GL_CON_22_ATI = 0x8957;
public static final int GL_CON_23_ATI = 0x8958;
public static final int GL_CON_24_ATI = 0x8959;
public static final int GL_CON_25_ATI = 0x895A;
public static final int GL_CON_26_ATI = 0x895B;
public static final int GL_CON_27_ATI = 0x895C;
public static final int GL_CON_28_ATI = 0x895D;
public static final int GL_CON_29_ATI = 0x895E;
public static final int GL_CON_30_ATI = 0x895F;
public static final int GL_CON_31_ATI = 0x8960;
public static final int GL_MOV_ATI = 0x8961;
public static final int GL_ADD_ATI = 0x8963;
public static final int GL_MUL_ATI = 0x8964;
public static final int GL_SUB_ATI = 0x8965;
public static final int GL_DOT3_ATI = 0x8966;
public static final int GL_DOT4_ATI = 0x8967;
public static final int GL_MAD_ATI = 0x8968;
public static final int GL_LERP_ATI = 0x8969;
public static final int GL_CND_ATI = 0x896A;
public static final int GL_CND0_ATI = 0x896B;
public static final int GL_DOT2_ADD_ATI = 0x896C;
public static final int GL_SECONDARY_INTERPOLATOR_ATI = 0x896D;
public static final int GL_NUM_FRAGMENT_REGISTERS_ATI = 0x896E;
public static final int GL_NUM_FRAGMENT_CONSTANTS_ATI = 0x896F;
public static final int GL_NUM_PASSES_ATI = 0x8970;
public static final int GL_NUM_INSTRUCTIONS_PER_PASS_ATI = 0x8971;
public static final int GL_NUM_INSTRUCTIONS_TOTAL_ATI = 0x8972;
public static final int GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI = 0x8973;
public static final int GL_NUM_LOOPBACK_COMPONENTS_ATI = 0x8974;
public static final int GL_COLOR_ALPHA_PAIRING_ATI = 0x8975;
public static final int GL_SWIZZLE_STR_ATI = 0x8976;
public static final int GL_SWIZZLE_STQ_ATI = 0x8977;
public static final int GL_SWIZZLE_STR_DR_ATI = 0x8978;
public static final int GL_SWIZZLE_STQ_DQ_ATI = 0x8979;
public static final int GL_SWIZZLE_STRQ_ATI = 0x897A;
public static final int GL_SWIZZLE_STRQ_DQ_ATI = 0x897B;
public static final int GL_RED_BIT_ATI = 0x00000001;
public static final int GL_GREEN_BIT_ATI = 0x00000002;
public static final int GL_BLUE_BIT_ATI = 0x00000004;
public static final int GL_X2_BIT_ATI = 0x00000001;
public static final int GL_X4_BIT_ATI = 0x00000002;
public static final int GL_X8_BIT_ATI = 0x00000004;
public static final int GL_HALF_BIT_ATI = 0x00000008;
public static final int GL_QUARTER_BIT_ATI = 0x00000010;
public static final int GL_EIGHTH_BIT_ATI = 0x00000020;
public static final int GL_SATURATE_BIT_ATI = 0x00000040;
public static final int GL_COMP_BIT_ATI = 0x00000002;
public static final int GL_NEGATE_BIT_ATI = 0x00000004;
public static final int GL_BIAS_BIT_ATI = 0x00000008;
}

View File

@ -0,0 +1,53 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:31:14
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.ati;
public interface ATIPnTriangles
{
public static final int GL_PN_TRIANGLES_ATI = 0x87F0;
public static final int GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI = 0x87F1;
public static final int GL_PN_TRIANGLES_POINT_MODE_ATI = 0x87F2;
public static final int GL_PN_TRIANGLES_NORMAL_MODE_ATI = 0x87F3;
public static final int GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI = 0x87F4;
public static final int GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI = 0x87F5;
public static final int GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI = 0x87F6;
public static final int GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI = 0x87F7;
public static final int GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI = 0x87F8;
}

View File

@ -0,0 +1,46 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:34:34
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.ati;
public interface ATITextureMirrorOnce
{
public static final int GL_MIRROR_CLAMP_ATI = 0x8742;
public static final int GL_MIRROR_CLAMP_TO_EDGE_ATI = 0x8743;
}

View File

@ -0,0 +1,52 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:36:01
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.ati;
public interface ATIVertexArrayObject
{
public static final int GL_STATIC_ATI = 0x8760;
public static final int GL_DYNAMIC_ATI = 0x8761;
public static final int GL_PRESERVE_ATI = 0x8762;
public static final int GL_DISCARD_ATI = 0x8763;
public static final int GL_OBJECT_BUFFER_SIZE_ATI = 0x8764;
public static final int GL_OBJECT_BUFFER_USAGE_ATI = 0x8765;
public static final int GL_ARRAY_OBJECT_BUFFER_ATI = 0x8766;
public static final int GL_ARRAY_OBJECT_OFFSET_ATI = 0x8767;
}

View File

@ -0,0 +1,54 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:35:16
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.ati;
public interface ATIVertexStreams
{
public static final int GL_MAX_VERTEX_STREAMS_ATI = 0x876B;
public static final int GL_VERTEX_SOURCE_ATI = 0x876C;
public static final int GL_VERTEX_STREAM0_ATI = 0x876D;
public static final int GL_VERTEX_STREAM1_ATI = 0x876E;
public static final int GL_VERTEX_STREAM2_ATI = 0x876F;
public static final int GL_VERTEX_STREAM3_ATI = 0x8770;
public static final int GL_VERTEX_STREAM4_ATI = 0x8771;
public static final int GL_VERTEX_STREAM5_ATI = 0x8772;
public static final int GL_VERTEX_STREAM6_ATI = 0x8773;
public static final int GL_VERTEX_STREAM7_ATI = 0x8774;
}

View File

@ -0,0 +1,50 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:36:54
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.atix;
public interface ATIXPointSprites
{
public static final int GL_TEXTURE_POINT_MODE_ATIX = 0x60b0;
public static final int GL_TEXTURE_POINT_ONE_COORD_ATIX = 0x60b1;
public static final int GL_TEXTURE_POINT_SPRITE_ATIX = 0x60b2;
public static final int GL_POINT_SPRITE_CULL_MODE_ATIX = 0x60b3;
public static final int GL_POINT_SPRITE_CULL_CENTER_ATIX = 0x60b4;
public static final int GL_POINT_SPRITE_CULL_CLIP_ATIX = 0x60b5;
}

View File

@ -0,0 +1,47 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:37:26
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.atix;
public interface ATIXTextureEnvRoute
{
public static final int GL_SECONDARY_COLOR_ATIX = 0x8747;
public static final int GL_TEXTURE_OUTPUT_RGB_ATIX = 0x8748;
public static final int GL_TEXTURE_OUTPUT_ALPHA_ATIX = 0x8749;
}

View File

@ -0,0 +1,46 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:29:12
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.ext;
public interface EXTAbgr
{
public static final int GL_ABGR_EXT = 0x8000;
}

View File

@ -0,0 +1,43 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.opengl.ext;
/**
* EXT_bgra_constants
*
* @author cas
*/
public interface EXTBgra {
public static final int GL_BGR_EXT = 0x80E0;
public static final int GL_BGRA_EXT = 0x80E1;
}

View File

@ -0,0 +1,45 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.opengl.ext;
/**
* Insert the type's description here.
* Creation date: (29/06/2000 00:45:10)
*/
public interface EXTBlendColor {
public static final int GL_CONSTANT_COLOR_EXT = 0x8001;
public static final int GL_ONE_MINUS_CONSTANT_COLOR_EXT = 0x8002;
public static final int GL_CONSTANT_ALPHA_EXT = 0x8003;
public static final int GL_ONE_MINUS_CONSTANT_ALPHA_EXT = 0x8004;
public static final int GL_BLEND_COLOR_EXT = 0x8005;
}

View File

@ -0,0 +1,44 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.opengl.ext;
/**
* EXT_blend_minmax constants
* @author cas
*/
public interface EXTBlendMinmax {
public static final int GL_FUNC_ADD_EXT = 0x8006;
public static final int GL_MIN_EXT = 0x8007;
public static final int GL_MAX_EXT = 0x8008;
public static final int GL_BLEND_EQUATION_EXT = 0x8009;
}

View File

@ -0,0 +1,42 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.opengl.ext;
/**
* EXT_blend_subtract constants
* @author cas
*/
public interface EXTBlendSubtract {
public static final int GL_FUNC_SUBTRACT_EXT = 0x800A;
public static final int GL_FUNC_REVERSE_SUBTRACT_EXT = 0x800B;
}

View File

@ -0,0 +1,46 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:14:06
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.ext;
public interface EXTCompiledVertexArray
{
public static final int GL_ARRAY_ELEMENT_LOCK_FIRST_EXT = 0x81A8;
public static final int GL_ARRAY_ELEMENT_LOCK_COUNT_EXT = 0x81A9;
}

View File

@ -0,0 +1,46 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 16:00:36
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.ext;
public interface EXTDrawRangeElements
{
public static final int GL_MAX_ELEMENTS_VERTICES_EXT = 0x80E8;
public static final int GL_MAX_ELEMENTS_INDICES_EXT = 0x80E9;
}

View File

@ -0,0 +1,53 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:17:44
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.ext;
public interface EXTFogCoord
{
public static final int GL_FOG_COORDINATE_SOURCE_EXT = 0x8450;
public static final int GL_FOG_COORDINATE_EXT = 0x8451;
public static final int GL_FRAGMENT_DEPTH_EXT = 0x8452;
public static final int GL_CURRENT_FOG_COORDINATE_EXT = 0x8453;
public static final int GL_FOG_COORDINATE_ARRAY_TYPE_EXT = 0x8454;
public static final int GL_FOG_COORDINATE_ARRAY_STRIDE_EXT = 0x8455;
public static final int GL_FOG_COORDINATE_ARRAY_POINTER_EXT = 0x8456;
public static final int GL_FOG_COORDINATE_ARRAY_EXT = 0x8457;
}

View File

@ -0,0 +1,42 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.opengl.ext;
/**
* EXT_light_max_exponent constants
* @author cas
*/
public interface EXTLightMaxExponent {
public static final int GL_MAX_SHININESS_EXT = 0x8504;
public static final int GL_MAX_SPOT_EXPONENT_EXT = 0x8505;
}

View File

@ -0,0 +1,45 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.opengl.ext;
/**
* Insert the type's description here.
* Creation date: (07/11/99 19:16:17)
*/
public interface EXTPackedPixels {
public static final int GL_UNSIGNED_BYTE_3_3_2_EXT = 0x8032;
public static final int GL_UNSIGNED_SHORT_4_4_4_4_EXT = 0x8033;
public static final int GL_UNSIGNED_SHORT_5_5_5_1_EXT = 0x8034;
public static final int GL_UNSIGNED_INT_8_8_8_8_EXT = 0x8035;
public static final int GL_UNSIGNED_INT_10_10_10_2_EXT = 0x8036;
}

View File

@ -0,0 +1,56 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.opengl.ext;
/**
* EXT_bgra_constants
*
* @author cas
*/
public interface EXTPalettedTexture {
public static final int GL_COLOR_TABLE_FORMAT_EXT = 0x80D8;
public static final int GL_COLOR_TABLE_WIDTH_EXT = 0x80D9;
public static final int GL_COLOR_TABLE_RED_SIZE_EXT = 0x80DA;
public static final int GL_COLOR_TABLE_GREEN_SIZE_EXT = 0x80DB;
public static final int GL_COLOR_TABLE_BLUE_SIZE_EXT = 0x80DC;
public static final int GL_COLOR_TABLE_ALPHA_SIZE_EXT = 0x80DD;
public static final int GL_COLOR_TABLE_LUMINANCE_SIZE_EXT = 0x80DE;
public static final int GL_COLOR_TABLE_INTENSITY_SIZE_EXT = 0x80DF;
public static final int GL_COLOR_INDEX1_EXT = 0x80E2;
public static final int GL_COLOR_INDEX2_EXT = 0x80E3;
public static final int GL_COLOR_INDEX4_EXT = 0x80E4;
public static final int GL_COLOR_INDEX8_EXT = 0x80E5;
public static final int GL_COLOR_INDEX12_EXT = 0x80E6;
public static final int GL_COLOR_INDEX16_EXT = 0x80E7;
}

View File

@ -0,0 +1,48 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:20:06
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.ext;
public interface EXTPointParameters
{
public static final int GL_POINT_SIZE_MIN_EXT = 0x8126;
public static final int GL_POINT_SIZE_MAX_EXT = 0x8127;
public static final int GL_POINT_FADE_THRESHOLD_SIZE_EXT = 0x8128;
public static final int GL_DISTANCE_ATTENUATION_EXT = 0x8129;
}

View File

@ -0,0 +1,42 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.opengl.ext;
/**
* EXT_rescale_normal
* @author cas
*/
public interface EXTRescaleNormal {
public static final int GL_RESCALE_NORMAL_EXT = 0x803A;
}

View File

@ -0,0 +1,51 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:17:13
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.ext;
public interface EXTSecondaryColor
{
public static final int GL_COLOR_SUM_EXT = 0x8458;
public static final int GL_CURRENT_SECONDARY_COLOR_EXT = 0x8459;
public static final int GL_SECONDARY_COLOR_ARRAY_SIZE_EXT = 0x845A;
public static final int GL_SECONDARY_COLOR_ARRAY_TYPE_EXT = 0x845B;
public static final int GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT = 0x845C;
public static final int GL_SECONDARY_COLOR_ARRAY_POINTER_EXT = 0x845D;
public static final int GL_SECONDARY_COLOR_ARRAY_EXT = 0x845E;
}

View File

@ -0,0 +1,44 @@
/*
* Copyright (c) 2002 Light Weight Java Game Library 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 'Light Weight Java Game Library' 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.opengl.ext;
/**
* EXT_separate_specular_color constants.
* @author cas
*/
public interface EXTSeparateSpecularColor {
public static final int GL_SINGLE_COLOR_EXT = 0x81F9;
public static final int GL_SEPARATE_SPECULAR_COLOR_EXT = 0x81FA;
public static final int GL_LIGHT_MODEL_COLOR_CONTROL_EXT = 0x81F8;
}

View File

@ -0,0 +1,41 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.opengl.ext;
/**
* Insert the type's description here.
* Creation date: (07/11/99 19:15:54)
*/
public interface EXTSharedTexturePalette {
public static final int GL_SHARED_TEXTURE_PALETTE_EXT = 0x81FB;
}

View File

@ -0,0 +1,46 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 16:01:46
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.ext;
public interface EXTStencilTwoSide
{
public static final int GL_STENCIL_TEST_TWO_SIDE_EXT = 0x8910;
public static final int GL_ACTIVE_STENCIL_FACE_EXT = 0x8911;
}

View File

@ -0,0 +1,46 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:29:34
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.ext;
public interface EXTStencilWrap
{
public static final int GL_INCR_WRAP_EXT = 0x8507;
public static final int GL_DECR_WRAP_EXT = 0x8508;
}

View File

@ -0,0 +1,48 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 16:01:13
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.ext;
public interface EXTTextureCompressionS3TC
{
public static final int GL_COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0;
public static final int GL_COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1;
public static final int GL_COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83F2;
public static final int GL_COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3;
}

View File

@ -0,0 +1,61 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.opengl.ext;
/**
* Insert the type's description here.
* Creation date: (22/02/00 01:26:05)
*/
public interface EXTTextureEnvCombine {
public static final int GL_COMBINE_EXT = 0x8570;
public static final int GL_COMBINE_RGB_EXT = 0x8571;
public static final int GL_COMBINE_ALPHA_EXT = 0x8572;
public static final int GL_SOURCE0_RGB_EXT = 0x8580;
public static final int GL_SOURCE1_RGB_EXT = 0x8581;
public static final int GL_SOURCE2_RGB_EXT = 0x8582;
public static final int GL_SOURCE0_ALPHA_EXT = 0x8588;
public static final int GL_SOURCE1_ALPHA_EXT = 0x8589;
public static final int GL_SOURCE2_ALPHA_EXT = 0x858A;
public static final int GL_OPERAND0_RGB_EXT = 0x8590;
public static final int GL_OPERAND1_RGB_EXT = 0x8591;
public static final int GL_OPERAND2_RGB_EXT = 0x8592;
public static final int GL_OPERAND0_ALPHA_EXT = 0x8598;
public static final int GL_OPERAND1_ALPHA_EXT = 0x8599;
public static final int GL_OPERAND2_ALPHA_EXT = 0x859A;
public static final int GL_RGB_SCALE_EXT = 0x8573;
public static final int GL_ADD_SIGNED_EXT = 0x8574;
public static final int GL_INTERPOLATE_EXT = 0x8575;
public static final int GL_CONSTANT_EXT = 0x8576;
public static final int GL_PRIMARY_COLOR_EXT = 0x8577;
public static final int GL_PREVIOUS_EXT = 0x8578;
}

View File

@ -0,0 +1,43 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.opengl.ext;
/**
* EXT_texture_env_dot3 constants.
* @author cas
*/
public interface EXTTextureEnvDot3 {
public static final int GL_DOT3_RGB_EXT = 0x8740;
public static final int GL_DOT3_RGBA_EXT = 0x8741;
}

View File

@ -0,0 +1,46 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:24:27
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.ext;
public interface EXTTextureFilterAnisotropic
{
public static final int GL_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE;
public static final int GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF;
}

View File

@ -0,0 +1,47 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:29:59
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.ext;
public interface EXTTextureLODBias
{
public static final int GL_TEXTURE_FILTER_CONTROL_EXT = 0x8500;
public static final int GL_TEXTURE_LOD_BIAS_EXT = 0x8501;
public static final int GL_MAX_TEXTURE_LOD_BIAS_EXT = 0x84FD;
}

View File

@ -0,0 +1,71 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.opengl.ext;
/**
* Insert the type's description here.
* Creation date: (07/11/99 18:58:04)
*/
public interface EXTVertexArray {
public static final int GL_VERTEX_ARRAY_EXT = 0x8074;
public static final int GL_NORMAL_ARRAY_EXT = 0x8075;
public static final int GL_COLOR_ARRAY_EXT = 0x8076;
public static final int GL_INDEX_ARRAY_EXT = 0x8077;
public static final int GL_TEXTURE_COORD_ARRAY_EXT = 0x8078;
public static final int GL_EDGE_FLAG_ARRAY_EXT = 0x8079;
public static final int GL_VERTEX_ARRAY_SIZE_EXT = 0x807A;
public static final int GL_VERTEX_ARRAY_TYPE_EXT = 0x807B;
public static final int GL_VERTEX_ARRAY_STRIDE_EXT = 0x807C;
public static final int GL_VERTEX_ARRAY_COUNT_EXT = 0x807D;
public static final int GL_NORMAL_ARRAY_TYPE_EXT = 0x807E;
public static final int GL_NORMAL_ARRAY_STRIDE_EXT = 0x807F;
public static final int GL_NORMAL_ARRAY_COUNT_EXT = 0x8080;
public static final int GL_COLOR_ARRAY_SIZE_EXT = 0x8081;
public static final int GL_COLOR_ARRAY_TYPE_EXT = 0x8082;
public static final int GL_COLOR_ARRAY_STRIDE_EXT = 0x8083;
public static final int GL_COLOR_ARRAY_COUNT_EXT = 0x8084;
public static final int GL_INDEX_ARRAY_TYPE_EXT = 0x8085;
public static final int GL_INDEX_ARRAY_STRIDE_EXT = 0x8086;
public static final int GL_INDEX_ARRAY_COUNT_EXT = 0x8087;
public static final int GL_TEXTURE_COORD_ARRAY_SIZE_EXT = 0x8088;
public static final int GL_TEXTURE_COORD_ARRAY_TYPE_EXT = 0x8089;
public static final int GL_TEXTURE_COORD_ARRAY_STRIDE_EXT = 0x808A;
public static final int GL_TEXTURE_COORD_ARRAY_COUNT_EXT = 0x808B;
public static final int GL_EDGE_FLAG_ARRAY_STRIDE_EXT = 0x808C;
public static final int GL_EDGE_FLAG_ARRAY_COUNT_EXT = 0x808D;
public static final int GL_VERTEX_ARRAY_POINTER_EXT = 0x808E;
public static final int GL_NORMAL_ARRAY_POINTER_EXT = 0x808F;
public static final int GL_COLOR_ARRAY_POINTER_EXT = 0x8090;
public static final int GL_INDEX_ARRAY_POINTER_EXT = 0x8091;
public static final int GL_TEXTURE_COORD_ARRAY_POINTER_EXT = 0x8092;
public static final int GL_EDGE_FLAG_ARRAY_POINTER_EXT = 0x8093;
}

View File

@ -0,0 +1,154 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:33:02
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.ext;
public interface EXTVertexShader
{
public static final int GL_VERTEX_SHADER_EXT = 0x8780;
public static final int GL_VERTEX_SHADER_BINDING_EXT = 0x8781;
public static final int GL_OP_INDEX_EXT = 0x8782;
public static final int GL_OP_NEGATE_EXT = 0x8783;
public static final int GL_OP_DOT3_EXT = 0x8784;
public static final int GL_OP_DOT4_EXT = 0x8785;
public static final int GL_OP_MUL_EXT = 0x8786;
public static final int GL_OP_ADD_EXT = 0x8787;
public static final int GL_OP_MADD_EXT = 0x8788;
public static final int GL_OP_FRAC_EXT = 0x8789;
public static final int GL_OP_MAX_EXT = 0x878A;
public static final int GL_OP_MIN_EXT = 0x878B;
public static final int GL_OP_SET_GE_EXT = 0x878C;
public static final int GL_OP_SET_LT_EXT = 0x878D;
public static final int GL_OP_CLAMP_EXT = 0x878E;
public static final int GL_OP_FLOOR_EXT = 0x878F;
public static final int GL_OP_ROUND_EXT = 0x8790;
public static final int GL_OP_EXP_BASE_2_EXT = 0x8791;
public static final int GL_OP_LOG_BASE_2_EXT = 0x8792;
public static final int GL_OP_POWER_EXT = 0x8793;
public static final int GL_OP_RECIP_EXT = 0x8794;
public static final int GL_OP_RECIP_SQRT_EXT = 0x8795;
public static final int GL_OP_SUB_EXT = 0x8796;
public static final int GL_OP_CROSS_PRODUCT_EXT = 0x8797;
public static final int GL_OP_MULTIPLY_MATRIX_EXT = 0x8798;
public static final int GL_OP_MOV_EXT = 0x8799;
public static final int GL_OUTPUT_VERTEX_EXT = 0x879A;
public static final int GL_OUTPUT_COLOR0_EXT = 0x879B;
public static final int GL_OUTPUT_COLOR1_EXT = 0x879C;
public static final int GL_OUTPUT_TEXTURE_COORD0_EXT = 0x879D;
public static final int GL_OUTPUT_TEXTURE_COORD1_EXT = 0x879E;
public static final int GL_OUTPUT_TEXTURE_COORD2_EXT = 0x879F;
public static final int GL_OUTPUT_TEXTURE_COORD3_EXT = 0x87A0;
public static final int GL_OUTPUT_TEXTURE_COORD4_EXT = 0x87A1;
public static final int GL_OUTPUT_TEXTURE_COORD5_EXT = 0x87A2;
public static final int GL_OUTPUT_TEXTURE_COORD6_EXT = 0x87A3;
public static final int GL_OUTPUT_TEXTURE_COORD7_EXT = 0x87A4;
public static final int GL_OUTPUT_TEXTURE_COORD8_EXT = 0x87A5;
public static final int GL_OUTPUT_TEXTURE_COORD9_EXT = 0x87A6;
public static final int GL_OUTPUT_TEXTURE_COORD10_EXT = 0x87A7;
public static final int GL_OUTPUT_TEXTURE_COORD11_EXT = 0x87A8;
public static final int GL_OUTPUT_TEXTURE_COORD12_EXT = 0x87A9;
public static final int GL_OUTPUT_TEXTURE_COORD13_EXT = 0x87AA;
public static final int GL_OUTPUT_TEXTURE_COORD14_EXT = 0x87AB;
public static final int GL_OUTPUT_TEXTURE_COORD15_EXT = 0x87AC;
public static final int GL_OUTPUT_TEXTURE_COORD16_EXT = 0x87AD;
public static final int GL_OUTPUT_TEXTURE_COORD17_EXT = 0x87AE;
public static final int GL_OUTPUT_TEXTURE_COORD18_EXT = 0x87AF;
public static final int GL_OUTPUT_TEXTURE_COORD19_EXT = 0x87B0;
public static final int GL_OUTPUT_TEXTURE_COORD20_EXT = 0x87B1;
public static final int GL_OUTPUT_TEXTURE_COORD21_EXT = 0x87B2;
public static final int GL_OUTPUT_TEXTURE_COORD22_EXT = 0x87B3;
public static final int GL_OUTPUT_TEXTURE_COORD23_EXT = 0x87B4;
public static final int GL_OUTPUT_TEXTURE_COORD24_EXT = 0x87B5;
public static final int GL_OUTPUT_TEXTURE_COORD25_EXT = 0x87B6;
public static final int GL_OUTPUT_TEXTURE_COORD26_EXT = 0x87B7;
public static final int GL_OUTPUT_TEXTURE_COORD27_EXT = 0x87B8;
public static final int GL_OUTPUT_TEXTURE_COORD28_EXT = 0x87B9;
public static final int GL_OUTPUT_TEXTURE_COORD29_EXT = 0x87BA;
public static final int GL_OUTPUT_TEXTURE_COORD30_EXT = 0x87BB;
public static final int GL_OUTPUT_TEXTURE_COORD31_EXT = 0x87BC;
public static final int GL_OUTPUT_FOG_EXT = 0x87BD;
public static final int GL_SCALAR_EXT = 0x87BE;
public static final int GL_VECTOR_EXT = 0x87BF;
public static final int GL_MATRIX_EXT = 0x87C0;
public static final int GL_VARIANT_EXT = 0x87C1;
public static final int GL_INVARIANT_EXT = 0x87C2;
public static final int GL_LOCAL_CONSTANT_EXT = 0x87C3;
public static final int GL_LOCAL_EXT = 0x87C4;
public static final int GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT = 0x87C5;
public static final int GL_MAX_VERTEX_SHADER_VARIANTS_EXT = 0x87C6;
public static final int GL_MAX_VERTEX_SHADER_INVARIANTS_EXT = 0x87C7;
public static final int GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT = 0x87C8;
public static final int GL_MAX_VERTEX_SHADER_LOCALS_EXT = 0x87C9;
public static final int GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT = 0x87CA;
public static final int GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT = 0x87CB;
public static final int GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT = 0x87CC;
public static final int GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT = 0x87CD;
public static final int GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT = 0x87CE;
public static final int GL_VERTEX_SHADER_INSTRUCTIONS_EXT = 0x87CF;
public static final int GL_VERTEX_SHADER_VARIANTS_EXT = 0x87D0;
public static final int GL_VERTEX_SHADER_INVARIANTS_EXT = 0x87D1;
public static final int GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT = 0x87D2;
public static final int GL_VERTEX_SHADER_LOCALS_EXT = 0x87D3;
public static final int GL_VERTEX_SHADER_OPTIMIZED_EXT = 0x87D4;
public static final int GL_X_EXT = 0x87D5;
public static final int GL_Y_EXT = 0x87D6;
public static final int GL_Z_EXT = 0x87D7;
public static final int GL_W_EXT = 0x87D8;
public static final int GL_NEGATIVE_X_EXT = 0x87D9;
public static final int GL_NEGATIVE_Y_EXT = 0x87DA;
public static final int GL_NEGATIVE_Z_EXT = 0x87DB;
public static final int GL_NEGATIVE_W_EXT = 0x87DC;
public static final int GL_ZERO_EXT = 0x87DD;
public static final int GL_ONE_EXT = 0x87DE;
public static final int GL_NEGATIVE_ONE_EXT = 0x87DF;
public static final int GL_NORMALIZED_RANGE_EXT = 0x87E0;
public static final int GL_FULL_RANGE_EXT = 0x87E1;
public static final int GL_CURRENT_VERTEX_EXT = 0x87E2;
public static final int GL_MVP_MATRIX_EXT = 0x87E3;
public static final int GL_VARIANT_VALUE_EXT = 0x87E4;
public static final int GL_VARIANT_DATATYPE_EXT = 0x87E5;
public static final int GL_VARIANT_ARRAY_STRIDE_EXT = 0x87E6;
public static final int GL_VARIANT_ARRAY_TYPE_EXT = 0x87E7;
public static final int GL_VARIANT_ARRAY_EXT = 0x87E8;
public static final int GL_VARIANT_ARRAY_POINTER_EXT = 0x87E9;
public static final int GL_INVARIANT_VALUE_EXT = 0x87EA;
public static final int GL_INVARIANT_DATATYPE_EXT = 0x87EB;
public static final int GL_LOCAL_CONSTANT_VALUE_EXT = 0x87EC;
public static final int GL_LOCAL_CONSTANT_DATATYPE_EXT = 0x87ED;
}

View File

@ -0,0 +1,57 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:25:57
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.ext;
public interface EXTVertexWeighting
{
public static final int GL_MODELVIEW0_STACK_DEPTH_EXT = 0x0BA3; /* alias to MODELVIEW_STACK_DEPTH */
public static final int GL_MODELVIEW1_STACK_DEPTH_EXT = 0x8502;
public static final int GL_MODELVIEW0_MATRIX_EXT = 0x0BA6; /* alias to MODELVIEW_MATRIX */
public static final int GL_MODELVIEW1_MATRIX_EXT = 0x8506;
public static final int GL_VERTEX_WEIGHTING_EXT = 0x8509;
public static final int GL_MODELVIEW0_EXT = 0x1700; /* alias to MODELVIEW */
public static final int GL_MODELVIEW1_EXT = 0x850A;
public static final int GL_CURRENT_VERTEX_WEIGHT_EXT = 0x850B;
public static final int GL_VERTEX_WEIGHT_ARRAY_EXT = 0x850C;
public static final int GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT = 0x850D;
public static final int GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT = 0x850E;
public static final int GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT = 0x850F;
public static final int GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT = 0x8510;
}

View File

@ -0,0 +1,46 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:30:49
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.nv;
public interface NVCopyDepthToColor
{
public static final int GL_DEPTH_STENCIL_TO_RGBA_NV = 0x886E;
public static final int GL_DEPTH_STENCIL_TO_BGRA_NV = 0x886F;
}

View File

@ -0,0 +1,45 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:37:44
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.nv;
public interface NVDepthClamp
{
public static final int GL_DEPTH_CLAMP_NV = 0x864F;
}

View File

@ -0,0 +1,68 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:30:22
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.nv;
public interface NVEvaluators
{
public static final int GL_EVAL_2D_NV = 0x86C0;
public static final int GL_EVAL_TRIANGULAR_2D_NV = 0x86C1;
public static final int GL_MAP_TESSELLATION_NV = 0x86C2;
public static final int GL_MAP_ATTRIB_U_ORDER_NV = 0x86C3;
public static final int GL_MAP_ATTRIB_V_ORDER_NV = 0x86C4;
public static final int GL_EVAL_FRACTIONAL_TESSELLATION_NV = 0x86C5;
public static final int GL_EVAL_VERTEX_ATTRIB0_NV = 0x86C6;
public static final int GL_EVAL_VERTEX_ATTRIB1_NV = 0x86C7;
public static final int GL_EVAL_VERTEX_ATTRIB2_NV = 0x86C8;
public static final int GL_EVAL_VERTEX_ATTRIB3_NV = 0x86C9;
public static final int GL_EVAL_VERTEX_ATTRIB4_NV = 0x86CA;
public static final int GL_EVAL_VERTEX_ATTRIB5_NV = 0x86CB;
public static final int GL_EVAL_VERTEX_ATTRIB6_NV = 0x86CC;
public static final int GL_EVAL_VERTEX_ATTRIB7_NV = 0x86CD;
public static final int GL_EVAL_VERTEX_ATTRIB8_NV = 0x86CE;
public static final int GL_EVAL_VERTEX_ATTRIB9_NV = 0x86CF;
public static final int GL_EVAL_VERTEX_ATTRIB10_NV = 0x86D0;
public static final int GL_EVAL_VERTEX_ATTRIB11_NV = 0x86D1;
public static final int GL_EVAL_VERTEX_ATTRIB12_NV = 0x86D2;
public static final int GL_EVAL_VERTEX_ATTRIB13_NV = 0x86D3;
public static final int GL_EVAL_VERTEX_ATTRIB14_NV = 0x86D4;
public static final int GL_EVAL_VERTEX_ATTRIB15_NV = 0x86D5;
public static final int GL_MAX_MAP_TESSELLATION_NV = 0x86D6;
public static final int GL_MAX_RATIONAL_EVAL_ORDER_NV = 0x86D7;
}

View File

@ -0,0 +1,47 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:26:52
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.nv;
public interface NVFence
{
public static final int GL_ALL_COMPLETED_NV = 0x84F2;
public static final int GL_FENCE_STATUS_NV = 0x84F3;
public static final int GL_FENCE_CONDITION_NV = 0x84F4;
}

View File

@ -0,0 +1,47 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:23:35
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.nv;
public interface NVFogDistance
{
public static final int GL_FOG_DISTANCE_MODE_NV = 0x855A;
public static final int GL_EYE_RADIAL_NV = 0x855B;
public static final int GL_EYE_PLANE_ABSOLUTE_NV = 0x855C;
}

View File

@ -0,0 +1,46 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:27:54
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.nv;
public interface NVLightMaxExponent
{
public static final int GL_MAX_SHININESS_NV = 0x8504;
public static final int GL_MAX_SPOT_EXPONENT_NV = 0x8505;
}

View File

@ -0,0 +1,51 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:38:29
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.nv;
public interface NVOcclusionQuery
{
public static final int GL_OCCLUSION_TEST_HP = 0x8165;
public static final int GL_OCCLUSION_TEST_RESULT_HP = 0x8166;
/* HP_occlusion_test */
public static final int GL_PIXEL_COUNTER_BITS_NV = 0x8864;
public static final int GL_CURRENT_OCCLUSION_QUERY_ID_NV = 0x8865;
public static final int GL_PIXEL_COUNT_NV = 0x8866;
public static final int GL_PIXEL_COUNT_AVAILABLE_NV = 0x8867;
}

View File

@ -0,0 +1,46 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:28:27
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.nv;
public interface NVPackedDepthStencil
{
public static final int GL_DEPTH_STENCIL_NV = 0x84F9;
public static final int GL_UNSIGNED_INT_24_8_NV = 0x84FA;
}

View File

@ -0,0 +1,47 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:56:50
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.nv;
public interface NVPointSprite
{
public static final int GL_POINT_SPRITE_NV = 0x8861;
public static final int GL_COORD_REPLACE_NV = 0x8862;
public static final int GL_POINT_SPRITE_R_MODE_NV = 0x8863;
}

View File

@ -0,0 +1,95 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:20:54
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.nv;
public interface NVRegisterCombiners
{
public static final int GL_REGISTER_COMBINERS_NV = 0x8522;
public static final int GL_COMBINER0_NV = 0x8550;
public static final int GL_COMBINER1_NV = 0x8551;
public static final int GL_COMBINER2_NV = 0x8552;
public static final int GL_COMBINER3_NV = 0x8553;
public static final int GL_COMBINER4_NV = 0x8554;
public static final int GL_COMBINER5_NV = 0x8555;
public static final int GL_COMBINER6_NV = 0x8556;
public static final int GL_COMBINER7_NV = 0x8557;
public static final int GL_VARIABLE_A_NV = 0x8523;
public static final int GL_VARIABLE_B_NV = 0x8524;
public static final int GL_VARIABLE_C_NV = 0x8525;
public static final int GL_VARIABLE_D_NV = 0x8526;
public static final int GL_VARIABLE_E_NV = 0x8527;
public static final int GL_VARIABLE_F_NV = 0x8528;
public static final int GL_VARIABLE_G_NV = 0x8529;
public static final int GL_CONSTANT_COLOR0_NV = 0x852A;
public static final int GL_CONSTANT_COLOR1_NV = 0x852B;
public static final int GL_PRIMARY_COLOR_NV = 0x852C;
public static final int GL_SECONDARY_COLOR_NV = 0x852D;
public static final int GL_SPARE0_NV = 0x852E;
public static final int GL_SPARE1_NV = 0x852F;
public static final int GL_UNSIGNED_IDENTITY_NV = 0x8536;
public static final int GL_UNSIGNED_INVERT_NV = 0x8537;
public static final int GL_EXPAND_NORMAL_NV = 0x8538;
public static final int GL_EXPAND_NEGATE_NV = 0x8539;
public static final int GL_HALF_BIAS_NORMAL_NV = 0x853A;
public static final int GL_HALF_BIAS_NEGATE_NV = 0x853B;
public static final int GL_SIGNED_IDENTITY_NV = 0x853C;
public static final int GL_SIGNED_NEGATE_NV = 0x853D;
public static final int GL_E_TIMES_F_NV = 0x8531;
public static final int GL_SPARE0_PLUS_SECONDARY_COLOR_NV = 0x8532;
public static final int GL_SCALE_BY_TWO_NV = 0x853E;
public static final int GL_SCALE_BY_FOUR_NV = 0x853F;
public static final int GL_SCALE_BY_ONE_HALF_NV = 0x8540;
public static final int GL_BIAS_BY_NEGATIVE_ONE_HALF_NV = 0x8541;
public static final int GL_DISCARD_NV = 0x8530;
public static final int GL_COMBINER_INPUT_NV = 0x8542;
public static final int GL_COMBINER_MAPPING_NV = 0x8543;
public static final int GL_COMBINER_COMPONENT_USAGE_NV = 0x8544;
public static final int GL_COMBINER_AB_DOT_PRODUCT_NV = 0x8545;
public static final int GL_COMBINER_CD_DOT_PRODUCT_NV = 0x8546;
public static final int GL_COMBINER_MUX_SUM_NV = 0x8547;
public static final int GL_COMBINER_SCALE_NV = 0x8548;
public static final int GL_COMBINER_BIAS_NV = 0x8549;
public static final int GL_COMBINER_AB_OUTPUT_NV = 0x854A;
public static final int GL_COMBINER_CD_OUTPUT_NV = 0x854B;
public static final int GL_COMBINER_SUM_OUTPUT_NV = 0x854C;
public static final int GL_NUM_GENERAL_COMBINERS_NV = 0x854E;
public static final int GL_COLOR_SUM_CLAMP_NV = 0x854F;
public static final int GL_MAX_GENERAL_COMBINERS_NV = 0x854D;
}

View File

@ -0,0 +1,45 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:28:46
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.nv;
public interface NVRegisterCombiners2
{
public static final int GL_PER_STAGE_CONSTANTS_NV = 0x8535;
}

View File

@ -0,0 +1,46 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:25:20
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.nv;
public interface NVTexgenReflection
{
public static final int GL_NORMAL_MAP_NV = 0x8511;
public static final int GL_REFLECTION_MAP_NV = 0x8512;
}

View File

@ -0,0 +1,49 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:23:05
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.nv;
public interface NVTextureEnvCombine4
{
public static final int GL_COMBINE4_NV = 0x8503;
public static final int GL_SOURCE3_RGB_NV = 0x8583;
public static final int GL_SOURCE3_ALPHA_NV = 0x858B;
public static final int GL_OPERAND3_RGB_NV = 0x8593;
public static final int GL_OPERAND3_ALPHA_NV = 0x859B;
}

View File

@ -0,0 +1,48 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:22:23
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.nv;
public interface NVTextureRectangle
{
public static final int GL_TEXTURE_RECTANGLE_NV = 0x84F5;
public static final int GL_TEXTURE_BINDING_RECTANGLE_NV = 0x84F6;
public static final int GL_PROXY_TEXTURE_RECTANGLE_NV = 0x84F7;
public static final int GL_MAX_RECTANGLE_TEXTURE_SIZE_NV = 0x84F8;
}

View File

@ -0,0 +1,114 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:21:57
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.nv;
public interface NVTextureShader
{
public static final int GL_TEXTURE_SHADER_NV = 0x86DE;
public static final int GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV = 0x86D9;
public static final int GL_SHADER_OPERATION_NV = 0x86DF;
public static final int GL_CULL_MODES_NV = 0x86E0;
public static final int GL_OFFSET_TEXTURE_MATRIX_NV = 0x86E1;
public static final int GL_OFFSET_TEXTURE_SCALE_NV = 0x86E2;
public static final int GL_OFFSET_TEXTURE_BIAS_NV = 0x86E3;
public static final int GL_PREVIOUS_TEXTURE_INPUT_NV = 0x86E4;
public static final int GL_CONST_EYE_NV = 0x86E5;
public static final int GL_SHADER_CONSISTENT_NV = 0x86DD;
public static final int GL_PASS_THROUGH_NV = 0x86E6;
public static final int GL_CULL_FRAGMENT_NV = 0x86E7;
public static final int GL_OFFSET_TEXTURE_2D_NV = 0x86E8;
public static final int GL_OFFSET_TEXTURE_RECTANGLE_NV = 0x864C;
public static final int GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV = 0x864D;
public static final int GL_DEPENDENT_AR_TEXTURE_2D_NV = 0x86E9;
public static final int GL_DEPENDENT_GB_TEXTURE_2D_NV = 0x86EA;
public static final int GL_DOT_PRODUCT_NV = 0x86EC;
public static final int GL_DOT_PRODUCT_DEPTH_REPLACE_NV = 0x86ED;
public static final int GL_DOT_PRODUCT_TEXTURE_2D_NV = 0x86EE;
public static final int GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV = 0x864E;
public static final int GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV = 0x86F0;
public static final int GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV = 0x86F1;
public static final int GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV = 0x86F2;
public static final int GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV = 0x86F3;
public static final int GL_HILO_NV = 0x86F4;
public static final int GL_DSDT_NV = 0x86F5;
public static final int GL_DSDT_MAG_NV = 0x86F6;
public static final int GL_DSDT_MAG_VIB_NV = 0x86F7;
public static final int GL_UNSIGNED_INT_S8_S8_8_8_NV = 0x86DA;
public static final int GL_UNSIGNED_INT_8_8_S8_S8_REV_NV = 0x86DB;
public static final int GL_SIGNED_RGBA_NV = 0x86FB;
public static final int GL_SIGNED_RGBA8_NV = 0x86FC;
public static final int GL_SIGNED_RGB_NV = 0x86FE;
public static final int GL_SIGNED_RGB8_NV = 0x86FF;
public static final int GL_SIGNED_LUMINANCE_NV = 0x8701;
public static final int GL_SIGNED_LUMINANCE8_NV = 0x8702;
public static final int GL_SIGNED_LUMINANCE_ALPHA_NV = 0x8703;
public static final int GL_SIGNED_LUMINANCE8_ALPHA8_NV = 0x8704;
public static final int GL_SIGNED_ALPHA_NV = 0x8705;
public static final int GL_SIGNED_ALPHA8_NV = 0x8706;
public static final int GL_SIGNED_INTENSITY_NV = 0x8707;
public static final int GL_SIGNED_INTENSITY8_NV = 0x8708;
public static final int GL_SIGNED_RGB_UNSIGNED_ALPHA_NV = 0x870C;
public static final int GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV = 0x870D;
public static final int GL_HILO16_NV = 0x86F8;
public static final int GL_SIGNED_HILO_NV = 0x86F9;
public static final int GL_SIGNED_HILO16_NV = 0x86FA;
public static final int GL_DSDT8_NV = 0x8709;
public static final int GL_DSDT8_MAG8_NV = 0x870A;
public static final int GL_DSDT_MAG_INTENSITY_NV = 0x86DC;
public static final int GL_DSDT8_MAG8_INTENSITY8_NV = 0x870B;
public static final int GL_HI_SCALE_NV = 0x870E;
public static final int GL_LO_SCALE_NV = 0x870F;
public static final int GL_DS_SCALE_NV = 0x8710;
public static final int GL_DT_SCALE_NV = 0x8711;
public static final int GL_MAGNITUDE_SCALE_NV = 0x8712;
public static final int GL_VIBRANCE_SCALE_NV = 0x8713;
public static final int GL_HI_BIAS_NV = 0x8714;
public static final int GL_LO_BIAS_NV = 0x8715;
public static final int GL_DS_BIAS_NV = 0x8716;
public static final int GL_DT_BIAS_NV = 0x8717;
public static final int GL_MAGNITUDE_BIAS_NV = 0x8718;
public static final int GL_VIBRANCE_BIAS_NV = 0x8719;
public static final int GL_TEXTURE_BORDER_VALUES_NV = 0x871A;
public static final int GL_TEXTURE_HI_SIZE_NV = 0x871B;
public static final int GL_TEXTURE_LO_SIZE_NV = 0x871C;
public static final int GL_TEXTURE_DS_SIZE_NV = 0x871D;
public static final int GL_TEXTURE_DT_SIZE_NV = 0x871E;
public static final int GL_TEXTURE_MAG_SIZE_NV = 0x871F;
}

View File

@ -0,0 +1,72 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:27:12
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.nv;
public interface NVTextureShader2
{
public static final int GL_DOT_PRODUCT_TEXTURE_3D_NV = 0x86EF;
public static final int GL_HILO_NV = 0x86F4;
public static final int GL_DSDT_NV = 0x86F5;
public static final int GL_DSDT_MAG_NV = 0x86F6;
public static final int GL_DSDT_MAG_VIB_NV = 0x86F7;
public static final int GL_UNSIGNED_INT_S8_S8_8_8_NV = 0x86DA;
public static final int GL_UNSIGNED_INT_8_8_S8_S8_REV_NV = 0x86DB;
public static final int GL_SIGNED_RGBA_NV = 0x86FB;
public static final int GL_SIGNED_RGBA8_NV = 0x86FC;
public static final int GL_SIGNED_RGB_NV = 0x86FE;
public static final int GL_SIGNED_RGB8_NV = 0x86FF;
public static final int GL_SIGNED_LUMINANCE_NV = 0x8701;
public static final int GL_SIGNED_LUMINANCE8_NV = 0x8702;
public static final int GL_SIGNED_LUMINANCE_ALPHA_NV = 0x8703;
public static final int GL_SIGNED_LUMINANCE8_ALPHA8_NV = 0x8704;
public static final int GL_SIGNED_ALPHA_NV = 0x8705;
public static final int GL_SIGNED_ALPHA8_NV = 0x8706;
public static final int GL_SIGNED_INTENSITY_NV = 0x8707;
public static final int GL_SIGNED_INTENSITY8_NV = 0x8708;
public static final int GL_SIGNED_RGB_UNSIGNED_ALPHA_NV = 0x870C;
public static final int GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV = 0x870D;
public static final int GL_HILO16_NV = 0x86F8;
public static final int GL_SIGNED_HILO_NV = 0x86F9;
public static final int GL_SIGNED_HILO16_NV = 0x86FA;
public static final int GL_DSDT8_NV = 0x8709;
public static final int GL_DSDT8_MAG8_NV = 0x870A;
public static final int GL_DSDT_MAG_INTENSITY_NV = 0x86DC;
public static final int GL_DSDT8_MAG8_INTENSITY8_NV = 0x870B;
}

View File

@ -0,0 +1,61 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:57:41
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.nv;
public interface NVTextureShader3
{
public static final int GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV = 0x8850;
public static final int GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV = 0x8851;
public static final int GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV = 0x8852;
public static final int GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV = 0x8853;
public static final int GL_OFFSET_HILO_TEXTURE_2D_NV = 0x8854;
public static final int GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV = 0x8855;
public static final int GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV = 0x8856;
public static final int GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV = 0x8857;
public static final int GL_DEPENDENT_HILO_TEXTURE_2D_NV = 0x8858;
public static final int GL_DEPENDENT_RGB_TEXTURE_3D_NV = 0x8859;
public static final int GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV = 0x885A;
public static final int GL_DOT_PRODUCT_PASS_THROUGH_NV = 0x885B;
public static final int GL_DOT_PRODUCT_TEXTURE_1D_NV = 0x885C;
public static final int GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV = 0x885D;
public static final int GL_HILO8_NV = 0x885E;
public static final int GL_SIGNED_HILO8_NV = 0x885F;
public static final int GL_FORCE_BLUE_TO_ONE_NV = 0x8860;
}

View File

@ -0,0 +1,49 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:18:16
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.nv;
public interface NVVertexArrayRange
{
public static final int GL_VERTEX_ARRAY_RANGE_NV = 0x851D;
public static final int GL_VERTEX_ARRAY_RANGE_LENGTH_NV = 0x851E;
public static final int GL_VERTEX_ARRAY_RANGE_VALID_NV = 0x851F;
public static final int GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV = 0x8520;
public static final int GL_VERTEX_ARRAY_RANGE_POINTER_NV = 0x8521;
}

View File

@ -0,0 +1,45 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:18:42
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.nv;
public interface NVVertexArrayRange2
{
public static final int GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV = 0x8533;
}

View File

@ -0,0 +1,127 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 15:26:24
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.nv;
public interface NVVertexProgram
{
public static final int GL_VERTEX_PROGRAM_NV = 0x8620;
public static final int GL_VERTEX_PROGRAM_POINT_SIZE_NV = 0x8642;
public static final int GL_VERTEX_PROGRAM_TWO_SIDE_NV = 0x8643;
public static final int GL_VERTEX_STATE_PROGRAM_NV = 0x8621;
public static final int GL_ATTRIB_ARRAY_SIZE_NV = 0x8623;
public static final int GL_ATTRIB_ARRAY_STRIDE_NV = 0x8624;
public static final int GL_ATTRIB_ARRAY_TYPE_NV = 0x8625;
public static final int GL_CURRENT_ATTRIB_NV = 0x8626;
public static final int GL_PROGRAM_PARAMETER_NV = 0x8644;
public static final int GL_ATTRIB_ARRAY_POINTER_NV = 0x8645;
public static final int GL_PROGRAM_TARGET_NV = 0x8646;
public static final int GL_PROGRAM_LENGTH_NV = 0x8627;
public static final int GL_PROGRAM_RESIDENT_NV = 0x8647;
public static final int GL_PROGRAM_STRING_NV = 0x8628;
public static final int GL_TRACK_MATRIX_NV = 0x8648;
public static final int GL_TRACK_MATRIX_TRANSFORM_NV = 0x8649;
public static final int GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV = 0x862E;
public static final int GL_MAX_TRACK_MATRICES_NV = 0x862F;
public static final int GL_CURRENT_MATRIX_STACK_DEPTH_NV = 0x8640;
public static final int GL_CURRENT_MATRIX_NV = 0x8641;
public static final int GL_VERTEX_PROGRAM_BINDING_NV = 0x864A;
public static final int GL_PROGRAM_ERROR_POSITION_NV = 0x864B;
public static final int GL_MODELVIEW_PROJECTION_NV = 0x8629;
public static final int GL_MATRIX0_NV = 0x8630;
public static final int GL_MATRIX1_NV = 0x8631;
public static final int GL_MATRIX2_NV = 0x8632;
public static final int GL_MATRIX3_NV = 0x8633;
public static final int GL_MATRIX4_NV = 0x8634;
public static final int GL_MATRIX5_NV = 0x8635;
public static final int GL_MATRIX6_NV = 0x8636;
public static final int GL_MATRIX7_NV = 0x8637;
public static final int GL_IDENTITY_NV = 0x862A;
public static final int GL_INVERSE_NV = 0x862B;
public static final int GL_TRANSPOSE_NV = 0x862C;
public static final int GL_INVERSE_TRANSPOSE_NV = 0x862D;
public static final int GL_VERTEX_ATTRIB_ARRAY0_NV = 0x8650;
public static final int GL_VERTEX_ATTRIB_ARRAY1_NV = 0x8651;
public static final int GL_VERTEX_ATTRIB_ARRAY2_NV = 0x8652;
public static final int GL_VERTEX_ATTRIB_ARRAY3_NV = 0x8653;
public static final int GL_VERTEX_ATTRIB_ARRAY4_NV = 0x8654;
public static final int GL_VERTEX_ATTRIB_ARRAY5_NV = 0x8655;
public static final int GL_VERTEX_ATTRIB_ARRAY6_NV = 0x8656;
public static final int GL_VERTEX_ATTRIB_ARRAY7_NV = 0x8657;
public static final int GL_VERTEX_ATTRIB_ARRAY8_NV = 0x8658;
public static final int GL_VERTEX_ATTRIB_ARRAY9_NV = 0x8659;
public static final int GL_VERTEX_ATTRIB_ARRAY10_NV = 0x865A;
public static final int GL_VERTEX_ATTRIB_ARRAY11_NV = 0x865B;
public static final int GL_VERTEX_ATTRIB_ARRAY12_NV = 0x865C;
public static final int GL_VERTEX_ATTRIB_ARRAY13_NV = 0x865D;
public static final int GL_VERTEX_ATTRIB_ARRAY14_NV = 0x865E;
public static final int GL_VERTEX_ATTRIB_ARRAY15_NV = 0x865F;
public static final int GL_MAP1_VERTEX_ATTRIB0_4_NV = 0x8660;
public static final int GL_MAP1_VERTEX_ATTRIB1_4_NV = 0x8661;
public static final int GL_MAP1_VERTEX_ATTRIB2_4_NV = 0x8662;
public static final int GL_MAP1_VERTEX_ATTRIB3_4_NV = 0x8663;
public static final int GL_MAP1_VERTEX_ATTRIB4_4_NV = 0x8664;
public static final int GL_MAP1_VERTEX_ATTRIB5_4_NV = 0x8665;
public static final int GL_MAP1_VERTEX_ATTRIB6_4_NV = 0x8666;
public static final int GL_MAP1_VERTEX_ATTRIB7_4_NV = 0x8667;
public static final int GL_MAP1_VERTEX_ATTRIB8_4_NV = 0x8668;
public static final int GL_MAP1_VERTEX_ATTRIB9_4_NV = 0x8669;
public static final int GL_MAP1_VERTEX_ATTRIB10_4_NV = 0x866A;
public static final int GL_MAP1_VERTEX_ATTRIB11_4_NV = 0x866B;
public static final int GL_MAP1_VERTEX_ATTRIB12_4_NV = 0x866C;
public static final int GL_MAP1_VERTEX_ATTRIB13_4_NV = 0x866D;
public static final int GL_MAP1_VERTEX_ATTRIB14_4_NV = 0x866E;
public static final int GL_MAP1_VERTEX_ATTRIB15_4_NV = 0x866F;
public static final int GL_MAP2_VERTEX_ATTRIB0_4_NV = 0x8670;
public static final int GL_MAP2_VERTEX_ATTRIB1_4_NV = 0x8671;
public static final int GL_MAP2_VERTEX_ATTRIB2_4_NV = 0x8672;
public static final int GL_MAP2_VERTEX_ATTRIB3_4_NV = 0x8673;
public static final int GL_MAP2_VERTEX_ATTRIB4_4_NV = 0x8674;
public static final int GL_MAP2_VERTEX_ATTRIB5_4_NV = 0x8675;
public static final int GL_MAP2_VERTEX_ATTRIB6_4_NV = 0x8676;
public static final int GL_MAP2_VERTEX_ATTRIB7_4_NV = 0x8677;
public static final int GL_MAP2_VERTEX_ATTRIB8_4_NV = 0x8678;
public static final int GL_MAP2_VERTEX_ATTRIB9_4_NV = 0x8679;
public static final int GL_MAP2_VERTEX_ATTRIB10_4_NV = 0x867A;
public static final int GL_MAP2_VERTEX_ATTRIB11_4_NV = 0x867B;
public static final int GL_MAP2_VERTEX_ATTRIB12_4_NV = 0x867C;
public static final int GL_MAP2_VERTEX_ATTRIB13_4_NV = 0x867D;
public static final int GL_MAP2_VERTEX_ATTRIB14_4_NV = 0x867E;
public static final int GL_MAP2_VERTEX_ATTRIB15_4_NV = 0x867F;
}

View File

@ -0,0 +1,48 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 16:06:10
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.wgl;
public interface WGLBufferRegion
{
public static final int WGL_WFRONT_COLOR_BUFFER_BIT_ARB = 0x00000001;
public static final int WGL_WBACK_COLOR_BUFFER_BIT_ARB = 0x00000002;
public static final int WGL_WDEPTH_BUFFER_BIT_ARB = 0x00000004;
public static final int WGL_WSTENCIL_BUFFER_BIT_ARB = 0x00000008;
}

View File

@ -0,0 +1,46 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 16:09:29
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.wgl;
public interface WGLMakeCurrentRead
{
public static final int WGL_ERROR_INVALID_PIXEL_TYPE_ARB = 0x2043;
public static final int WGL_ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB = 0x2054;
}

View File

@ -0,0 +1,46 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 16:10:06
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.wgl;
public interface WGLMultisample
{
public static final int WGL_WSAMPLE_BUFFERS_ARB = 0x2041;
public static final int WGL_WSAMPLES_ARB = 0x2042;
}

View File

@ -0,0 +1,52 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 16:06:59
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.wgl;
public interface WGLPBuffer
{
public static final int WGL_WDRAW_TO_PBUFFER_ARB = 0x202D;
public static final int WGL_WMAX_PBUFFER_PIXELS_ARB = 0x202E;
public static final int WGL_WMAX_PBUFFER_WIDTH_ARB = 0x202F;
public static final int WGL_WMAX_PBUFFER_HEIGHT_ARB = 0x2030;
public static final int WGL_WPBUFFER_LARGEST_ARB = 0x2033;
public static final int WGL_WPBUFFER_WIDTH_ARB = 0x2034;
public static final int WGL_WPBUFFER_HEIGHT_ARB = 0x2035;
public static final int WGL_WPBUFFER_LOST_ARB = 0x2036;
}

View File

@ -0,0 +1,93 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 16:07:42
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.wgl;
public interface WGLPixelFormat
{
public static final int WGL_WNUMBER_PIXEL_FORMATS_ARB = 0x2000;
public static final int WGL_WDRAW_TO_WINDOW_ARB = 0x2001;
public static final int WGL_WDRAW_TO_BITMAP_ARB = 0x2002;
public static final int WGL_WACCELERATION_ARB = 0x2003;
public static final int WGL_WNEED_PALETTE_ARB = 0x2004;
public static final int WGL_WNEED_SYSTEM_PALETTE_ARB = 0x2005;
public static final int WGL_WSWAP_LAYER_BUFFERS_ARB = 0x2006;
public static final int WGL_WSWAP_METHOD_ARB = 0x2007;
public static final int WGL_WNUMBER_OVERLAYS_ARB = 0x2008;
public static final int WGL_WNUMBER_UNDERLAYS_ARB = 0x2009;
public static final int WGL_WTRANSPARENT_ARB = 0x200A;
public static final int WGL_WTRANSPARENT_RED_VALUE_ARB = 0x2037;
public static final int WGL_WTRANSPARENT_GREEN_VALUE_ARB = 0x2038;
public static final int WGL_WTRANSPARENT_BLUE_VALUE_ARB = 0x2039;
public static final int WGL_WTRANSPARENT_ALPHA_VALUE_ARB = 0x203A;
public static final int WGL_WTRANSPARENT_INDEX_VALUE_ARB = 0x203B;
public static final int WGL_WSHARE_DEPTH_ARB = 0x200C;
public static final int WGL_WSHARE_STENCIL_ARB = 0x200D;
public static final int WGL_WSHARE_ACCUM_ARB = 0x200E;
public static final int WGL_WSUPPORT_GDI_ARB = 0x200F;
public static final int WGL_WSUPPORT_OPENARB = 0x2010;
public static final int WGL_WDOUBLE_BUFFER_ARB = 0x2011;
public static final int WGL_WSTEREO_ARB = 0x2012;
public static final int WGL_WPIXEL_TYPE_ARB = 0x2013;
public static final int WGL_WCOLOR_BITS_ARB = 0x2014;
public static final int WGL_WRED_BITS_ARB = 0x2015;
public static final int WGL_WRED_SHIFT_ARB = 0x2016;
public static final int WGL_WGREEN_BITS_ARB = 0x2017;
public static final int WGL_WGREEN_SHIFT_ARB = 0x2018;
public static final int WGL_WBLUE_BITS_ARB = 0x2019;
public static final int WGL_WBLUE_SHIFT_ARB = 0x201A;
public static final int WGL_WALPHA_BITS_ARB = 0x201B;
public static final int WGL_WALPHA_SHIFT_ARB = 0x201C;
public static final int WGL_WACCUM_BITS_ARB = 0x201D;
public static final int WGL_WACCUM_RED_BITS_ARB = 0x201E;
public static final int WGL_WACCUM_GREEN_BITS_ARB = 0x201F;
public static final int WGL_WACCUM_BLUE_BITS_ARB = 0x2020;
public static final int WGL_WACCUM_ALPHA_BITS_ARB = 0x2021;
public static final int WGL_WDEPTH_BITS_ARB = 0x2022;
public static final int WGL_WSTENCIL_BITS_ARB = 0x2023;
public static final int WGL_WAUX_BUFFERS_ARB = 0x2024;
public static final int WGL_WNO_ACCELERATION_ARB = 0x2025;
public static final int WGL_WGENERIC_ACCELERATION_ARB = 0x2026;
public static final int WGL_WFULL_ACCELERATION_ARB = 0x2027;
public static final int WGL_WSWAP_EXCHANGE_ARB = 0x2028;
public static final int WGL_WSWAP_COPY_ARB = 0x2029;
public static final int WGL_WSWAP_UNDEFINED_ARB = 0x202A;
public static final int WGL_WTYPE_RGBA_ARB = 0x202B;
public static final int WGL_WTYPE_COLORINDEX_ARB = 0x202C;
}

View File

@ -0,0 +1,78 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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.
*/
/*
* Created by IntelliJ IDEA.
* User: nj
* Date: 12-08-2002
* Time: 16:08:41
* To change template for new interface use
* Code Style | Class Templates options (Tools | IDE Options).
*/
package org.lwjgl.opengl.wgl;
public interface WGLRenderTexture
{
public static final int WGL_WBIND_TO_TEXTURE_RGB_ARB = 0x2070;
public static final int WGL_WBIND_TO_TEXTURE_RGBA_ARB = 0x2071;
public static final int WGL_WTEXTURE_FORMAT_ARB = 0x2072;
public static final int WGL_WTEXTURE_TARGET_ARB = 0x2073;
public static final int WGL_WMIPMAP_TEXTURE_ARB = 0x2074;
public static final int WGL_WTEXTURE_RGB_ARB = 0x2075;
public static final int WGL_WTEXTURE_RGBA_ARB = 0x2076;
public static final int WGL_WNO_TEXTURE_ARB = 0x2077;
public static final int WGL_WTEXTURE_CUBE_MAP_ARB = 0x2078;
public static final int WGL_WTEXTURE_1D_ARB = 0x2079;
public static final int WGL_WTEXTURE_2D_ARB = 0x207A;
public static final int WGL_WMIPMAP_LEVEL_ARB = 0x207B;
public static final int WGL_WCUBE_MAP_FACE_ARB = 0x207C;
public static final int WGL_WTEXTURE_CUBE_MAP_POSITIVE_X_ARB = 0x207D;
public static final int WGL_WTEXTURE_CUBE_MAP_NEGATIVE_X_ARB = 0x207E;
public static final int WGL_WTEXTURE_CUBE_MAP_POSITIVE_Y_ARB = 0x207F;
public static final int WGL_WTEXTURE_CUBE_MAP_NEGATIVE_Y_ARB = 0x2080;
public static final int WGL_WTEXTURE_CUBE_MAP_POSITIVE_Z_ARB = 0x2081;
public static final int WGL_WTEXTURE_CUBE_MAP_NEGATIVE_Z_ARB = 0x2082;
public static final int WGL_WFRONT_LEFT_ARB = 0x2083;
public static final int WGL_WFRONT_RIGHT_ARB = 0x2084;
public static final int WGL_WBACK_LEFT_ARB = 0x2085;
public static final int WGL_WBACK_RIGHT_ARB = 0x2086;
public static final int WGL_WAUX0_ARB = 0x2087;
public static final int WGL_WAUX1_ARB = 0x2088;
public static final int WGL_WAUX2_ARB = 0x2089;
public static final int WGL_WAUX3_ARB = 0x208A;
public static final int WGL_WAUX4_ARB = 0x208B;
public static final int WGL_WAUX5_ARB = 0x208C;
public static final int WGL_WAUX6_ARB = 0x208D;
public static final int WGL_WAUX7_ARB = 0x208E;
public static final int WGL_WAUX8_ARB = 0x208F;
public static final int WGL_WAUX9_ARB = 0x2090;
}

View File

@ -1,43 +0,0 @@
/*
* Created on 18-03-2003
*
* To change this generated comment go to
* Window>Preferences>Java>Code Generation>Code Template
*/
package org.lwjgl.test;
import org.lwjgl.*;
/**
* @author Elias Naur
*/
public class DisplayConfigurationTest {
private static void changeConfig(float gamma, float brightness, float contrast) {
Display.setDisplayConfiguration(gamma, brightness, contrast);
System.out.println("Configuration changed, gamma = " + gamma + " brightness = " + brightness + " contrast = " + contrast);
try {
Thread.sleep(3000);
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
System.out.println("Testing normal setting");
changeConfig(1.0f, 0f, 1f);
System.out.println("Testing gamma settings");
changeConfig(5.0f, 0f, 1f);
changeConfig(0.5f, 0f, 1f);
System.out.println("Testing brightness settings");
changeConfig(1.0f, -1.0f, 1f);
changeConfig(1.0f, -0.5f, 1f);
changeConfig(1.0f, 0.5f, 1f);
changeConfig(1.0f, 1.0f, 1f);
System.out.println("Testing contrast settings");
changeConfig(1.0f, 0f, 0f);
changeConfig(1.0f, 0f, 0.5f);
changeConfig(1.0f, 0f, 10000.0f);
System.out.println("Test done - Resetting configuration");
Display.resetDisplayMode();
}
}

View File

@ -1,44 +0,0 @@
/*
* Created on 18-03-2003
*
* To change this generated comment go to
* Window>Preferences>Java>Code Generation>Code Template
*/
package org.lwjgl.test;
import org.lwjgl.*;
import org.lwjgl.opengl.Window;
/**
* @author Brian
*/
public class WindowCreationTest {
public static void main(String[] args) {
DisplayMode[] modes = Display.getAvailableDisplayModes();
System.out.println("Found " + modes.length + " display modes");
try {
Window.create("WindowCreationTest", 50, 50, 320, 240, 16, 0, 0, 0);
} catch (Exception e) {
e.printStackTrace();
}
System.out.println(Window.getHeight() + ", " + Window.getWidth() + ", " + Window.getTitle());
System.out.println("Display created");
while(!Window.isCloseRequested()) {
Window.update();
try {
Thread.sleep(100);
} catch (Exception e) {
e.printStackTrace();
}
}
Window.destroy();
}
}

View File

@ -1,225 +0,0 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Lightweight Java Game Library' 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.input;
import org.lwjgl.Sys;
import org.lwjgl.Display;
import org.lwjgl.DisplayMode;
import org.lwjgl.input.Controller;
import org.lwjgl.opengl.GL;
import org.lwjgl.opengl.Window;
import org.lwjgl.opengl.GLU;
import org.lwjgl.vector.Vector2f;
/**
* $Id$
* <br>
* Controller creation test
*
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public class ControllerCreationTest {
/** position of quad to draw */
private Vector2f position = new Vector2f(320.0f, 240.0f);
/** Display mode selected */
private DisplayMode displayMode;
/** Creates a new instance of MouseTest */
public ControllerCreationTest() {
}
private void initialize(boolean fullscreen) {
// find first display mode that allows us 640*480*16
DisplayMode[] modes = Display.getAvailableDisplayModes();
for (int i = 0; i < modes.length; i++) {
if (modes[i].width == 640
&& modes[i].height == 480
&& modes[i].bpp >= 16) {
displayMode = modes[i];
break;
}
}
try {
if(fullscreen) {
Display.setDisplayMode(displayMode);
Window.create("ControllerCreationTest", 16, 0, 0, 0);
} else {
Window.create("ControllerCreationTest", 50, 50, 640, 480, 16, 0, 0, 0);
}
} catch (Exception e) {
e.printStackTrace();
System.exit(-1);
}
initializeOpenGL();
}
private void initializeOpenGL() {
GL.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
GLU.gluOrtho2D(0.0, 640, 0, 480);
}
public void executeTest() {
initialize(false);
System.out.println("Test ready:\n");
// windowed mode
System.out.println("=========== WINDOWED MODE ==============");
for(int i=0; i<2; i++) {
System.out.println("Test " + (i+1) + ":");
createController();
wiggleController();
destroyController();
System.out.println("");
}
// recreate display in fullscreen mode
System.out.print("Destroying display...");
Window.destroy();
System.out.println("success");
System.out.print("Entering fullscreen mode...");
try {
Window.destroy();
initialize(true);
Display.setDisplayMode(displayMode);
} catch (Exception e) {
e.printStackTrace();
}
System.out.println("success");
// fullscreen mode
System.out.println("=========== FULLSCREEN MODE ==============");
for(int i=0; i<2; i++) {
System.out.println("Test " + (i+3) + ":");
createController();
wiggleController();
destroyController();
System.out.println("");
}
System.out.println("Test completed successfully!");
System.out.print("Shutting down...");
Display.resetDisplayMode();
Controller.destroy();
Window.destroy();
System.out.println("shutdown complete");
}
private void createController() {
System.out.print("Creating controller...");
try {
Controller.create();
} catch (Exception e) {
System.out.println("failed");
System.exit(-1);
}
System.out.println("success");
}
private void wiggleController() {
System.out.print("Please move the controller around");
long statustime = Sys.getTime();
long endtime = Sys.getTime() + Sys.getTimerResolution() * 5;
while (Sys.getTime() < endtime) {
Window.update();
Controller.poll();
//controller is a bit fuzzy
if(Controller.x > 100) {
position.x += 1;
} else if (Controller.x < -100) {
position.x -= 1;
}
if(Controller.y > 100) {
position.y -= 1;
} else if (Controller.y < -100) {
position.y += 1;
}
render();
Window.paint();
if (Sys.getTime() - statustime > Sys.getTimerResolution()) {
System.out.print(".");
statustime = Sys.getTime();
}
}
System.out.println("thank you");
}
private void destroyController() {
System.out.print("Destroying controller...");
Controller.destroy();
System.out.print("success");
}
private void render() {
GL.glClear(GL.GL_COLOR_BUFFER_BIT);
GL.glPushMatrix();
GL.glBegin(GL.GL_POLYGON);
{
GL.glColor3f(0.0f, 1.0f, 1.0f);
GL.glVertex2f(position.x + 0.0f, position.y + 0.0f);
GL.glColor3f(1.0f, 0.0f, 1.0f);
GL.glVertex2f(position.x + 0.0f, position.y + 30.0f);
GL.glVertex2f(position.x + 40.0f, position.y + 30.0f);
GL.glColor3f(1.0f, 1.0f, 0.0f);
GL.glVertex2f(position.x + 60.0f, position.y + 15.f);
GL.glVertex2f(position.x + 40.0f, position.y + 0.0f);
}
GL.glEnd();
GL.glPopMatrix();
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
ControllerCreationTest cct = new ControllerCreationTest();
cct.executeTest();
}
}

View File

@ -1,201 +0,0 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Lightweight Java Game Library' 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.input;
import org.lwjgl.DisplayMode;
import org.lwjgl.input.Controller;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL;
import org.lwjgl.opengl.Window;
import org.lwjgl.opengl.GLU;
import org.lwjgl.vector.Vector2f;
/**
* $Id$
* <br>
* Controller test
*
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public class ControllerTest {
/** GLU instance */
private GLU glu;
/** position of quad to draw */
private Vector2f position = new Vector2f(320.0f, 240.0f);
/** Display mode selected */
private DisplayMode displayMode;
/** Creates a new instance of ControllerTest */
public ControllerTest() {
}
private void initialize() {
// create display and opengl
setupDisplay(false);
try {
Keyboard.create();
} catch (Exception e) {
e.printStackTrace();
System.exit(-1);
}
}
private void setupDisplay(boolean fullscreen) {
try {
Window.create("ControllerTest", 50, 50, 640, 480, 16, 0, 0, 0);
} catch (Exception e) {
e.printStackTrace();
System.exit(-1);
}
initializeOpenGL();
}
private void initializeOpenGL() {
GL.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
GLU.gluOrtho2D(0.0, 640, 0, 480);
}
public void executeTest() {
initialize();
createController();
wiggleController();
Controller.destroy();
Keyboard.destroy();
Window.destroy();
}
private void createController() {
try {
Controller.create();
} catch (Exception e) {
e.printStackTrace();
System.exit(-1);
}
}
private void wiggleController() {
while (!Window.isCloseRequested()) {
Window.update();
if(Window.isMinimized()) {
try {
Thread.sleep(100);
} catch (InterruptedException inte) {
inte.printStackTrace();
}
continue;
}
Controller.poll();
Keyboard.poll();
if(Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)) {
return;
}
if (Controller.x > 200) {
position.x += 1;
}
if (Controller.x < -200) {
position.x -= 1;
}
if (Controller.y < -200) {
position.y += 1;
}
if (Controller.y > 200) {
position.y -= 1;
}
if(position.x<0) {
position.x = 0;
} else if (position.x>640-60) {
position.x = 640-60;
}
if(position.y < 0) {
position.y = 0;
} else if (position.y>480-30) {
position.y = 480-30;
}
render();
Window.paint();
}
}
private void render() {
GL.glClear(GL.GL_COLOR_BUFFER_BIT);
GL.glBegin(GL.GL_POLYGON);
{
float color = 1.0f;
int buttonDown = 0;
for(int i=0;i<Controller.buttonCount; i++) {
if(Controller.isButtonDown(i)) {
color = (1.0f / Controller.buttonCount) * (i+1);
System.out.println("Button " + i + " down");
}
}
GL.glColor3f(color, color, color);
GL.glVertex2f(position.x + 0.0f, position.y + 0.0f);
GL.glVertex2f(position.x + 0.0f, position.y + 30.0f);
GL.glVertex2f(position.x + 40.0f, position.y + 30.0f);
GL.glVertex2f(position.x + 60.0f, position.y + 15.f);
GL.glVertex2f(position.x + 40.0f, position.y + 0.0f);
}
GL.glEnd();
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
ControllerTest ct = new ControllerTest();
ct.executeTest();
}
}

View File

@ -1,357 +0,0 @@
/*
* Copyright (c) 2003 Lightweight Java Game Library 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 'Lightweight Java Game Library' 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.input;
import org.lwjgl.*;
import org.lwjgl.input.*;
import org.lwjgl.opengl.*;
import java.nio.*;
/**
* $Id$
*
* Tests switching between windowed and fullscreen - including hardware cursor test
*
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public class HWCursorTest {
/** Intended deiplay mode */
private DisplayMode mode;
/** GLU instance */
private GLU glu;
/** The native cursor */
private static Cursor cursor = null;
/** The mouse cursor position */
private static int mouse_x;
private static int mouse_y;
/**
* Executes the test
*/
public void execute() {
initialize();
mainLoop();
cleanup();
}
/**
* Initializes the test
*/
private void initialize() {
try {
//find displaymode
mode = findDisplayMode(800, 600, 16);
// start of in windowed mode
Window.create("Test", 50, 50, mode.width, mode.height, mode.bpp, 0, 0, 0);
glInit();
Keyboard.create();
initNativeCursor();
} catch (Exception e) {
e.printStackTrace();
}
}
private static void initNativeCursor() {
try {
Mouse.create();
} catch (Exception e) {
e.printStackTrace();
}
if ((Mouse.getNativeCursorCaps() & Mouse.CURSOR_ONE_BIT_TRANSPARANCY) == 0) {
System.out.println("No HW cursor support!");
System.exit(0);
}
System.out.println("Maximum native cursor size: " + Mouse.getMaxCursorSize() + ", min size: " + Mouse.getMinCursorSize());
mouse_x = mouse_y = 0;
int num_images = 3;
int image_size = Mouse.getMaxCursorSize()*Mouse.getMaxCursorSize();
IntBuffer cursor_images = ByteBuffer.allocateDirect(num_images*image_size*4).order(ByteOrder.nativeOrder()).asIntBuffer();
IntBuffer delays = ByteBuffer.allocateDirect(num_images*4).order(ByteOrder.nativeOrder()).asIntBuffer();
delays.put(0, 500);
delays.put(1, 500);
delays.put(2, 500);
int color_scale = 255/Mouse.getMaxCursorSize();
int bit_mask = 0x81000000;
for (int j = 0; j < image_size; j++) {
if (j % 4 == 0)
bit_mask = (~bit_mask) & 0x81000000;
int color = (j*color_scale/Mouse.getMaxCursorSize()) << 16;
cursor_images.put(0*image_size + j, 0x00000020 | color | bit_mask);
}
for (int j = 0; j < image_size; j++) {
if (j % 4 == 0)
bit_mask = (~bit_mask) & 0x81000000;
int color = (j*color_scale/Mouse.getMaxCursorSize()) << 8;
cursor_images.put(1*image_size + j, 0x00000020 | color | bit_mask);
}
for (int j = 0; j < image_size; j++) {
if (j % 4 == 0)
bit_mask = (~bit_mask) & 0x81000000;
int color = (j*color_scale/Mouse.getMaxCursorSize());
cursor_images.put(2*image_size + j, 0x00000020 | color | bit_mask);
}
try {
if ((Mouse.getNativeCursorCaps() | Mouse.CURSOR_ANIMATION) == 0)
num_images = 1;
cursor = new Cursor(Mouse.getMaxCursorSize(), Mouse.getMaxCursorSize(), Mouse.getMaxCursorSize()/2, Mouse.getMaxCursorSize()/2, num_images, cursor_images, delays);
Mouse.setNativeCursor(cursor);
} catch (Exception e) {
e.printStackTrace();
System.exit(1);
}
}
/**
* Runs the main loop of the "test"
*/
private void mainLoop() {
while (!Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)
&& !Window.isCloseRequested()) {
// allow subsystem to get a chance to run too
Window.update();
if (!Window.isMinimized()) {
// check keyboard input
processKeyboard();
render();
// paint window
Window.paint();
} else {
// no need to render/paint if nothing has changed (ie. window dragged over)
if (Window.isDirty()) {
render();
Window.paint();
}
// don't waste cpu time, sleep more
try {
Thread.sleep(100);
} catch (InterruptedException inte) {
}
}
}
}
/**
* Performs the logic
*/
private void render() {
//clear background
GL.glClear(GL.GL_COLOR_BUFFER_BIT);
// draw white quad
GL.glPushMatrix();
{
GL.glTranslatef(mouse_x, 600 - mouse_y, 0);
GL.glColor3f(1.0f, 1.0f, 1.0f);
GL.glBegin(GL.GL_QUADS);
{
GL.glVertex2i(-50, -50);
GL.glVertex2i(50, -50);
GL.glVertex2i(50, 50);
GL.glVertex2i(-50, 50);
}
GL.glEnd();
}
GL.glPopMatrix();
}
/**
* Processes keyboard input
*/
private void processKeyboard() {
Keyboard.poll();
Mouse.poll();
if (Mouse.dx != 0 || Mouse.dy != 0) {
mouse_x += Mouse.dx;
mouse_y += Mouse.dy;
System.out.println("mouse_x " + mouse_x + " mouse_y " + mouse_y);
}
//check for fullscreen key
if (Keyboard.isKeyDown(Keyboard.KEY_F)) {
try {
Keyboard.destroy();
try {
Mouse.setNativeCursor(null);
} catch (Exception e) {
e.printStackTrace();
System.exit(1);
}
cursor.destroy();
Mouse.destroy();
Window.destroy();
Display.setDisplayMode(mode);
Window.create("Test", mode.bpp, 0, 0, 0);
glInit();
Keyboard.create();
initNativeCursor();
} catch (Exception e) {
e.printStackTrace();
}
}
//check for window key
if (Keyboard.isKeyDown(Keyboard.KEY_W)) {
try {
Keyboard.destroy();
try {
Mouse.setNativeCursor(null);
} catch (Exception e) {
e.printStackTrace();
System.exit(1);
}
cursor.destroy();
Mouse.destroy();
Window.destroy();
Display.resetDisplayMode();
Window.create("Test", 50, 50, mode.width, mode.height, mode.bpp, 0, 0, 0);
glInit();
Keyboard.create();
initNativeCursor();
} catch (Exception e) {
e.printStackTrace();
}
}
if (Keyboard.isKeyDown(Keyboard.KEY_M)) {
try {
Mouse.setNativeCursor(null);
} catch (Exception e) {
e.printStackTrace();
}
}
if (Keyboard.isKeyDown(Keyboard.KEY_N)) {
try {
Mouse.setNativeCursor(cursor);
mouse_x = mouse_y = 0;
} catch (Exception e) {
e.printStackTrace();
}
}
}
/**
* Cleans up the test
*/
private void cleanup() {
Keyboard.destroy();
try {
Mouse.setNativeCursor(null);
} catch (Exception e) {
e.printStackTrace();
System.exit(1);
}
cursor.destroy();
Mouse.destroy();
Display.resetDisplayMode();
Window.destroy();
}
/**
* Retrieves a displaymode, if one such is available
*
* @param width Required width
* @param height Required height
* @param bpp Minimum required bits per pixel
* @return
*/
private DisplayMode findDisplayMode(int width, int height, int bpp) {
DisplayMode[] modes = Display.getAvailableDisplayModes();
for (int i = 0; i < modes.length; i++) {
if (modes[i].width == width
&& modes[i].height == height
&& modes[i].bpp >= bpp) {
return modes[i];
}
}
return null;
}
/**
* Initializes OGL
*/
private void glInit() {
// Go into orthographic projection mode.
GL.glMatrixMode(GL.GL_PROJECTION);
GL.glLoadIdentity();
GLU.gluOrtho2D(0, mode.width, 0, mode.height);
GL.glMatrixMode(GL.GL_MODELVIEW);
GL.glLoadIdentity();
GL.glViewport(0, 0, mode.width, mode.height);
//set clear color to black
GL.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
//sync frame (only works on windows)
GLCaps.determineAvailableExtensions();
if (GLCaps.WGL_EXT_swap_control) {
GL.wglSwapIntervalEXT(1);
}
}
/**
* Test entry point
*/
public static void main(String[] args) {
System.out.println(
"Change between fullscreen and windowed mode, by pressing F and W respectively. Enable hw cursor with N and disable it with M.");
System.out.println(
"Move quad using arrowkeys, and change rotation using +/-");
HWCursorTest cursorTest = new HWCursorTest();
cursorTest.execute();
}
}

View File

@ -1,217 +0,0 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Lightweight Java Game Library' 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.input;
import org.lwjgl.DisplayMode;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL;
import org.lwjgl.opengl.Window;
import org.lwjgl.opengl.GLU;
import org.lwjgl.vector.Vector2f;
/**
* $Id$
* <br>
* Keyboard test
*
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public class KeyboardTest {
/** GLU instance */
private GLU glu;
/** position of quad to draw */
private Vector2f position = new Vector2f(320.0f, 240.0f);
/** Display mode selected */
private DisplayMode displayMode;
private boolean bufferedKeyboard;
private boolean translatedKeyboard;
private int bufferSize;
/** Creates a new instance of MouseTest */
public KeyboardTest() {
}
private void initialize() {
// create display and opengl
setupDisplay(false);
try {
Keyboard.create();
} catch (Exception e) {
e.printStackTrace();
System.exit(-1);
}
}
private void setupDisplay(boolean fullscreen) {
try {
Window.create("KeyboardTest", 50, 50, 640, 480, 16, 0, 0, 0);
} catch (Exception e) {
e.printStackTrace();
System.exit(-1);
}
initializeOpenGL();
}
private void initializeOpenGL() {
GL.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
GLU.gluOrtho2D(0.0, 640, 0, 480);
}
public void executeTest() {
initialize();
createKeyboard();
wiggleKeyboard();
Keyboard.destroy();
Window.destroy();
}
private void createKeyboard() {
try {
Keyboard.create();
} catch (Exception e) {
e.printStackTrace();
System.exit(-1);
}
}
private void wiggleKeyboard() {
Keyboard.enableBuffer();
Keyboard.enableTranslation();
while (!Window.isCloseRequested()) {
Window.update();
if(Window.isMinimized()) {
try {
Thread.sleep(100);
} catch (InterruptedException inte) {
inte.printStackTrace();
}
continue;
}
//check keys, buffered
Keyboard.read();
int count = Keyboard.getNumKeyboardEvents();
System.out.println("Read " + count + " events");
while(Keyboard.next()) {
System.out.println("Checking key:" + Keyboard.getKeyName(Keyboard.key));
if(Keyboard.key == Keyboard.KEY_ESCAPE) {
return;
}
if (Keyboard.isKeyDown(Keyboard.KEY_RIGHT)) {
position.x += 1;
}
if (Keyboard.key == Keyboard.KEY_RIGHT) {
position.x += 1;
}
if (Keyboard.isKeyDown(Keyboard.KEY_LEFT)) {
position.x -= 1;
}
if (Keyboard.isKeyDown(Keyboard.KEY_UP)) {
position.y += 1;
}
if (Keyboard.isKeyDown(Keyboard.KEY_DOWN)) {
position.y -= 1;
}
}
if (count > 0) {
System.out.println();
}
if(position.x<0) {
position.x = 0;
} else if (position.x>640-60) {
position.x = 640-60;
}
if(position.y < 0) {
position.y = 0;
} else if (position.y>480-30) {
position.y = 480-30;
}
render();
Window.paint();
try {
Thread.sleep(0);
} catch (Exception e) {
}
}
}
private void render() {
GL.glClear(GL.GL_COLOR_BUFFER_BIT);
GL.glBegin(GL.GL_POLYGON);
{
float color = 1.0f;
int buttonDown = 0;
GL.glColor3f(color, color, color);
GL.glVertex2f(position.x + 0.0f, position.y + 0.0f);
GL.glVertex2f(position.x + 0.0f, position.y + 30.0f);
GL.glVertex2f(position.x + 40.0f, position.y + 30.0f);
GL.glVertex2f(position.x + 60.0f, position.y + 15.f);
GL.glVertex2f(position.x + 40.0f, position.y + 0.0f);
}
GL.glEnd();
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
KeyboardTest kt = new KeyboardTest();
kt.executeTest();
}
}

View File

@ -1,234 +0,0 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Lightweight Java Game Library' 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.input;
import org.lwjgl.Sys;
import org.lwjgl.Display;
import org.lwjgl.DisplayMode;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL;
import org.lwjgl.opengl.Window;
import org.lwjgl.opengl.GLU;
import org.lwjgl.vector.Vector2f;
/**
* $Id$
* <br>
* Mouse test
*
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public class MouseCreationTest {
/** GLU instance */
private GLU glu;
/** position of quad to draw */
private Vector2f position = new Vector2f(320.0f, 240.0f);
/** Display mode selected */
private DisplayMode displayMode;
/** Creates a new instance of MouseTest */
public MouseCreationTest() {
}
private void initialize(boolean fullscreen) {
// find first display mode that allows us 640*480*16
DisplayMode[] modes = Display.getAvailableDisplayModes();
for (int i = 0; i < modes.length; i++) {
if (modes[i].width == 640
&& modes[i].height == 480
&& modes[i].bpp >= 16) {
displayMode = modes[i];
break;
}
}
try {
if(fullscreen) {
Display.setDisplayMode(displayMode);
Window.create("MouseCreationTest", 16, 0, 0, 0);
} else {
Window.create("MouseCreationTest", 50, 50, 640, 480, 16, 0, 0, 0);
}
} catch (Exception e) {
e.printStackTrace();
System.exit(-1);
}
initializeOpenGL();
}
private void initializeOpenGL() {
GL.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
GLU.gluOrtho2D(0.0, 640, 0, 480);
}
public void executeTest() {
initialize(false);
System.out.println("Test ready:\n");
// windowed mode
System.out.println("=========== WINDOWED MODE ==============");
for(int i=0; i<2; i++) {
System.out.println("Test " + (i+1) + ":");
createMouse();
wiggleMouse();
destroyMouse();
System.out.println("");
}
// recreate display in fullscreen mode
System.out.print("Destroying display...");
System.out.println("success");
System.out.print("Entering fullscreen mode...");
try {
Window.destroy();
initialize(true);
Display.setDisplayMode(displayMode);
} catch (Exception e) {
e.printStackTrace();
}
System.out.println("success");
// fullscreen mode
System.out.println("=========== FULLSCREEN MODE ==============");
for(int i=0; i<2; i++) {
System.out.println("Test " + (i+3) + ":");
createMouse();
wiggleMouse();
destroyMouse();
System.out.println("");
}
System.out.println("Test completed successfully!");
System.out.print("Shutting down...");
Display.resetDisplayMode();
Mouse.destroy();
Window.destroy();
System.out.println("shutdown complete");
}
private void createMouse() {
System.out.print("Creating mouse...");
try {
Mouse.create();
} catch (Exception e) {
System.out.println("failed");
System.exit(-1);
}
System.out.println("success");
}
private void wiggleMouse() {
System.out.print("Please move the mouse around");
long statustime = Sys.getTime();
long endtime = Sys.getTime() + Sys.getTimerResolution() * 5;
while (Sys.getTime() < endtime) {
Window.update();
Mouse.poll();
position.x += Mouse.dx;
position.y -= Mouse.dy;
if(position.x<0) {
position.x = 0;
} else if (position.x>640-60) {
position.x = 640-60;
}
if(position.y < 0) {
position.y = 0;
} else if (position.y>480-30) {
position.y = 480-30;
}
render();
Window.paint();
if (Sys.getTime() - statustime > Sys.getTimerResolution()) {
System.out.print(".");
statustime = Sys.getTime();
}
}
System.out.println("thank you");
}
private void destroyMouse() {
System.out.print("Destroying mouse...");
Mouse.destroy();
System.out.print("success");
}
private void render() {
GL.glClear(GL.GL_COLOR_BUFFER_BIT);
GL.glBegin(GL.GL_POLYGON);
{
float color = 1.0f;
int buttonDown = 0;
for(int i=0;i<Mouse.buttonCount; i++) {
if(Mouse.isButtonDown(i)) {
color = (1.0f / Mouse.buttonCount) * (i+1);
break;
}
}
GL.glColor3f(color, color, color);
GL.glVertex2f(position.x + 0.0f, position.y + 0.0f);
GL.glVertex2f(position.x + 0.0f, position.y + 30.0f);
GL.glVertex2f(position.x + 40.0f, position.y + 30.0f);
GL.glVertex2f(position.x + 60.0f, position.y + 15.f);
GL.glVertex2f(position.x + 40.0f, position.y + 0.0f);
}
GL.glEnd();
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
MouseCreationTest mt = new MouseCreationTest();
mt.executeTest();
}
}

View File

@ -1,188 +0,0 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Lightweight Java Game Library' 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.input;
import org.lwjgl.DisplayMode;
import org.lwjgl.input.Mouse;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL;
import org.lwjgl.opengl.Window;
import org.lwjgl.opengl.GLU;
import org.lwjgl.vector.Vector2f;
/**
* $Id$
* <br>
* Mouse test
*
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public class MouseTest {
/** GLU instance */
private GLU glu;
/** position of quad to draw */
private Vector2f position = new Vector2f(320.0f, 240.0f);
/** Display mode selected */
private DisplayMode displayMode;
/** Creates a new instance of MouseTest */
public MouseTest() {
}
private void initialize() {
// create display and opengl
setupDisplay(false);
try {
Keyboard.create();
} catch (Exception e) {
e.printStackTrace();
System.exit(-1);
}
}
private void setupDisplay(boolean fullscreen) {
try {
Window.create("MouseTest", 50, 50, 640, 480, 16, 0, 0, 0);
} catch (Exception e) {
e.printStackTrace();
System.exit(-1);
}
initializeOpenGL();
}
private void initializeOpenGL() {
GL.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
GLU.gluOrtho2D(0.0, 640, 0, 480);
}
public void executeTest() {
initialize();
createMouse();
wiggleMouse();
Mouse.destroy();
Keyboard.destroy();
Window.destroy();
}
private void createMouse() {
try {
Mouse.create();
} catch (Exception e) {
e.printStackTrace();
System.exit(-1);
}
}
private void wiggleMouse() {
while (!Window.isCloseRequested()) {
Window.update();
if(Window.isMinimized()) {
try {
Thread.sleep(100);
} catch (InterruptedException inte) {
inte.printStackTrace();
}
continue;
}
Mouse.poll();
Keyboard.poll();
if(Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)) {
return;
}
position.x += Mouse.dx;
position.y -= Mouse.dy;
if(position.x<0) {
position.x = 0;
} else if (position.x>640-60) {
position.x = 640-60;
}
if(position.y < 0) {
position.y = 0;
} else if (position.y>480-30) {
position.y = 480-30;
}
render();
Window.paint();
}
}
private void render() {
GL.glClear(GL.GL_COLOR_BUFFER_BIT);
GL.glBegin(GL.GL_POLYGON);
{
float color = 1.0f;
int buttonDown = 0;
for(int i=0;i<Mouse.buttonCount; i++) {
if(Mouse.isButtonDown(i)) {
color = (1.0f / Mouse.buttonCount) * (i+1);
break;
}
}
GL.glColor3f(color, color, color);
GL.glVertex2f(position.x + 0.0f, position.y + 0.0f);
GL.glVertex2f(position.x + 0.0f, position.y + 30.0f);
GL.glVertex2f(position.x + 40.0f, position.y + 30.0f);
GL.glVertex2f(position.x + 60.0f, position.y + 15.f);
GL.glVertex2f(position.x + 40.0f, position.y + 0.0f);
}
GL.glEnd();
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
MouseTest mt = new MouseTest();
mt.executeTest();
}
}

View File

@ -1,107 +0,0 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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 org.lwjgl.openal.ALC;
import java.nio.IntBuffer;
/**
* $Id$
*
* This is a test for the ALC part of OpenAL
*
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public class ALCTest extends BasicTest {
/**
* Creates an instance of ALCTest
*/
public ALCTest() {
super();
}
/**
* Runs the actual test, using supplied arguments
*/
protected void execute(String[] args) {
//error stuff
int lastError = ALC.ALC_NO_ERROR;
//create attribute list for context creation
IntBuffer buffer = createIntBuffer(7);
if ((lastError = ALC.alcGetError()) != ALC.ALC_NO_ERROR) {
System.out.println("ALC Error: " + ALC.alcGetString(lastError));
System.exit(-1);
}
//query
System.out.println(
"DEFAULT_DEVICE_SPECIFIER: "
+ ALC.alcGetString(ALC.ALC_DEFAULT_DEVICE_SPECIFIER));
System.out.println(
"DEVICE_SPECIFIER: " + ALC.alcGetString(ALC.ALC_DEVICE_SPECIFIER));
System.out.println("EXTENSIONS: " + ALC.alcGetString(ALC.ALC_EXTENSIONS));
//mo query
buffer.rewind();
buffer.limit(1);
ALC.alcGetInteger(ALC.ALC_MAJOR_VERSION, buffer);
ALC.alcGetInteger(ALC.ALC_MINOR_VERSION, (IntBuffer) buffer.position(1).limit(2));
System.out.println("ALC_MAJOR_VERSION: " + buffer.get(0));
System.out.println("ALC_MINOR_VERSION: " + buffer.get(1));
//no check for ALC_ALL_ATTRIBUTES / ALC_ATTRIBUTES_SIZE since it
//is buggy on win32 - my dev platform
//get an enumerstion value
System.out.println(
"Value of ALC_MAJOR_VERSION: "
+ ALC.alcGetEnumValue("ALC_MAJOR_VERSION"));
alExit();
}
/**
* main entry point
*
* @param args String array containing arguments
*/
public static void main(String[] args) {
ALCTest alcTest = new ALCTest();
alcTest.execute(args);
}
}

View File

@ -1,238 +0,0 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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 org.lwjgl.openal.AL;
import org.lwjgl.openal.eax.*;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.Window;
import org.lwjgl.vector.Vector3f;
import java.nio.IntBuffer;
/**
* $Id$
*
* This test simulates a listener positioned in the center, and
* a source moving around the listener using the keyboard
*
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public class MovingSoundTest extends BasicTest {
public static float MOVEMENT = 50.00f;
/**
* Creates an instance of MovingSoundTest
*/
public MovingSoundTest() {
super();
}
/**
* Runs the actual test, using supplied arguments
*/
protected void execute(String[] args) {
if (args.length < 1) {
System.out.println("no argument supplied, assuming Footsteps.wav");
args = new String[] {"Footsteps.wav"};
}
try {
Window.create("Moving Sound Test", 100, 100, 320, 240, 32, 0 ,0 ,0);
} catch (Exception e) {
e.printStackTrace();
}
int lastError;
Vector3f sourcePosition = new Vector3f();
Vector3f listenerPosition = new Vector3f();
boolean eaxApplied = false;
EAXListenerProperties eaxListenerProp = null;
//initialize keyboard
try {
Keyboard.create();
} catch (Exception e) {
e.printStackTrace();
exit(-1);
}
//create 1 buffer and 1 source
IntBuffer buffers = createIntBuffer(1);
IntBuffer sources = createIntBuffer(1);
// al generate buffers and sources
buffers.position(0).limit(1);
AL.alGenBuffers(buffers);
if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) {
exit(lastError);
}
sources.position(0).limit(1);
AL.alGenSources(sources);
if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) {
exit(lastError);
}
//load wave data
WaveData wavefile = WaveData.create(args[0]);
//copy to buffers
AL.alBufferData(
buffers.get(0),
wavefile.format,
wavefile.data,
wavefile.data.capacity(),
wavefile.samplerate);
if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) {
exit(lastError);
}
//unload file again
wavefile.dispose();
//set up source input
AL.alSourcei(sources.get(0), AL.AL_BUFFER, buffers.get(0));
if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) {
exit(lastError);
}
AL.alSourcef(sources.get(0), AL.AL_REFERENCE_DISTANCE, 1024.0f);
AL.alSourcef(sources.get(0), AL.AL_ROLLOFF_FACTOR, 0.5f);
//lets loop the sound
AL.alSourcei(sources.get(0), AL.AL_LOOPING, AL.AL_TRUE);
if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) {
exit(lastError);
}
//play source 0
AL.alSourcePlay(sources.get(0));
if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) {
exit(lastError);
}
//setup EAX if possible
if (AL.alIsExtensionPresent("EAX")) {
try {
EAX.create();
eaxListenerProp = new EAXListenerProperties();
} catch (Exception e) {
}
}
System.out.println("Move source with arrow keys\nMove listener with right shift and arrowkeys\nEnable EAX effect by pressing e (if available)\nExit with ESC");
while(!Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)) {
Window.update();
Keyboard.poll();
if(Keyboard.isKeyDown(Keyboard.KEY_LEFT)) {
if(Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) {
listenerPosition.x -= MOVEMENT;
AL.alListener3f(AL.AL_POSITION, listenerPosition.x, listenerPosition.y, listenerPosition.z);
System.out.println("listenerx: " + listenerPosition.x);
} else {
sourcePosition.x -= MOVEMENT;
AL.alSource3f(sources.get(0), AL.AL_POSITION, sourcePosition.x, sourcePosition.y, sourcePosition.z);
System.out.println("sourcex: " + sourcePosition.x);
}
}
if(Keyboard.isKeyDown(Keyboard.KEY_RIGHT)) {
if(Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) {
listenerPosition.x += MOVEMENT;
AL.alListener3f(AL.AL_POSITION, listenerPosition.x, listenerPosition.y, listenerPosition.z);
System.out.println("listenerx: " + listenerPosition.x);
} else {
sourcePosition.x += MOVEMENT;
AL.alSource3f(sources.get(0), AL.AL_POSITION, sourcePosition.x, sourcePosition.y, sourcePosition.z);
System.out.println("sourcex: " + sourcePosition.x);
}
}
if(Keyboard.isKeyDown(Keyboard.KEY_E)) {
if(eaxApplied) {
eaxListenerProp.setEnvironment(EAX.EAX_ENVIRONMENT_GENERIC);
eaxListenerProp.eaxSet(EAXListenerProperties.EAXLISTENER_ENVIRONMENT, 0);
} else {
eaxListenerProp.setEnvironment(EAX.EAX_ENVIRONMENT_HANGAR);
eaxListenerProp.eaxSet(EAXListenerProperties.EAXLISTENER_ENVIRONMENT, 0);
}
eaxApplied = !eaxApplied;
}
if(Window.isCloseRequested()) {
break;
}
try {
Thread.sleep(100);
} catch (InterruptedException inte) {
}
}
//stop source 0
AL.alSourceStop(sources.get(0));
if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) {
exit(lastError);
}
//delete buffers and sources
sources.position(0).limit(1);
AL.alDeleteSources(sources);
if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) {
exit(lastError);
}
buffers.position(0).limit(1);
AL.alDeleteBuffers(buffers);
if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) {
exit(lastError);
}
//shutdown
alExit();
}
/**
* main entry point
*
* @param args String array containing arguments
*/
public static void main(String[] args) {
MovingSoundTest movingSoundTest = new MovingSoundTest();
movingSoundTest.execute(args);
}
}

View File

@ -1,223 +0,0 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Lightweight Java Game Library' 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 org.lwjgl.openal.AL;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.IntBuffer;
/**
* $Id$
* <br>
* Performs a creation test, by creating and destroying OpenAL twice.
* We cannot inherit from BasicTest since it follows another structure.
*
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public class OpenALCreationTest {
/**
* Creates an instance of OpenALCreationTest
*/
public OpenALCreationTest() {
}
public void alInitialize() {
try {
AL.create();
} catch (Exception e) {
e.printStackTrace();
return;
}
}
public void alExit() {
AL.destroy();
}
/**
* Creates an integer buffer to hold specified ints
* - strictly a utility method
*
* @param size how many int to contain
* @return created IntBuffer
*/
protected IntBuffer createIntBuffer(int size) {
ByteBuffer temp = ByteBuffer.allocateDirect(4 * size);
temp.order(ByteOrder.nativeOrder());
return temp.asIntBuffer();
}
/**
* Exits the test NOW, printing errorcode to stdout
*
* @param error Error code causing exit
*/
protected void exit(int error) {
System.out.println("OpenAL Error: " + AL.alGetString(error));
alExit();
System.exit(-1);
}
/**
* Runs the actual test, using supplied arguments
*/
protected void execute(String[] args) {
int lastError;
//initialize AL, using ALC
System.out.print("initialize...");
alInitialize();
System.out.println("success");
//do some audio
executeAudioTest();
//shutdown
System.out.print("shutdown...");
alExit();
System.out.println("success");
//initialize AL, using ALC
System.out.print("initialize...");
alInitialize();
System.out.println("success");
//do some audio
executeAudioTest();
//shutdown
System.out.print("shutdown...");
alExit();
System.out.println("success");
}
/**
* Executes the audio test, which just plays some sound
*/
private void executeAudioTest() {
int lastError;
//create 1 buffer and 1 source
IntBuffer buffers = createIntBuffer(1);
IntBuffer sources = createIntBuffer(1);
// al generate buffers and sources
buffers.position(0).limit(1);
AL.alGenBuffers(buffers);
if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) {
exit(lastError);
}
sources.position(0).limit(1);
AL.alGenSources(sources);
if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) {
exit(lastError);
}
//load wave data
WaveData wavefile = WaveData.create("Footsteps.wav");
//copy to buffers
AL.alBufferData(
buffers.get(0),
wavefile.format,
wavefile.data,
wavefile.data.capacity(),
wavefile.samplerate);
if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) {
exit(lastError);
}
//unload file again
wavefile.dispose();
//set up source input
AL.alSourcei(sources.get(0), AL.AL_BUFFER, buffers.get(0));
if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) {
exit(lastError);
}
//lets loop the sound
AL.alSourcei(sources.get(0), AL.AL_LOOPING, AL.AL_TRUE);
if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) {
exit(lastError);
}
//play source 0
AL.alSourcePlay(sources.get(0));
if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) {
exit(lastError);
}
//wait 5 secs
try {
System.out.print("Playing 'Footsteps.wav' for 2 seconds...");
Thread.sleep(2000);
} catch (InterruptedException inte) {
}
System.out.println("done");
//stop source 0
AL.alSourceStop(sources.get(0));
if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) {
exit(lastError);
}
//delete buffers and sources
sources.position(0).limit(1);
AL.alDeleteSources(sources);
if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) {
exit(lastError);
}
buffers.position(0).limit(1);
AL.alDeleteBuffers(buffers);
if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) {
exit(lastError);
}
}
/**
* main entry point
*
* @param args String array containing arguments
*/
public static void main(String[] args) {
OpenALCreationTest oalCreationTest = new OpenALCreationTest();
oalCreationTest.execute(args);
}
}

View File

@ -1,154 +0,0 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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 org.lwjgl.openal.AL;
import java.nio.IntBuffer;
/**
* $Id$
*
* This is a basic play test
* Yes, over zealous use of getError ;)
*
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public class PlayTest extends BasicTest {
/**
* Creates an instance of PlayTest
*/
public PlayTest() {
super();
}
/**
* Runs the actual test, using supplied arguments
*/
protected void execute(String[] args) {
if(args.length < 1) {
System.out.println("no argument supplied, assuming Footsteps.wav");
args = new String[] {"Footsteps.wav"};
}
int lastError;
//create 1 buffer and 1 source
IntBuffer buffers = createIntBuffer(1);
IntBuffer sources = createIntBuffer(1);
// al generate buffers and sources
buffers.position(0).limit(1);
AL.alGenBuffers(buffers);
if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) {
exit(lastError);
}
sources.position(0).limit(1);
AL.alGenSources(sources);
if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) {
exit(lastError);
}
//load wave data
WaveData wavefile = WaveData.create(args[0]);
//copy to buffers
AL.alBufferData(buffers.get(0), wavefile.format, wavefile.data, wavefile.data.capacity(), wavefile.samplerate);
if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) {
exit(lastError);
}
//unload file again
wavefile.dispose();
//set up source input
AL.alSourcei(sources.get(0), AL.AL_BUFFER, buffers.get(0));
if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) {
exit(lastError);
}
//lets loop the sound
AL.alSourcei(sources.get(0), AL.AL_LOOPING, AL.AL_TRUE);
if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) {
exit(lastError);
}
//play source 0
AL.alSourcePlay(sources.get(0));
if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) {
exit(lastError);
}
//wait 5 secs
try {
System.out.println("Waiting 5 seconds for sound to complete");
Thread.sleep(5000);
} catch (InterruptedException inte) {
}
//stop source 0
AL.alSourceStop(sources.get(0));
if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) {
exit(lastError);
}
//delete buffers and sources
sources.position(0).limit(1);
AL.alDeleteSources(sources);
if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) {
exit(lastError);
}
buffers.position(0).limit(1);
AL.alDeleteBuffers(buffers);
if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) {
exit(lastError);
}
//no errorchecking from now on, since our context is gone.
//shutdown
alExit();
}
/**
* main entry point
*
* @param args String array containing arguments
*/
public static void main(String[] args) {
PlayTest playTest = new PlayTest();
playTest.execute(args);
}
}

View File

@ -1,200 +0,0 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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 org.lwjgl.openal.AL;
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.IntBuffer;
/**
* $Id$
*
* This is a basic play test
* Yes, over zealous use of getError ;)
*
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public class PlayTestMemory extends BasicTest {
/**
* Creates an instance of PlayTestMemory
*/
public PlayTestMemory() {
super();
}
/**
* Runs the actual test, using supplied arguments
*/
protected void execute(String[] args) {
if(args.length < 1) {
System.out.println("no argument supplied, assuming Footsteps.wav");
args = new String[] {"Footsteps.wav"};
}
int lastError;
//create 1 buffer and 1 source
IntBuffer buffers = createIntBuffer(1);
IntBuffer sources = createIntBuffer(1);
// al generate buffers and sources
buffers.position(0).limit(1);
AL.alGenBuffers(buffers);
if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) {
exit(lastError);
}
sources.position(0).limit(1);
AL.alGenSources(sources);
if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) {
exit(lastError);
}
//load wave data
ByteBuffer filebuffer = getData(args[0]);
if(filebuffer == null) {
System.out.println("Error loading file: " + args[0]);
System.exit(-1);
}
//ALUTLoadWAVData file = alut.loadWAVMemory(Sys.getDirectBufferAddress(filebuffer));
WaveData wavefile = WaveData.create(filebuffer.array());
//copy to buffers
AL.alBufferData(buffers.get(0), wavefile.format, wavefile.data, wavefile.data.capacity(), wavefile.samplerate);
if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) {
exit(lastError);
}
//unload file again
wavefile.dispose();
//set up source input
AL.alSourcei(sources.get(0), AL.AL_BUFFER, buffers.get(0));
if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) {
exit(lastError);
}
//lets loop the sound
AL.alSourcei(sources.get(0), AL.AL_LOOPING, AL.AL_TRUE);
if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) {
exit(lastError);
}
//play source 0
AL.alSourcePlay(sources.get(0));
if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) {
exit(lastError);
}
//wait 5 secs
try {
System.out.println("Waiting 5 seconds for sound to complete");
Thread.sleep(5000);
} catch (InterruptedException inte) {
}
//stop source 0
AL.alSourceStop(sources.get(0));
if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) {
exit(lastError);
}
//delete buffers and sources
sources.position(0).limit(1);
AL.alDeleteSources(sources);
if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) {
exit(lastError);
}
buffers.position(0).limit(1);
AL.alDeleteBuffers(buffers);
if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) {
exit(lastError);
}
//no errorchecking from now on, since our context is gone.
alExit();
}
/**
* Reads the file into a ByteBuffer
*
* @param filename Name of file to load
* @return ByteBuffer containing file data
*/
protected ByteBuffer getData(String filename) {
ByteBuffer buffer = null;
System.out.println("Attempting to load: " + filename);
try {
BufferedInputStream bis = new BufferedInputStream(WaveData.class.getClassLoader().getResourceAsStream(filename));
ByteArrayOutputStream baos = new ByteArrayOutputStream();
int bufferLength = 4096;
byte[] readBuffer = new byte[bufferLength];
int read = -1;
while((read = bis.read(readBuffer, 0, bufferLength)) != -1) {
baos.write(readBuffer, 0, read);
}
//done reading, close
bis.close();
buffer = ByteBuffer.allocate(baos.size());
buffer.order(ByteOrder.nativeOrder());
buffer.put(baos.toByteArray());
} catch (Exception ioe) {
ioe.printStackTrace();
}
return buffer;
}
/**
* main entry point
*
* @param args String array containing arguments
*/
public static void main(String[] args) {
PlayTestMemory playTestMemory = new PlayTestMemory();
playTestMemory.execute(args);
}
}

View File

@ -1,162 +0,0 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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 org.lwjgl.openal.AL;
import org.lwjgl.openal.OpenALException;
import java.nio.IntBuffer;
/**
* $Id$
*
* Simple test for testing the number of available sources
*
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public class SourceLimitTest extends BasicTest {
/** Sources to create */
protected int sourcesToCreate = 64;
/**
* Creates an instance of SourceLimitTest
*/
public SourceLimitTest() {
super();
}
/**
* Runs the actual test, using supplied arguments
*/
protected void execute(String[] args) {
//parse 1st arg to sourcecount
if (args.length > 0) {
try {
sourcesToCreate = Integer.parseInt(args[0]);
} catch (NumberFormatException nfe) {
System.out.println(
"Unable to parse parameter to integer. Defaulting to 64 sources.");
}
}
System.out.print("Creating " + sourcesToCreate + " in one go...");
try {
CreateAllSources();
} catch(OpenALException oale) {
}
System.out.print("Creating " + sourcesToCreate + " one at a time...");
try {
CreateSourcesStep();
} catch(Exception e) {
}
//shutdown
alExit();
}
/**
* Tests the creation of n sources in on go
*/
protected void CreateAllSources() {
int lastError;
//make bytbuffer that can hold sourcesToCreate sources
IntBuffer sources = createIntBuffer(sourcesToCreate);
//Create sourcesToCreate sources in one fell swoop
sources.position(0).limit(sourcesToCreate);
AL.alGenSources(sources);
if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) {
System.out.println("failed to create " + sourcesToCreate + " sources (" + AL.alGetString(lastError) + ")");
return;
}
//delete sources
sources.position(0).limit(sourcesToCreate);
AL.alDeleteSources(sources);
System.out.println("created " + sourcesToCreate + " sources successfully!");
}
/**
* Tests if n sources can be created one at a time
*/
protected void CreateSourcesStep() {
int lastError;
int sourcesCreated = 0;
//make bytbuffer that can hold sourcesToCreate sources
IntBuffer[] sources = new IntBuffer[sourcesToCreate];
//create the sources
for (int i = 0; i <= sourcesToCreate; i++) {
sources[i] = createIntBuffer(1);
sources[i].position(0).limit(1);
AL.alGenSources(sources[i]);
if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) {
System.out.println("failed to create source: " + (i + 1));
break;
}
sourcesCreated++;
}
//delete allocated sources
for (int i = 0; i < sourcesCreated; i++) {
//delete buffers and sources
sources[i].position(0).limit(1);
AL.alDeleteSources(sources[i]);
if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) {
System.out.println("failed to delete source: " + i + "(" + AL.alGetString(lastError) + ")");
break;
}
}
if(sourcesCreated != sourcesToCreate) {
System.out.println("created " + sourcesCreated + " sources before failing");
} else {
System.out.println("created " + sourcesCreated + " sources successfully!");
}
}
/**
* main entry point
*
* @param args String array containing arguments
*/
public static void main(String[] args) {
SourceLimitTest sourceLimitTest = new SourceLimitTest();
sourceLimitTest.execute(args);
}
}

View File

@ -1,219 +0,0 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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 org.lwjgl.openal.AL;
import java.nio.IntBuffer;
/**
* $Id$
*
* Simple test for stresstesting OpenAL playing random samples ad nausea
*
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public class StressTest extends BasicTest {
/** Buffer containing sources */
private IntBuffer sources;
/** Buffer containing buffers */
private IntBuffer buffers;
/**
* Creates an instance of StressTest
*/
public StressTest() {
super();
}
/**
* Runs the actual test, using supplied arguments
*/
protected void execute(String[] args) {
createSources();
createBuffers();
try {
loadSamples();
runTest();
} catch (Exception e) {
e.printStackTrace();
}
alExit();
}
private void createSources() {
sources = createIntBuffer(4);
sources.position(0).limit(4);
AL.alGenSources(sources);
if (AL.alGetError() != AL.AL_NO_ERROR) {
System.out.println("Unable to create 4 sources");
alExit();
}
}
private void createBuffers() {
buffers = createIntBuffer(10);
buffers.position(0).limit(10);
AL.alGenBuffers(buffers);
if (AL.alGetError() != AL.AL_NO_ERROR) {
System.out.println("Unable to create 10 buffers");
sources.position(0).limit(4);
AL.alDeleteSources(sources);
alExit();
}
}
private void loadSamples() throws Exception {
AL.alGetError();
WaveData data = WaveData.create("ding.wav");
for (int i = 1; i <= 10; i++) {
AL.alBufferData(
buffers.get(i - 1),
data.format,
data.data,
data.data.capacity(),
data.samplerate);
if (AL.alGetError() != AL.AL_NO_ERROR) {
System.out.println("Failed to load " + i + ".wav into buffer");
sources.position(0).limit(4);
AL.alDeleteSources(sources);
buffers.position(0).limit(10);
AL.alDeleteBuffers(buffers);
alExit();
}
}
data.dispose();
}
public void runTest() {
int iterations = 0;
int randomBuffer;
int startSlot = 1;
int nextSlot = startSlot;
long startTime = System.currentTimeMillis();
//mark background source as looping
AL.alSourcei(sources.get(0), AL.AL_LOOPING, AL.AL_TRUE);
//play background
AL.alSourcei(sources.get(0), AL.AL_BUFFER, buffers.get(0));
AL.alSourcePlay(sources.get(0));
while (System.currentTimeMillis() - startTime < (2000)) {
randomBuffer = getRandomBuffer();
System.out.println("random:" + randomBuffer);
//stop source at slot
AL.alSourceStop(sources.get(nextSlot));
if (AL.alGetError() != AL.AL_NO_ERROR) {
System.out.println("Error stopping source.");
}
System.out.println("Stopped source: " + nextSlot);
//link source<->buffer
AL.alSourcei(sources.get(nextSlot), AL.AL_BUFFER, buffers.get(randomBuffer));
if (AL.alGetError() != AL.AL_NO_ERROR) {
System.out.println("Error linking buffer and source.");
}
System.out.println("linked source " + nextSlot + " with buffer " + randomBuffer);
//start playing
System.out.println("playing source " + nextSlot);
AL.alSourcePlay(sources.get(nextSlot++));
if (nextSlot == 4) {
nextSlot = startSlot;
}
//pause
try {
Thread.sleep(500);
} catch (InterruptedException inte) {
}
//debug info
if ((++iterations % 10) == 0) {
System.out.println("========================");
System.out.println("MaxMemory: " + Runtime.getRuntime().maxMemory() / 1024);
System.out.println("FreeMemory: " + Runtime.getRuntime().freeMemory() / 1024);
System.out.println("TotalMemory: " + Runtime.getRuntime().totalMemory() / 1024);
System.out.println("========================");
}
}
//stop all sources
for (int i = 0; i < 4; i++) {
AL.alSourceStop(sources.get(i));
System.out.println("Stopping source " + (i+1));
}
//test done - ask for user input
try {
System.out.println("Test completed");
System.out.println("========================");
System.out.println("MaxMemory: " + Runtime.getRuntime().maxMemory() / 1024);
System.out.println("FreeMemory: " + Runtime.getRuntime().freeMemory() / 1024);
System.out.println("TotalMemory: " + Runtime.getRuntime().totalMemory() / 1024);
System.out.println("========================");
System.in.read();
} catch (Exception e) {
}
sources.position(0).limit(4);
AL.alDeleteSources(sources);
buffers.position(0).limit(10);
AL.alDeleteBuffers(buffers);
}
private int getRandomBuffer() {
return (int) (Math.random() * 10.0);
}
/**
* main entry point
*
* @param args String array containing arguments
*/
public static void main(String[] args) {
StressTest stressTest = new StressTest();
stressTest.execute(args);
}
}

View File

@ -1,183 +0,0 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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 org.lwjgl.openal.AL;
import java.nio.ByteBuffer;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.*;
import java.io.BufferedInputStream;
import java.io.ByteArrayInputStream;
import java.io.IOException;
/**
* $Id$
*
* Utitlity class for loading wavefiles.
*
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public class WaveData {
/** actual wave data */
public final ByteBuffer data;
/** format type of data */
public final int format;
/** sample rate of data */
public final int samplerate;
/**
* Creates a new WaveData
*
* @param data actual wavedata
* @param format format of wave data
* @param samplerate sample rate of data
*/
private WaveData(ByteBuffer data, int format, int samplerate) {
this.data = data;
this.format = format;
this.samplerate = samplerate;
}
/**
* Disposes the wavedata
*/
public void dispose() {
data.clear();
}
/**
* Creates a WaveData container from the specified filename
*
* @param filepath path to file (relative, and in classpath)
* @return WaveData containing data, or null if a failure occured
*/
public static WaveData create(String filepath) {
try {
return create(
AudioSystem.getAudioInputStream(
new BufferedInputStream(WaveData.class.getClassLoader().getResourceAsStream(filepath))));
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/**
* Creates a WaveData container from the specified bytes
*
* @param buffer array of bytes containing the complete wave file
* @return WaveData containing data, or null if a failure occured
*/
public static WaveData create(byte[] buffer) {
try {
return create(
AudioSystem.getAudioInputStream(
new BufferedInputStream(new ByteArrayInputStream(buffer))));
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/**
* Creates a WaveData container from the specified stream
*
* @param ais AudioInputStream to read from
* @return WaveData containing data, or null if a failure occured
*/
public static WaveData create(AudioInputStream ais) {
//get format of data
AudioFormat audioformat = ais.getFormat();
// get channels
int channels = 0;
if (audioformat.getChannels() == 1) {
if (audioformat.getSampleSizeInBits() == 8) {
channels = AL.AL_FORMAT_MONO8;
} else if (audioformat.getSampleSizeInBits() == 16) {
channels = AL.AL_FORMAT_MONO16;
} else {
assert false : "Illegal sample size";
}
} else if (audioformat.getChannels() == 2) {
if (audioformat.getSampleSizeInBits() == 8) {
channels = AL.AL_FORMAT_STEREO8;
} else if (audioformat.getSampleSizeInBits() == 16) {
channels = AL.AL_FORMAT_STEREO16;
} else {
assert false : "Illegal sample size";
}
} else {
assert false : "Only mono or stereo is supported";
}
//read data into buffer
byte[] buf =
new byte[audioformat.getChannels()
* (int) ais.getFrameLength()
* audioformat.getSampleSizeInBits()
/ 8];
int read = 0, total = 0;
try {
while ((read = ais.read(buf, total, buf.length - total)) != -1
&& total < buf.length) {
total += read;
}
} catch (IOException ioe) {
return null;
}
//insert data into bytebuffer
ByteBuffer buffer = ByteBuffer.allocateDirect(buf.length);
buffer.put(buf);
buffer.rewind();
//create our result
WaveData wavedata =
new WaveData(buffer, channels, (int) audioformat.getSampleRate());
//close stream
try {
ais.close();
} catch (IOException ioe) {
}
return wavedata;
}
}

View File

@ -1,335 +0,0 @@
/*
* Copyright (c) 2003 Lightweight Java Game Library 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 'Lightweight Java Game Library' 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.opengl;
import org.lwjgl.*;
import org.lwjgl.input.*;
import org.lwjgl.opengl.*;
import org.lwjgl.vector.Vector2f;
/**
* $Id$
*
* Tests switching between windowed and fullscreen
*
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
*/
public class FullScreenWindowedTest {
/** Intended deiplay mode */
private DisplayMode mode;
/** GLU instance */
private GLU glu;
/** our quad moving around */
private Vector2f quadPosition;
/** our quadVelocity */
private Vector2f quadVelocity;
/** angle of quad */
private float angle;
/** degrees to rotate per frame */
private float angleRotation = 1.0f;
/** Max speed of all changable attributes */
private static final float MAX_SPEED = 20.0f;
/**
* Creates a FullScreenWindowedTest
*/
public FullScreenWindowedTest() {
}
/**
* Executes the test
*/
public void execute() {
initialize();
mainLoop();
cleanup();
}
/**
* Initializes the test
*/
private void initialize() {
try {
//find displaymode
mode = findDisplayMode(800, 600, 16);
// start of in windowed mode
Window.create("Test", 50, 50, mode.width, mode.height, mode.bpp, 0, 0, 0);
glInit();
Keyboard.create();
quadPosition = new Vector2f(100f, 100f);
quadVelocity = new Vector2f(1.0f, 1.0f);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* Runs the main loop of the "test"
*/
private void mainLoop() {
while (!Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)
&& !Window.isCloseRequested()) {
// allow subsystem to get a chance to run too
Window.update();
if (!Window.isMinimized()) {
// check keyboard input
processKeyboard();
// do "game" logic, and render it
logic();
render();
// paint window
Window.paint();
} else {
// no need to render/paint if nothing has changed (ie. window dragged over)
if (Window.isDirty()) {
render();
Window.paint();
}
// don't waste cpu time, sleep more
try {
Thread.sleep(100);
} catch (InterruptedException inte) {
}
}
}
}
/**
* Performs the logic
*/
private void logic() {
angle += angleRotation;
if (angle > 90.0f) {
angle = 0.0f;
}
quadPosition.x += quadVelocity.x;
quadPosition.y += quadVelocity.y;
//check colision with vertical border border
if (quadPosition.x + 50 >= mode.width || quadPosition.x - 50 <= 0) {
quadVelocity.x *= -1;
}
//check collision with horizontal border
if (quadPosition.y + 50 >= mode.height || quadPosition.y - 50 <= 0) {
quadVelocity.y *= -1;
}
}
private void render() {
//clear background
GL.glClear(GL.GL_COLOR_BUFFER_BIT);
// draw white quad
GL.glPushMatrix();
{
GL.glTranslatef(quadPosition.x, quadPosition.y, 0);
GL.glRotatef(angle, 0.0f, 0.0f, 1.0f);
GL.glColor3f(1.0f, 1.0f, 1.0f);
GL.glBegin(GL.GL_QUADS);
{
GL.glVertex2i(-50, -50);
GL.glVertex2i(50, -50);
GL.glVertex2i(50, 50);
GL.glVertex2i(-50, 50);
}
GL.glEnd();
}
GL.glPopMatrix();
}
/**
* Processes keyboard input
*/
private void processKeyboard() {
Keyboard.poll();
//check for fullscreen key
if (Keyboard.isKeyDown(Keyboard.KEY_F)) {
try {
Keyboard.destroy();
Window.destroy();
Display.setDisplayMode(mode);
Window.create("Test", mode.bpp, 0, 0, 0);
glInit();
Keyboard.create();
} catch (Exception e) {
e.printStackTrace();
}
}
//check for window key
if (Keyboard.isKeyDown(Keyboard.KEY_W)) {
try {
Keyboard.destroy();
Window.destroy();
Display.resetDisplayMode();
Window.create("Test", 50, 50, mode.width, mode.height, mode.bpp, 0, 0, 0);
glInit();
Keyboard.create();
} catch (Exception e) {
e.printStackTrace();
}
}
//check for speed changes
if (Keyboard.isKeyDown(Keyboard.KEY_UP)) {
quadVelocity.y += 0.1f;
}
if (Keyboard.isKeyDown(Keyboard.KEY_DOWN)) {
quadVelocity.y -= 0.1f;
}
if (Keyboard.isKeyDown(Keyboard.KEY_RIGHT)) {
quadVelocity.x += 0.1f;
}
if (Keyboard.isKeyDown(Keyboard.KEY_LEFT)) {
quadVelocity.x -= 0.1f;
}
if (Keyboard.isKeyDown(Keyboard.KEY_ADD)) {
angleRotation += 0.1f;
}
if (Keyboard.isKeyDown(Keyboard.KEY_SUBTRACT)) {
angleRotation -= 0.1f;
}
//throttle
if (quadVelocity.x < -MAX_SPEED) {
quadVelocity.x = -MAX_SPEED;
}
if (quadVelocity.x > MAX_SPEED) {
quadVelocity.x = MAX_SPEED;
}
if (quadVelocity.y < -MAX_SPEED) {
quadVelocity.y = -MAX_SPEED;
}
if (quadVelocity.y > MAX_SPEED) {
quadVelocity.y = MAX_SPEED;
}
if (angleRotation < 0.0f) {
angleRotation = 0.0f;
}
if (angleRotation > MAX_SPEED) {
angleRotation = MAX_SPEED;
}
}
/**
* Cleans up the test
*/
private void cleanup() {
Keyboard.destroy();
Window.destroy();
}
/**
* Retrieves a displaymode, if one such is available
*
* @param width Required width
* @param height Required height
* @param bpp Minimum required bits per pixel
* @return
*/
private DisplayMode findDisplayMode(int width, int height, int bpp) {
DisplayMode[] modes = Display.getAvailableDisplayModes();
for (int i = 0; i < modes.length; i++) {
if (modes[i].width == width
&& modes[i].height == height
&& modes[i].bpp >= bpp) {
return modes[i];
}
}
return null;
}
/**
* Initializes OGL
*/
private void glInit() {
// Go into orthographic projection mode.
GL.glMatrixMode(GL.GL_PROJECTION);
GL.glLoadIdentity();
GLU.gluOrtho2D(0, mode.width, 0, mode.height);
GL.glMatrixMode(GL.GL_MODELVIEW);
GL.glLoadIdentity();
GL.glViewport(0, 0, mode.width, mode.height);
//set clear color to black
GL.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
//sync frame (only works on windows)
GLCaps.determineAvailableExtensions();
if (GLCaps.WGL_EXT_swap_control) {
GL.wglSwapIntervalEXT(1);
}
}
/**
* Test entry point
*/
public static void main(String[] args) {
System.out.println(
"Change between fullscreen and windowed mode, by pressing F and W respectively");
System.out.println(
"Move quad using arrowkeys, and change rotation using +/-");
FullScreenWindowedTest fswTest = new FullScreenWindowedTest();
fswTest.execute();
}
}

View File

@ -1,202 +0,0 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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$
*
* Simple java test program.
*
* @author elias_naur <elias_naur@users.sourceforge.net>
* @version $Revision$
*/
package org.lwjgl.test.opengl;
import org.lwjgl.*;
import org.lwjgl.opengl.*;
import org.lwjgl.input.*;
import java.nio.*;
public final class Game {
static {
try {
//find first display mode that allows us 640*480*16
int mode = -1;
DisplayMode[] modes = Display.getAvailableDisplayModes();
for (int i = 0; i < modes.length; i++) {
if (modes[i].width == 640
&& modes[i].height == 480
&& modes[i].bpp >= 16) {
mode = i;
break;
}
}
if (mode != -1) {
//select above found displaymode
System.out.println("Setting display mode to "+modes[mode]);
Display.setDisplayMode(modes[mode]);
System.out.println("Created display.");
}
} catch (Exception e) {
System.err.println("Failed to create display due to " + e);
}
}
static {
try {
Window.create("LWJGL Game Example", 16, 0, 0,0);
System.out.println("Created OpenGL.");
} catch (Exception e) {
System.err.println("Failed to create OpenGL due to "+e);
System.exit(1);
}
}
/** Is the game finished? */
private static boolean finished;
/** A rotating square! */
private static float angle;
/**
* No construction allowed
*/
private Game() {
}
public static void main(String[] arguments) {
try {
init();
while (!finished) {
Window.update();
if (Window.isMinimized())
Thread.sleep(200);
else if (Window.isCloseRequested())
System.exit(0);
Keyboard.poll();
mainLoop();
render();
Window.paint();
}
} catch (Throwable t) {
t.printStackTrace();
} finally {
cleanup();
}
}
/**
* All calculations are done in here
*/
private static void mainLoop() {
angle += 1f;
if (angle > 360.0f)
angle = 0.0f;
Mouse.poll();
if (Mouse.dx != 0 || Mouse.dy != 0 || Mouse.dwheel != 0)
System.out.println("Mouse moved " + Mouse.dx + " " + Mouse.dy + " " + Mouse.dwheel);
for (int i = 0; i < Mouse.buttonCount; i++)
if (Mouse.isButtonDown(i))
System.out.println("Button " + i + " down");
/* Keyboard.poll();
if (Keyboard.isKeyDown(Keyboard.KEY_ESCAPE))
finished = true;*/
Keyboard.read();
for (int i = 0; i < Keyboard.getNumKeyboardEvents(); i++) {
Keyboard.next();
if (Keyboard.key == Keyboard.KEY_ESCAPE && Keyboard.state)
finished = true;
if (Keyboard.key == Keyboard.KEY_T && Keyboard.state)
System.out.println("Current time: " + Sys.getTime());
}
}
/**
* All rendering is done in here
*/
private static void render() {
GL.glClear(GL.GL_COLOR_BUFFER_BIT);
GL.glPushMatrix();
GL.glTranslatef(Display.getWidth() / 2, Display.getHeight() / 2, 0.0f);
GL.glRotatef(angle, 0, 0, 1.0f);
GL.glBegin(GL.GL_QUADS);
GL.glVertex2i(-50, -50);
GL.glVertex2i(50, -50);
GL.glVertex2i(50, 50);
GL.glVertex2i(-50, 50);
GL.glEnd();
GL.glPopMatrix();
}
/**
* Initialize
*/
private static void init() throws Exception {
Keyboard.create();
Keyboard.enableBuffer();
Mouse.create();
Sys.setTime(0);
Sys.setProcessPriority(Sys.HIGH_PRIORITY);
System.out.println("Timer resolution: " + Sys.getTimerResolution());
// Go into orthographic projection mode.
GL.glMatrixMode(GL.GL_PROJECTION);
GL.glLoadIdentity();
GLU.gluOrtho2D(0, Display.getWidth(), 0, Display.getHeight());
GL.glMatrixMode(GL.GL_MODELVIEW);
GL.glLoadIdentity();
GL.glViewport(0, 0, Display.getWidth(), Display.getHeight());
ByteBuffer num_tex_units_buf = ByteBuffer.allocateDirect(4);
num_tex_units_buf.order(ByteOrder.nativeOrder());
GL.glGetInteger(GL.GL_MAX_TEXTURE_UNITS_ARB, num_tex_units_buf.asIntBuffer());
System.out.println("Number of texture units: " + num_tex_units_buf.getInt());
// Fix the refresh rate to the display frequency.
// GL.wglSwapIntervalEXT(1);
}
/**
* Cleanup
*/
private static void cleanup() {
Keyboard.destroy();
Mouse.destroy();
Window.destroy();
try {
Display.resetDisplayMode();
} catch (Exception e) {
e.printStackTrace();
}
}
}

View File

@ -1,466 +0,0 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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$
*
* Simple java test program.
*
* @author elias_naur <elias_naur@users.sourceforge.net>
* @version $Revision$
*/
package org.lwjgl.test.opengl;
import org.lwjgl.input.*;
import org.lwjgl.opengl.*;
import org.lwjgl.*;
import java.io.*;
import java.nio.*;
import java.util.*;
public class Grass {
static class Aslod {
float angle;
float value;
float ripple;
float count;
}
private static boolean finished = false;
private static Random rand = new Random();
static {
try {
int mode = -1;
DisplayMode[] modes = Display.getAvailableDisplayModes();
for (int i = 0; i < modes.length; i++) {
if (modes[i].width == 640
&& modes[i].height == 480
&& modes[i].bpp >= 16) {
mode = i;
break;
}
}
if (mode == -1) {
System.out.println("did not find suitable mode");
} else {
System.out.println("Display mode: " + modes[mode]);
}
// For now let's just pick a mode we're certain to have
Display.setDisplayMode(modes[mode]);
System.out.println("Created display.");
} catch (Exception e) {
e.printStackTrace();
System.exit(1);
}
}
static {
try {
Window.create("LWJGL Grass", 50, 50, 640, 480, 16, 0, 0,0);
Keyboard.create();
Keyboard.enableBuffer();
Mouse.create();
System.out.println("Created OpenGL.");
} catch (Exception e) {
System.err.println("Failed to create OpenGL due to " + e);
System.exit(1);
}
}
private static Aslod aslod = new Aslod();
private static int mesh;
private static int program_handle;
private static byte[] loadFile(String file) {
int next;
java.util.Vector bytes = new java.util.Vector();
try {
ClassLoader loader = Grass.class.getClassLoader();
InputStream stream = new BufferedInputStream(loader.getResourceAsStream(file));
while ((next = (stream.read())) != -1)
bytes.add(new Byte((byte) next));
stream.close();
byte[] result = new byte[bytes.size()];
for (int i = 0; i < result.length; i++)
result[i] = ((Byte) bytes.get(i)).byteValue();
return result;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
public static void main(String[] args) {
ByteBuffer byte_buf = ByteBuffer.allocateDirect(4);
byte_buf.order(ByteOrder.nativeOrder());
GLCaps.determineAvailableExtensions();
System.out.println("Vertex program supported: " + GLCaps.GL_NV_vertex_program);
GL.glGenProgramsNV(byte_buf.asIntBuffer());
IntBuffer int_buf = byte_buf.asIntBuffer();
if (int_buf.get(0) == 0)
throw new RuntimeException("Could not allocate new vertex program id!");
program_handle = int_buf.get(0);
byte[] program = loadFile("cg_grass2.vp");
ByteBuffer program_buf = ByteBuffer.allocateDirect(program.length);
program_buf.order(ByteOrder.nativeOrder());
program_buf.rewind();
program_buf.put(program);
program_buf.rewind();
GL.glLoadProgramNV(
GL.GL_VERTEX_PROGRAM_NV,
program_handle,
program_buf);
/*GL.glGetInteger(GL.PROGRAM_ERROR_POSITION_NV, int_buf);
System.out.println("error position: " + int_buf.get(0));*/
genMesh();
float[] LightDiffuse = { 1.0f, 0.0f, 0.0f, 1.0f };
float[] LightPosition = { 1.0f, 1.0f, 1.0f, 0.0f };
ByteBuffer light_buf = ByteBuffer.allocateDirect(4 * 4);
light_buf.order(ByteOrder.nativeOrder());
FloatBuffer light_buf_f = light_buf.asFloatBuffer();
light_buf_f.rewind();
light_buf_f.put(LightDiffuse);
GL.glLightfv(
GL.GL_LIGHT0,
GL.GL_DIFFUSE,
light_buf_f);
light_buf_f.rewind();
light_buf_f.put(LightPosition);
GL.glLightfv(
GL.GL_LIGHT0,
GL.GL_POSITION,
light_buf_f);
GL.glEnable(GL.GL_LIGHT0);
GL.glEnable(GL.GL_LIGHTING);
GL.glEnable(GL.GL_DEPTH_TEST);
GL.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);
GL.glEnable(GL.GL_BLEND);
GL.glMatrixMode(GL.GL_PROJECTION);
GLU.gluPerspective(40.0, 1.0, 1.0, 50.0);
GL.glMatrixMode(GL.GL_MODELVIEW);
GLU.gluLookAt(14.0, 10.0, -16.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
aslod.angle = 2.6179935f;
aslod.value = 0.2f;
aslod.ripple = 0.0f;
aslod.count = 0.0f;
while (!finished) {
keyPoll();
float degree = (1.0f + (aslod.value * 20.0f)) * 0.01745329f;
degree *= (0.5 + myrand());
ptrAnimate(degree);
GL.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
//ptrDraw();
grsDraw();
Window.paint();
}
Mouse.destroy();
Keyboard.destroy();
Window.destroy();
}
private static float myrand() {
// returns a value between 0 and 1
return rand.nextFloat();
}
private static void genGrass(
float fFaceHeight,
float fFaceWidth,
float fX,
float fZ) {
int cFaces;
int numFaces;
float cWidth;
float fDecWidth, frndWidth, frndHeight;
float fRotate;
float fRigid;
numFaces = 5;
frndHeight =
fFaceHeight
+ ((fFaceHeight / 1.5f)
* (float) java.lang.Math.cos(
java.lang.Math.abs(rand.nextInt())));
frndWidth =
fFaceWidth
+ ((fFaceWidth / 4.0f)
* (float) java.lang.Math.cos(
java.lang.Math.abs(rand.nextInt())));
fDecWidth = frndWidth / 5.0f;
fRotate = myrand() * 3.1415f;
fRigid = ((fRigid = myrand()) < 0.2f) ? 0.2f : fRigid;
if (myrand() < 0.3)
GL.glBegin(GL.GL_LINE_STRIP);
else
GL.glBegin(GL.GL_QUAD_STRIP);
for (cFaces = 0; cFaces < numFaces; cFaces++) {
for (cWidth = frndWidth;
cWidth >= -frndWidth;
cWidth -= (frndWidth * 2.0f)) {
GL.glColor4f(fX, fRigid, fZ, (float) cFaces / (float) numFaces);
GL.glVertex3f(
(float) (((cFaces - 2) * 0.1f)
* java.lang.Math.cos(fRotate)
+ (cWidth) * java.lang.Math.sin(fRotate)),
cFaces * frndHeight,
- (float)
(((cFaces - 2) * 0.1f) * java.lang.Math.sin(fRotate)
+ (cWidth) * java.lang.Math.cos(fRotate)));
}
frndWidth -= fDecWidth;
}
GL.glEnd();
}
private static void genMesh() {
float cI, cJ, fArea;
fArea = 20.0f;
mesh = GL.glGenLists(1);
GL.glNewList(mesh, GL.GL_COMPILE);
for (cI = -fArea / 2; cI < fArea / 2; cI += 0.25f) {
for (cJ = -fArea / 2; cJ < fArea / 2; cJ += 0.25f) {
genGrass(0.5f, 0.1f, cI, cJ);
}
}
GL.glEndList();
}
private static void grsDraw() {
GL.glEnable(GL.GL_VERTEX_PROGRAM_NV);
GL.glBindProgramNV(GL.GL_VERTEX_PROGRAM_NV, program_handle);
GL.glTrackMatrixNV(
GL.GL_VERTEX_PROGRAM_NV,
0,
GL.GL_MODELVIEW_PROJECTION_NV,
GL.GL_IDENTITY_NV);
GL.glProgramParameter4fNV(
GL.GL_VERTEX_PROGRAM_NV,
4,
0.0f,
0.0f,
0.0f,
0.0f);
GL.glProgramParameter4fNV(
GL.GL_VERTEX_PROGRAM_NV,
5,
0.0f,
0.0f,
0.0f,
0.0f);
GL.glProgramParameter4fNV(
GL.GL_VERTEX_PROGRAM_NV,
6,
1.763609f,
0.496495f,
0.0f,
0.0f);
GL.glProgramParameter4fNV(
GL.GL_VERTEX_PROGRAM_NV,
7,
-0.943599f,
3.203737f,
0.0f,
0.0f);
GL.glProgramParameter4fNV(
GL.GL_VERTEX_PROGRAM_NV,
8,
4.101107f,
0.943413f,
0.0f,
0.0f);
GL.glProgramParameter4fNV(
GL.GL_VERTEX_PROGRAM_NV,
9,
-1.218603f,
6.259399f,
0.0f,
0.0f);
GL.glProgramParameter4fNV(
GL.GL_VERTEX_PROGRAM_NV,
10,
7.214299f,
1.352961f,
0.0f,
0.0f);
GL.glProgramParameter4fNV(
GL.GL_VERTEX_PROGRAM_NV,
11,
-1.540748f,
10.080958f,
0.0f,
0.0f);
GL.glProgramParameter4fNV(
GL.GL_VERTEX_PROGRAM_NV,
12,
10.880035f,
1.759046f,
0.0f,
0.0f);
GL.glProgramParameter4fNV(
GL.GL_VERTEX_PROGRAM_NV,
13,
-1.852705f,
14.468674f,
0.0f,
0.0f);
GL.glProgramParameter4fNV(
GL.GL_VERTEX_PROGRAM_NV,
14,
14.292879f,
1.973329f,
0.0f,
0.0f);
GL.glProgramParameter4fNV(
GL.GL_VERTEX_PROGRAM_NV,
15,
-1.973387f,
18.506531f,
0.0f,
0.0f);
GL.glProgramParameter4fNV(
GL.GL_VERTEX_PROGRAM_NV,
16,
(float) (java.lang.Math.sin(aslod.angle)
* (aslod.value + aslod.ripple)),
0.0f,
(float) (java.lang.Math.cos(aslod.angle)
* (aslod.value + aslod.ripple)),
0.0f);
GL.glProgramParameter4fNV(GL.GL_VERTEX_PROGRAM_NV, 17, 1.7f, 5f, 2f, 0f);
GL.glProgramParameter4fNV(
GL.GL_VERTEX_PROGRAM_NV,
18,
-0.0187293f,
0.074261f,
0.2121144f,
1.570729f);
GL.glProgramParameter4fNV(GL.GL_VERTEX_PROGRAM_NV, 20, 0f, 0.5f, 1f, 0f);
GL.glProgramParameter4fNV(
GL.GL_VERTEX_PROGRAM_NV,
21,
0.25f,
-9f,
0.75f,
0.1591549f);
GL.glProgramParameter4fNV(
GL.GL_VERTEX_PROGRAM_NV,
22,
24.9808f,
-24.9808f,
-60.14581f,
60.14581f);
GL.glProgramParameter4fNV(
GL.GL_VERTEX_PROGRAM_NV,
23,
85.45379f,
-85.45379f,
-64.93935f,
64.93935f);
GL.glProgramParameter4fNV(
GL.GL_VERTEX_PROGRAM_NV,
24,
19.73921f,
-19.73921f,
-1f,
1f);
GL.glProgramParameter4fNV(GL.GL_VERTEX_PROGRAM_NV, 25, 0f, 4f, 0f, 0f);
GL.glProgramParameter4fNV(
GL.GL_VERTEX_PROGRAM_NV,
19,
1f,
3.141593f,
0.5f,
1f);
GL.glProgramParameter4fNV(GL.GL_VERTEX_PROGRAM_NV, 26, 0.7f, 0.4f, 0f, 0f);
GL.glCallList(mesh);
GL.glDisable(GL.GL_VERTEX_PROGRAM_NV);
}
private static void ptrAnimate(float degree) {
aslod.count += degree;
aslod.ripple = (float) (java.lang.Math.cos(aslod.count) / 80.0);
}
private static void keyPoll() {
Keyboard.read();
for (int i = 0; i < Keyboard.getNumKeyboardEvents(); i++) {
Keyboard.next();
if (!Keyboard.state)
continue;
switch (Keyboard.key) {
case Keyboard.KEY_A :
aslod.angle += 0.1;
break;
case Keyboard.KEY_D :
aslod.angle -= 0.1;
break;
case Keyboard.KEY_W :
aslod.value += (aslod.value >= 0.15) ? 0.0 : 0.0025;
break;
case Keyboard.KEY_S :
aslod.value -= (aslod.value <= 0.005) ? 0.0 : 0.0025;
break;
case Keyboard.KEY_ESCAPE :
finished = true;
break;
}
}
}
}

View File

@ -1,417 +0,0 @@
/*
* Copyright (c) 2003 Lightweight Java Game Library 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 'Lightweight Java Game Library' 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.opengl;
import org.lwjgl.*;
import org.lwjgl.input.*;
import org.lwjgl.opengl.*;
import org.lwjgl.vector.Vector2f;
import java.nio.*;
/**
* $Id$
*
* Tests Pbuffers
*
* @author elias_naur <elias_naur@users.sourceforge.net>
* @version $Revision$
*/
public class PbufferTest {
/** Intended deiplay mode */
private DisplayMode mode;
/** GLU instance */
private GLU glu;
/** our quad moving around */
private Vector2f quadPosition;
/** our quadVelocity */
private Vector2f quadVelocity;
/** angle of quad */
private float angle;
/** degrees to rotate per frame */
private float angleRotation = 1.0f;
/** Max speed of all changable attributes */
private static final float MAX_SPEED = 20.0f;
/** Pbuffer instance */
private static Pbuffer pbuffer;
/** The shared texture */
private static int tex_handle;
/**
* Executes the test
*/
public void execute() {
initialize();
mainLoop();
cleanup();
}
/**
* Initializes the test
*/
private void initialize() {
try {
//find displaymode
mode = findDisplayMode(800, 600, 16);
// start of in windowed mode
Window.create("Test", 50, 50, mode.width, mode.height, mode.bpp, 0, 0, 0);
// gl = new GLWindow("Test", 50, 50, mode.width, mode.height, mode.bpp, 0, 0, 0);
if ((Pbuffer.getPbufferCaps() & Pbuffer.PBUFFER_SUPPORTED) == 0) {
System.out.println("No Pbuffer support!");
System.exit(1);
}
System.out.println("Pbuffer support detected");
glInit();
initPbuffer();
Keyboard.create();
quadPosition = new Vector2f(100f, 100f);
quadVelocity = new Vector2f(1.0f, 1.0f);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* Runs the main loop of the "test"
*/
private void mainLoop() {
while (!Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)
&& !Window.isCloseRequested()) {
// allow subsystem to get a chance to run too
Window.update();
if (!Window.isMinimized()) {
// check keyboard input
processKeyboard();
// do "game" logic, and render it
logic();
render();
// paint window
Window.paint();
} else {
// no need to render/paint if nothing has changed (ie. window dragged over)
if (Window.isDirty()) {
render();
Window.paint();
}
// don't waste cpu time, sleep more
try {
Thread.sleep(100);
} catch (InterruptedException inte) {
}
}
}
}
/**
* Performs the logic
*/
private void logic() {
angle += angleRotation;
if (angle > 90.0f) {
angle = 0.0f;
}
quadPosition.x += quadVelocity.x;
quadPosition.y += quadVelocity.y;
//check colision with vertical border border
if (quadPosition.x + 50 >= mode.width || quadPosition.x - 50 <= 0) {
quadVelocity.x *= -1;
}
//check collision with horizontal border
if (quadPosition.y + 50 >= mode.height || quadPosition.y - 50 <= 0) {
quadVelocity.y *= -1;
}
}
private void render() {
if (pbuffer.isBufferLost()) {
System.out.println("Buffer contents lost - will recreate the buffer");
Pbuffer.releaseContext();
pbuffer.destroy();
initPbuffer();
}
pbuffer.makeCurrent();
// Pbuffer rendering
//clear background
GL.glClear(GL.GL_COLOR_BUFFER_BIT);
// draw white quad
GL.glPushMatrix();
{
GL.glTranslatef(quadPosition.x, quadPosition.y, 0);
GL.glRotatef(angle, 0.0f, 0.0f, 1.0f);
GL.glColor3f(1.0f, 1.0f, 1.0f);
GL.glBegin(GL.GL_QUADS);
{
GL.glVertex2i(-50, -50);
GL.glVertex2i(50, -50);
GL.glVertex2i(50, 50);
GL.glVertex2i(-50, 50);
}
GL.glEnd();
}
GL.glPopMatrix();
GL.glCopyTexImage2D(GL.GL_TEXTURE_2D, 0, GL.GL_RGB, 0, 0, 256, 256, 0);
Pbuffer.releaseContext();
// OpenGL window rendering
GL.glClear(GL.GL_COLOR_BUFFER_BIT);
// draw white quad
GL.glPushMatrix();
{
GL.glTranslatef(quadPosition.x, quadPosition.y, 0);
GL.glRotatef(angle, 0.0f, 0.0f, 1.0f);
GL.glColor3f(1.0f, 1.0f, 0.0f);
GL.glBegin(GL.GL_QUADS);
{
GL.glTexCoord2f(0f, 0f);
GL.glVertex2i(-50, -50);
GL.glTexCoord2f(1f, 0f);
GL.glVertex2i(50, -50);
GL.glTexCoord2f(1f, 1f);
GL.glVertex2i(50, 50);
GL.glTexCoord2f(0f, 1f);
GL.glVertex2i(-50, 50);
}
GL.glEnd();
}
GL.glPopMatrix();
}
private void initPbuffer() {
try {
pbuffer = new Pbuffer(256, 256, mode.bpp, 0, 0, 0);
pbuffer.makeCurrent();
initGLState(256, 256, 0.5f);
GL.glBindTexture(GL.GL_TEXTURE_2D, tex_handle);
Pbuffer.releaseContext();
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* Processes keyboard input
*/
private void processKeyboard() {
Keyboard.poll();
//check for fullscreen key
if (Keyboard.isKeyDown(Keyboard.KEY_F)) {
try {
destroyTexture();
Keyboard.destroy();
Pbuffer.releaseContext();
pbuffer.destroy();
Window.destroy();
Display.setDisplayMode(mode);
Window.create("Test", mode.bpp, 0, 0, 0);
glInit();
initPbuffer();
Keyboard.create();
} catch (Exception e) {
e.printStackTrace();
}
}
//check for window key
if (Keyboard.isKeyDown(Keyboard.KEY_W)) {
try {
destroyTexture();
Keyboard.destroy();
Pbuffer.releaseContext();
pbuffer.destroy();
Window.destroy();
Display.resetDisplayMode();
Window.create("Test", 50, 50, mode.width, mode.height, mode.bpp, 0, 0, 0);
glInit();
initPbuffer();
Keyboard.create();
} catch (Exception e) {
e.printStackTrace();
}
}
//check for speed changes
if (Keyboard.isKeyDown(Keyboard.KEY_UP)) {
quadVelocity.y += 0.1f;
}
if (Keyboard.isKeyDown(Keyboard.KEY_DOWN)) {
quadVelocity.y -= 0.1f;
}
if (Keyboard.isKeyDown(Keyboard.KEY_RIGHT)) {
quadVelocity.x += 0.1f;
}
if (Keyboard.isKeyDown(Keyboard.KEY_LEFT)) {
quadVelocity.x -= 0.1f;
}
if (Keyboard.isKeyDown(Keyboard.KEY_ADD)) {
angleRotation += 0.1f;
}
if (Keyboard.isKeyDown(Keyboard.KEY_SUBTRACT)) {
angleRotation -= 0.1f;
}
//throttle
if (quadVelocity.x < -MAX_SPEED) {
quadVelocity.x = -MAX_SPEED;
}
if (quadVelocity.x > MAX_SPEED) {
quadVelocity.x = MAX_SPEED;
}
if (quadVelocity.y < -MAX_SPEED) {
quadVelocity.y = -MAX_SPEED;
}
if (quadVelocity.y > MAX_SPEED) {
quadVelocity.y = MAX_SPEED;
}
if (angleRotation < 0.0f) {
angleRotation = 0.0f;
}
if (angleRotation > MAX_SPEED) {
angleRotation = MAX_SPEED;
}
}
private void destroyTexture() {
IntBuffer buffer = ByteBuffer.allocateDirect(4).order(ByteOrder.nativeOrder()).asIntBuffer();
buffer.put(0, tex_handle);
GL.glDeleteTextures(buffer);
}
/**
* Cleans up the test
*/
private void cleanup() {
destroyTexture();
Keyboard.destroy();
Pbuffer.releaseContext();
pbuffer.destroy();
Window.destroy();
}
/**
* Retrieves a displaymode, if one such is available
*
* @param width Required width
* @param height Required height
* @param bpp Minimum required bits per pixel
* @return
*/
private DisplayMode findDisplayMode(int width, int height, int bpp) {
DisplayMode[] modes = Display.getAvailableDisplayModes();
for (int i = 0; i < modes.length; i++) {
if (modes[i].width == width
&& modes[i].height == height
&& modes[i].bpp >= bpp) {
return modes[i];
}
}
return null;
}
private void initGLState(int width, int height, float color) {
GL.glMatrixMode(GL.GL_PROJECTION);
GL.glLoadIdentity();
GLU.gluOrtho2D(0, mode.width, 0, mode.height);
GL.glMatrixMode(GL.GL_MODELVIEW);
GL.glLoadIdentity();
GL.glViewport(0, 0, width, height);
//set clear color to black
GL.glClearColor(color, color, color, 0.0f);
}
/**
* Initializes OGL
*/
private void glInit() {
//sync frame (only works on windows)
GLCaps.determineAvailableExtensions();
if (GLCaps.WGL_EXT_swap_control) {
GL.wglSwapIntervalEXT(1);
}
GL.glTexEnvf(GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE, GL.GL_REPLACE);
GL.glEnable(GL.GL_TEXTURE_2D);
// Create shared texture
IntBuffer buffer = ByteBuffer.allocateDirect(4).order(ByteOrder.nativeOrder()).asIntBuffer();
GL.glGenTextures(buffer);
tex_handle = buffer.get(0);
GL.glBindTexture(GL.GL_TEXTURE_2D, tex_handle);
GL.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_S, GL.GL_CLAMP);
GL.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_T, GL.GL_CLAMP);
GL.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR);
GL.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR);
initGLState(mode.width, mode.height, 0f);
}
/**
* Test entry point
*/
public static void main(String[] args) {
System.out.println(
"Change between fullscreen and windowed mode, by pressing F and W respectively");
System.out.println("Move quad using arrowkeys, and change rotation using +/-");
PbufferTest fswTest = new PbufferTest();
fswTest.execute();
}
}

View File

@ -1,242 +0,0 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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$
*
* Simple java test program.
*
* @author elias_naur <elias_naur@users.sourceforge.net>
* @version $Revision$
*/
package org.lwjgl.test.opengl;
import org.lwjgl.*;
import org.lwjgl.opengl.*;
import org.lwjgl.input.*;
import java.nio.*;
public final class VBOIndexTest {
static {
try {
//find first display mode that allows us 640*480*16
int mode = -1;
DisplayMode[] modes = Display.getAvailableDisplayModes();
for (int i = 0; i < modes.length; i++) {
if (modes[i].width == 640
&& modes[i].height == 480
&& modes[i].bpp >= 16) {
mode = i;
break;
}
}
if (mode != -1) {
//select above found displaymode
System.out.println("Setting display mode to "+modes[mode]);
Display.setDisplayMode(modes[mode]);
System.out.println("Created display.");
}
} catch (Exception e) {
System.err.println("Failed to create display due to " + e);
}
}
static {
try {
Window.create("LWJGL Game Example", 16, 0, 0,0);
System.out.println("Created OpenGL.");
} catch (Exception e) {
System.err.println("Failed to create OpenGL due to "+e);
System.exit(1);
}
}
/** Is the game finished? */
private static boolean finished;
/** A rotating square! */
private static float angle;
private static int buffer_id;
private static int indices_buffer_id;
private static FloatBuffer vertices;
private static ByteBuffer mapped_buffer = null;
private static FloatBuffer mapped_float_buffer = null;
private static IntBuffer indices;
private static ByteBuffer mapped_indices_buffer = null;
private static IntBuffer mapped_indices_int_buffer = null;
public static void main(String[] arguments) {
try {
init();
while (!finished) {
Window.update();
if (Window.isMinimized())
Thread.sleep(200);
else if (Window.isCloseRequested())
System.exit(0);
Keyboard.poll();
mainLoop();
render();
Window.paint();
}
} catch (Throwable t) {
t.printStackTrace();
} finally {
cleanup();
}
}
/**
* All calculations are done in here
*/
private static void mainLoop() {
angle += 1f;
if (angle > 360.0f)
angle = 0.0f;
Mouse.poll();
if (Mouse.dx != 0 || Mouse.dy != 0 || Mouse.dwheel != 0)
System.out.println("Mouse moved " + Mouse.dx + " " + Mouse.dy + " " + Mouse.dwheel);
for (int i = 0; i < Mouse.buttonCount; i++)
if (Mouse.isButtonDown(i))
System.out.println("Button " + i + " down");
/* Keyboard.poll();
if (Keyboard.isKeyDown(Keyboard.KEY_ESCAPE))
finished = true;*/
Keyboard.read();
for (int i = 0; i < Keyboard.getNumKeyboardEvents(); i++) {
Keyboard.next();
if (Keyboard.key == Keyboard.KEY_ESCAPE && Keyboard.state)
finished = true;
if (Keyboard.key == Keyboard.KEY_T && Keyboard.state)
System.out.println("Current time: " + Sys.getTime());
}
}
/**
* All rendering is done in here
*/
private static void render() {
GL.glClear(GL.GL_COLOR_BUFFER_BIT);
GL.glPushMatrix();
GL.glTranslatef(Display.getWidth() / 2, Display.getHeight() / 2, 0.0f);
GL.glRotatef(angle, 0, 0, 1.0f);
ByteBuffer new_mapped_buffer = GL.glMapBufferARB(GL.GL_ARRAY_BUFFER_ARB, GL.GL_WRITE_ONLY_ARB, 2*4*4, mapped_buffer);
if (new_mapped_buffer != mapped_buffer)
mapped_float_buffer = new_mapped_buffer.order(ByteOrder.nativeOrder()).asFloatBuffer();
mapped_buffer = new_mapped_buffer;
new_mapped_buffer = GL.glMapBufferARB(GL.GL_ELEMENT_ARRAY_BUFFER_ARB, GL.GL_WRITE_ONLY_ARB, 4*4, mapped_indices_buffer);
if (new_mapped_buffer != mapped_indices_buffer)
mapped_indices_int_buffer = new_mapped_buffer.order(ByteOrder.nativeOrder()).asIntBuffer();
mapped_float_buffer.rewind();
vertices.rewind();
mapped_float_buffer.put(vertices);
mapped_indices_int_buffer.rewind();
indices.rewind();
mapped_indices_int_buffer.put(indices);
if (GL.glUnmapBufferARB(GL.GL_ARRAY_BUFFER_ARB) && GL.glUnmapBufferARB(GL.GL_ELEMENT_ARRAY_BUFFER_ARB)) {
GL.glDrawElements(GL.GL_QUADS, 4, GL.GL_UNSIGNED_INT, 0);
}
GL.glPopMatrix();
}
/**
* Initialize
*/
private static void init() throws Exception {
Keyboard.create();
Keyboard.enableBuffer();
Mouse.create();
Sys.setTime(0);
Sys.setProcessPriority(Sys.HIGH_PRIORITY);
System.out.println("Timer resolution: " + Sys.getTimerResolution());
// Go into orthographic projection mode.
GLCaps.determineAvailableExtensions();
GL.glMatrixMode(GL.GL_PROJECTION);
GL.glLoadIdentity();
GLU.gluOrtho2D(0, Display.getWidth(), 0, Display.getHeight());
GL.glMatrixMode(GL.GL_MODELVIEW);
GL.glLoadIdentity();
GL.glViewport(0, 0, Display.getWidth(), Display.getHeight());
if (!GLCaps.GL_ARB_vertex_buffer_object) {
System.out.println("ARB VBO not supported!");
System.exit(1);
}
IntBuffer int_buffer = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()).asIntBuffer();
GL.glGenBuffersARB(int_buffer);
buffer_id = int_buffer.get(0);
indices_buffer_id = int_buffer.get(1);
GL.glBindBufferARB(GL.GL_ARRAY_BUFFER_ARB, buffer_id);
GL.glBindBufferARB(GL.GL_ELEMENT_ARRAY_BUFFER_ARB, indices_buffer_id);
vertices = ByteBuffer.allocateDirect(2*4*4).order(ByteOrder.nativeOrder()).asFloatBuffer();
vertices.put(-50).put(-50).put(50).put(-50).put(50).put(50).put(-50).put(50);
vertices.rewind();
indices = ByteBuffer.allocateDirect(4*4).order(ByteOrder.nativeOrder()).asIntBuffer();
indices.put(0).put(1).put(2).put(3);
indices.rewind();
GL.glBufferDataARB(GL.GL_ARRAY_BUFFER_ARB, 2*4*4, (ByteBuffer)null, GL.GL_STREAM_DRAW_ARB);
GL.glBufferDataARB(GL.GL_ELEMENT_ARRAY_BUFFER_ARB, 4*4, (ByteBuffer)null, GL.GL_STREAM_DRAW_ARB);
GL.glEnableClientState(GL.GL_VERTEX_ARRAY);
GL.glVertexPointer(2, GL.GL_FLOAT, 0, 0);
GL.glGetInteger(GL.GL_MAX_TEXTURE_UNITS_ARB, int_buffer);
System.out.println("Number of texture units: " + int_buffer.get(0));
// Fix the refresh rate to the display frequency.
// gl.wglSwapIntervalEXT(1);
}
/**
* Cleanup
*/
private static void cleanup() {
IntBuffer int_buffer = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()).asIntBuffer();
int_buffer.put(0, buffer_id);
int_buffer.put(1, indices_buffer_id);
GL.glDeleteBuffersARB(int_buffer);
Keyboard.destroy();
Mouse.destroy();
Window.destroy();
try {
Display.resetDisplayMode();
} catch (Exception e) {
e.printStackTrace();
}
}
}

View File

@ -1,218 +0,0 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Light Weight Java Game Library' 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$
*
* Simple java test program.
*
* @author elias_naur <elias_naur@users.sourceforge.net>
* @version $Revision$
*/
package org.lwjgl.test.opengl;
import org.lwjgl.*;
import org.lwjgl.opengl.*;
import org.lwjgl.input.*;
import java.nio.*;
public final class VBOTest {
static {
try {
//find first display mode that allows us 640*480*16
int mode = -1;
DisplayMode[] modes = Display.getAvailableDisplayModes();
for (int i = 0; i < modes.length; i++) {
if (modes[i].width == 640
&& modes[i].height == 480
&& modes[i].bpp >= 16) {
mode = i;
break;
}
}
if (mode != -1) {
//select above found displaymode
System.out.println("Setting display mode to "+modes[mode]);
Display.setDisplayMode(modes[mode]);
System.out.println("Created display.");
}
} catch (Exception e) {
System.err.println("Failed to create display due to " + e);
}
}
static {
try {
Window.create("LWJGL Game Example", 16, 0, 0,0);
System.out.println("Created OpenGL.");
} catch (Exception e) {
System.err.println("Failed to create OpenGL due to "+e);
System.exit(1);
}
}
/** Is the game finished? */
private static boolean finished;
/** A rotating square! */
private static float angle;
private static int buffer_id;
private static FloatBuffer vertices;
private static ByteBuffer mapped_buffer = null;
private static FloatBuffer mapped_float_buffer = null;
public static void main(String[] arguments) {
try {
init();
while (!finished) {
Window.update();
if (Window.isMinimized())
Thread.sleep(200);
else if (Window.isCloseRequested())
System.exit(0);
Keyboard.poll();
mainLoop();
render();
Window.paint();
}
} catch (Throwable t) {
t.printStackTrace();
} finally {
cleanup();
}
}
/**
* All calculations are done in here
*/
private static void mainLoop() {
angle += 1f;
if (angle > 360.0f)
angle = 0.0f;
Mouse.poll();
if (Mouse.dx != 0 || Mouse.dy != 0 || Mouse.dwheel != 0)
System.out.println("Mouse moved " + Mouse.dx + " " + Mouse.dy + " " + Mouse.dwheel);
for (int i = 0; i < Mouse.buttonCount; i++)
if (Mouse.isButtonDown(i))
System.out.println("Button " + i + " down");
/* Keyboard.poll();
if (Keyboard.isKeyDown(Keyboard.KEY_ESCAPE))
finished = true;*/
Keyboard.read();
for (int i = 0; i < Keyboard.getNumKeyboardEvents(); i++) {
Keyboard.next();
if (Keyboard.key == Keyboard.KEY_ESCAPE && Keyboard.state)
finished = true;
if (Keyboard.key == Keyboard.KEY_T && Keyboard.state)
System.out.println("Current time: " + Sys.getTime());
}
}
/**
* All rendering is done in here
*/
private static void render() {
GL.glClear(GL.GL_COLOR_BUFFER_BIT);
GL.glPushMatrix();
GL.glTranslatef(Display.getWidth() / 2, Display.getHeight() / 2, 0.0f);
GL.glRotatef(angle, 0, 0, 1.0f);
ByteBuffer new_mapped_buffer = GL.glMapBufferARB(GL.GL_ARRAY_BUFFER_ARB, GL.GL_WRITE_ONLY_ARB, 2*4*4, mapped_buffer);
if (new_mapped_buffer != mapped_buffer)
mapped_float_buffer = new_mapped_buffer.order(ByteOrder.nativeOrder()).asFloatBuffer();
mapped_buffer = new_mapped_buffer;
mapped_float_buffer.rewind();
vertices.rewind();
mapped_float_buffer.put(vertices);
if (GL.glUnmapBufferARB(GL.GL_ARRAY_BUFFER_ARB))
GL.glDrawArrays(GL.GL_QUADS, 0, 4);
GL.glPopMatrix();
}
/**
* Initialize
*/
private static void init() throws Exception {
Keyboard.create();
Keyboard.enableBuffer();
Mouse.create();
Sys.setTime(0);
Sys.setProcessPriority(Sys.HIGH_PRIORITY);
System.out.println("Timer resolution: " + Sys.getTimerResolution());
// Go into orthographic projection mode.
GLCaps.determineAvailableExtensions();
GL.glMatrixMode(GL.GL_PROJECTION);
GL.glLoadIdentity();
GLU.gluOrtho2D(0, Display.getWidth(), 0, Display.getHeight());
GL.glMatrixMode(GL.GL_MODELVIEW);
GL.glLoadIdentity();
GL.glViewport(0, 0, Display.getWidth(), Display.getHeight());
if (!GLCaps.GL_ARB_vertex_buffer_object) {
System.out.println("ARB VBO not supported!");
System.exit(1);
}
IntBuffer int_buffer = ByteBuffer.allocateDirect(4).order(ByteOrder.nativeOrder()).asIntBuffer();
GL.glGenBuffersARB(int_buffer);
buffer_id = int_buffer.get(0);
GL.glBindBufferARB(GL.GL_ARRAY_BUFFER_ARB, buffer_id);
vertices = ByteBuffer.allocateDirect(2*4*4).order(ByteOrder.nativeOrder()).asFloatBuffer();
vertices.put(-50).put(-50).put(50).put(-50).put(50).put(50).put(-50).put(50);
GL.glBufferDataARB(GL.GL_ARRAY_BUFFER_ARB, 2*4*4, (ByteBuffer)null, GL.GL_STREAM_DRAW_ARB);
GL.glEnableClientState(GL.GL_VERTEX_ARRAY);
GL.glVertexPointer(2, GL.GL_FLOAT, 0, 0);
GL.glGetInteger(GL.GL_MAX_TEXTURE_UNITS_ARB, int_buffer);
System.out.println("Number of texture units: " + int_buffer.get(0));
// Fix the refresh rate to the display frequency.
// gl.wglSwapIntervalEXT(1);
}
/**
* Cleanup
*/
private static void cleanup() {
IntBuffer int_buffer = ByteBuffer.allocateDirect(4).order(ByteOrder.nativeOrder()).asIntBuffer();
int_buffer.put(0, buffer_id);
GL.glDeleteBuffersARB(int_buffer);
Keyboard.destroy();
Mouse.destroy();
Window.destroy();
try {
Display.resetDisplayMode();
} catch (Exception e) {
e.printStackTrace();
}
}
}

View File

@ -1,72 +0,0 @@
#pragma bind app2vert.position = ATTR0
#pragma bind app2vert.normal = ATTR2
#pragma bind app2vert.color = ATTR3
struct app2vert : application2vertex
{
float4 position; //in object space
float3 normal; //in object space
float4 color;
};
#pragma bind vert2frag.HPOS = HPOS
#pragma bind vert2frag.COL0 = COL0
struct vert2frag : vertex2fragment
{
float4 HPOS;
float4 COL0;
};
vert2frag main(app2vert IN,
uniform float4x4 ModelViewProj,
uniform float4 Stiff[12],
uniform float4 Load)
{
vert2frag OUT;
float4 position;
float3 normal;
float3 disloc;
float4 dif;
float index;
float teta;
float alpha;
alpha = IN.position.y / 1.7;
// matrix line index
index = IN.color.a * 5 * 2;
// straw stiffness (randomic)
Load = Load * IN.color.y;
disloc.x = IN.position.x + dot(Stiff[index].xy, Load.xz);
disloc.y = IN.position.y;
disloc.z = IN.position.z + dot(Stiff[index + 1].xy, Load.xz);
// find the normal
teta = acos(IN.position.y / length(disloc));
normal = IN.position.xyz - disloc.xyz;
normal.y = sin(teta) * length(disloc);
normal = normalize(normal);
position.x = disloc.x + IN.color.x;
position.y = disloc.y;
position.z = disloc.z + IN.color.z;
position.w = 1;
OUT.HPOS = mul(ModelViewProj, position);
// calculate diffuse lighting off the normal that was just calculated
float4 lightPos = float4(0,4,0,0);
float4 lightVec = normalize(lightPos - position);
float diffuseInten = dot(lightVec.xyz, normal);
diffuseInten = (diffuseInten < 0.5) ? 0.5 : diffuseInten;
OUT.COL0 = float4(IN.color.y * 0.7, 0.7, 0.4, alpha) * diffuseInten;
return OUT;
}

View File

@ -1,116 +0,0 @@
!!VP1.0
# NV_vertex_program generated by NVIDIA Cg compiler
# cgc version 1.5.0001, build date Sep 12 2002 15:49:58
# command line args: -profile vp20 cg_grass2.cg
# nv30vp backend compiling 'main' program
#vendor NVIDIA Corporation
#version 1.0.1
#profile vp20
#program main
#semantic main.ModelViewProj
#semantic main.Stiff
#semantic main.Load
#var float4 IN.position : $vin.ATTR0 : ATTR0 : 0 : 1
#var float3 IN.normal : $vin.ATTR2 : ATTR2 : 0 : 1
#var float4 IN.color : $vin.ATTR3 : ATTR3 : 0 : 1
#var float4x4 ModelViewProj : : c[0], 4 : 1 : 1
#var float4 Stiff[0] : : c[4] : 2 : 1
#var float4 Stiff[1] : : c[5] : 2 : 1
#var float4 Stiff[2] : : c[6] : 2 : 1
#var float4 Stiff[3] : : c[7] : 2 : 1
#var float4 Stiff[4] : : c[8] : 2 : 1
#var float4 Stiff[5] : : c[9] : 2 : 1
#var float4 Stiff[6] : : c[10] : 2 : 1
#var float4 Stiff[7] : : c[11] : 2 : 1
#var float4 Stiff[8] : : c[12] : 2 : 1
#var float4 Stiff[9] : : c[13] : 2 : 1
#var float4 Stiff[10] : : c[14] : 2 : 1
#var float4 Stiff[11] : : c[15] : 2 : 1
#var float4 Load : : c[16] : 3 : 1
#var float4 HPOS : $vout.HPOS : HPOS : -1 : 1
#var float4 COL0 : $vout.COL0 : COL0 : -1 : 1
#const c[17] = 1.7 5 2 0
#const c[18] = -0.0187293 0.074261 0.2121144 1.570729
#const c[20] = 0 0.5 1 0
#const c[21] = 0.25 -9 0.75 0.1591549
#const c[22] = 24.9808 -24.9808 -60.14581 60.14581
#const c[23] = 85.45379 -85.45379 -64.93935 64.93935
#const c[24] = 19.73921 -19.73921 -1 1
#const c[25] = 0 4 0 0
#const c[19] = 1 3.141593 0.5 1
#const c[26] = 0.7 0.4 0 0
MUL R2, c[16], v[3].y;
MUL R0, v[3].w, c[17].y;
MUL R1, R0.x, c[17].z;
ARL A0.x, R1.x;
MUL R0, c[A0.x + 4].xyxx, R2.xzxx;
ADD R0, R0.x, R0.y;
ADD R3.x, v[0].x, R0.x;
MOV R3.y, v[0].y;
MUL R0, c[A0.x + 5].xyxx, R2.xzxx;
ADD R0, R0.x, R0.y;
ADD R3.z, v[0].z, R0.x;
ADD R2.x, R3.x, v[3].x;
MOV R2.y, R3.y;
ADD R2.z, R3.z, v[3].z;
MOV R2.w, c[19].x;
DP4 R0.x, c[0], R2;
DP4 R0.y, c[1], R2;
DP4 R0.z, c[2], R2;
DP4 R0.w, c[3], R2;
MOV o[HPOS], R0;
ADD R1.xz, v[0].xyzx, -R3.xyzx;
DP3 R0, R3.xyzx, R3.xyzx;
RSQ R0, R0.x;
RCP R0, R0.x;
RCP R3, R0.x;
MUL R6, v[0].y, R3.x;
MAX R5, R6.x, -R6.x;
MAD R3, c[18].x, R5.x, c[18].y;
MAD R3, R3.x, R5.x, -c[18].z;
MAD R4, R3.x, R5.x, c[18].w;
ADD R3, c[19].x, -R5.x;
RSQ R3, R3.x;
RCP R3, R3.x;
MUL R5, R4.x, R3.x;
SLT R4, R6.x, c[17].w;
MUL R3, c[17].z, R4.x;
MUL R3, R3.x, R5.x;
ADD R3, R5.x, -R3.x;
MAD R3, R4.x, c[19].y, R3.x;
MAD R6, c[21].w, R3.x, -c[21].x;
EXP R6.y, R6.x;
ADD R3, c[20].xyzx, -R6.yyyy;
MUL R5, R3.xyzx, R3.xyzx;
SLT R4.x, R6.y, c[21].x;
SGE R3, R6.yyyy, c[21].yzyy;
MOV R4.yz, R3.xxyw;
DP3 R4.y, R4.xyzx, c[24].zwzz;
MAD R3, c[22].xyxx, R5.xyzx, c[22].zwzz;
MAD R3, R3.xyzx, R5.xyzx, c[23].xyxx;
MAD R3, R3.xyzx, R5.xyzx, c[23].zwzz;
MAD R3, R3.xyzx, R5.xyzx, c[24].xyxx;
MAD R3, R3.xyzx, R5.xyzx, c[24].zwzz;
DP3 R5.x, R3.xyzx, -R4.xyzx;
MUL R1.y, R5.x, R0.x;
DP3 R0, R1.xyzx, R1.xyzx;
RSQ R0, R0.x;
MUL R3, R0.x, R1.xyzx;
ADD R1, c[25], -R2;
DP4 R0, R1, R1;
RSQ R0, R0.x;
MUL R0, R0.x, R1;
DP3 R2, R0.xyzx, R3.xyzx;
SLT R1, R2.x, c[19].z;
ADD R0, c[19].w, -R1.x;
MUL R0, R0.x, R2.x;
MAD R2, R1.x, c[19].z, R0.x;
MUL R1.x, v[3].y, c[26].x;
MOV R1.y, c[26].x;
MOV R1.z, c[26].y;
RCP R0, c[17].x;
MUL R1.w, v[0].y, R0.x;
MUL o[COL0], R1, R2.x;
END
# 72 instructions
# End of program

View File

@ -0,0 +1,134 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Lightweight Java Game Library' 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.vector;
import java.io.Serializable;
import java.nio.FloatBuffer;
/**
* $Id$
*
* Base class for matrices. When a matrix is constructed it will be the identity
* matrix unless otherwise stated.
*
* @author cix_foo <cix_foo@users.sourceforge.net>
* @version $Revision$
*/
public abstract class Matrix implements Serializable {
/**
* Constructor for Matrix.
*/
public Matrix() {
super();
}
/**
* Set this matrix to be the identity matrix.
* @return this
*/
public abstract Matrix setIdentity();
/**
* Invert this matrix
* @return this
*/
public abstract Matrix invert();
/**
* Load from a float buffer. The buffer stores the matrix in column major
* (OpenGL) order.
*
* @param buf A float buffer to read from
* @return this
*/
public abstract Matrix load(FloatBuffer buf);
/**
* Load from a float buffer. The buffer stores the matrix in row major
* (mathematical) order.
*
* @param buf A float buffer to read from
* @return this
*/
public abstract Matrix loadTranspose(FloatBuffer buf);
/**
* Negate this matrix
* @return this
*/
public abstract Matrix negate();
/**
* Store this matrix in a float buffer. The matrix is stored in column
* major (openGL) order.
* @param buf The buffer to store this matrix in
* @return this
*/
public abstract Matrix store(FloatBuffer buf);
/**
* Store this matrix in a float buffer. The matrix is stored in row
* major (maths) order.
* @param buf The buffer to store this matrix in
* @return this
*/
public abstract Matrix storeTranspose(FloatBuffer buf);
/**
* Transpose this matrix
* @return this
*/
public abstract Matrix transpose();
/**
* Set this matrix to 0.
* @return this
*/
public abstract Matrix setZero();
/**
* @return the determinant of the matrix
*/
public abstract float determinant();
}

View File

@ -0,0 +1,393 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Lightweight Java Game Library' 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.vector;
import java.io.Serializable;
import java.nio.FloatBuffer;
/**
* $Id$
*
* Holds a 2x2 matrix
*
* @author cix_foo <cix_foo@users.sourceforge.net>
* @version $Revision$
*/
public class Matrix2f extends Matrix implements Serializable {
public float m00 = 1.0f, m01, m10, m11 = 1.0f;
/**
* Constructor for Matrix2f.
*/
public Matrix2f() {
}
/**
* Constructor
*/
public Matrix2f(Matrix2f src) {
load(src);
}
/**
* Load from another matrix2f
* @param src The source matrix
* @return this
*/
public Matrix2f load(Matrix2f src) {
m00 = src.m00;
m01 = src.m01;
m10 = src.m10;
m11 = src.m11;
return this;
}
/**
* Load from a float buffer. The buffer stores the matrix in column major
* (OpenGL) order.
*
* @param buf A float buffer to read from
* @return this
*/
public Matrix load(FloatBuffer buf) {
m00 = buf.get();
m01 = buf.get();
m10 = buf.get();
m11 = buf.get();
return this;
}
/**
* Load from a float buffer. The buffer stores the matrix in row major
* (mathematical) order.
*
* @param buf A float buffer to read from
* @return this
*/
public Matrix loadTranspose(FloatBuffer buf) {
m00 = buf.get();
m10 = buf.get();
m01 = buf.get();
m11 = buf.get();
return this;
}
/**
* Store this matrix in a float buffer. The matrix is stored in column
* major (openGL) order.
* @param buf The buffer to store this matrix in
*/
public Matrix store(FloatBuffer buf) {
buf.put(m00);
buf.put(m01);
buf.put(m10);
buf.put(m11);
return this;
}
/**
* Store this matrix in a float buffer. The matrix is stored in row
* major (maths) order.
* @param buf The buffer to store this matrix in
*/
public Matrix storeTranspose(FloatBuffer buf) {
buf.put(m00);
buf.put(m10);
buf.put(m01);
buf.put(m11);
return this;
}
/**
* Add two matrices together and place the result in a third matrix.
* @param left The left source matrix
* @param right The right source matrix
* @param dest The destination matrix, or null if a new one is to be created
* @return the destination matrix
*/
public static Matrix2f add(Matrix2f left, Matrix2f right, Matrix2f dest) {
Matrix2f temp = null;
if (dest == null)
dest = new Matrix2f();
else if (dest == left || dest == right) {
temp = dest;
dest = new Matrix2f();
}
dest.m00 = left.m00 + right.m00;
dest.m01 = left.m01 + right.m01;
dest.m10 = left.m10 + right.m10;
dest.m11 = left.m11 + right.m11;
if (temp != null) {
temp.load(dest);
return temp;
} else
return dest;
}
/**
* Subtract the right matrix from the left and place the result in a third matrix.
* @param left The left source matrix
* @param right The right source matrix
* @param dest The destination matrix, or null if a new one is to be created
* @return the destination matrix
*/
public static Matrix2f sub(Matrix2f left, Matrix2f right, Matrix2f dest) {
Matrix2f temp = null;
if (dest == null)
dest = new Matrix2f();
else if (dest == left || dest == right) {
temp = dest;
dest = new Matrix2f();
}
dest.m00 = left.m00 - right.m00;
dest.m01 = left.m01 - right.m01;
dest.m10 = left.m10 - right.m10;
dest.m11 = left.m11 - right.m11;
if (temp != null) {
temp.load(dest);
return temp;
} else
return dest;
}
/**
* Multiply the right matrix by the left and place the result in a third matrix.
* @param left The left source matrix
* @param right The right source matrix
* @param dest The destination matrix, or null if a new one is to be created
* @return the destination matrix
*/
public static Matrix2f mul(Matrix2f left, Matrix2f right, Matrix2f dest) {
Matrix2f temp = null;
if (dest == null)
dest = new Matrix2f();
else if (dest == left || dest == right) {
temp = dest;
dest = new Matrix2f();
}
dest.m00 = left.m00 * right.m00 + left.m10 * right.m01;
dest.m01 = left.m01 * right.m00 + left.m11 * right.m01;
dest.m10 = left.m00 * right.m10 + left.m10 * right.m11;
dest.m11 = left.m01 * right.m10 + left.m11 * right.m11;
if (temp != null) {
temp.load(dest);
return temp;
} else
return dest;
}
/**
* Transform a Vector by a matrix and return the result in a destination
* vector.
* @param left The left matrix
* @param right The right vector
* @param dest The destination vector, or null if a new one is to be created
* @return the destination vector
*/
public static Vector2f transform(Matrix2f left, Vector2f right, Vector2f dest) {
Vector2f temp = null;
if (dest == null)
dest = new Vector2f();
else if (dest == right) {
temp = dest;
dest = new Vector2f();
}
dest.x = left.m00 * right.x + left.m10 * right.y;
dest.y = left.m01 * right.x + left.m11 * right.y;
if (temp != null) {
temp.set(dest);
return temp;
} else
return dest;
}
/**
* Transpose this matrix
* @return this
*/
public Matrix transpose() {
float temp;
temp = m01;
m01 = m10;
m10 = temp;
return this;
}
/**
* Transpose this matrix and place the result in another matrix.
* @param dest The destination matrix or null if a new matrix is to be created
* @return the transposed matrix
*/
public Matrix2f transpose(Matrix2f dest) {
if (dest == null)
dest = new Matrix2f();
if (dest == this)
transpose();
else {
dest.m01 = m10;
dest.m10 = m01;
}
return dest;
}
/**
* Invert this matrix
* @return this if successful, null otherwise
*/
public Matrix invert()
{
/*
*inv(A) = 1/det(A) * adj(A);
*/
float determinant = determinant();
if (determinant != 0) {
float determinant_inv = 1f/determinant;
float t00 = m11*determinant_inv;
float t01 = -m01*determinant_inv;
float t11 = m00*determinant_inv;
float t10 = -m10*determinant_inv;
m00 = t00;
m01 = t01;
m10 = t10;
m11 = t11;
return this;
} else
return null;
}
/**
* Returns a string representation of this matrix
*/
public String toString() {
StringBuffer buf = new StringBuffer();
buf.append(m00).append(' ').append(m10).append(' ').append('\n');
buf.append(m01).append(' ').append(m11).append(' ').append('\n');
return buf.toString();
}
/**
* Negate this matrix
* @return this
*/
public Matrix negate() {
m00 = -m00;
m01 = -m01;
m10 = -m10;
m11 = -m11;
return this;
}
/**
* Negate this matrix and stash the result in another matrix.
* @param dest The destination matrix, or null if a new matrix is to be created
* @return the negated matrix
*/
public Matrix2f negate(Matrix2f dest) {
if (dest == null)
dest = new Matrix2f();
dest.m00 = -m00;
dest.m01 = -m01;
dest.m10 = -m10;
dest.m11 = -m11;
return dest;
}
/**
* Set this matrix to be the identity matrix.
* @return this
*/
public Matrix setIdentity() {
m00 = 1.0f;
m01 = 0.0f;
m10 = 0.0f;
m11 = 1.0f;
return this;
}
/**
* Set this matrix to 0.
* @return this
*/
public Matrix setZero() {
m00 = 0.0f;
m01 = 0.0f;
m10 = 0.0f;
m11 = 0.0f;
return this;
}
/* (non-Javadoc)
* @see org.lwjgl.vector.Matrix#determinant()
*/
public float determinant() {
return m00 * m11 - m01*m10;
}
}

View File

@ -0,0 +1,494 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Lightweight Java Game Library' 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.vector;
import java.io.Serializable;
import java.nio.FloatBuffer;
/**
* $Id$
*
* Holds a 3x3 matrix.
*
* @author cix_foo <cix_foo@users.sourceforge.net>
* @version $Revision$
*/
public class Matrix3f extends Matrix implements Serializable {
public float m00 = 1.0f,
m01,
m02,
m10,
m11 = 1.0f,
m12,
m20,
m21,
m22 = 1.0f;
/**
* Constructor for Matrix3f.
*/
public Matrix3f() {
super();
}
/**
* Load from another matrix3f
* @param src The source matrix
* @return this
*/
public Matrix3f load(Matrix3f src) {
m00 = src.m00;
m10 = src.m10;
m20 = src.m20;
m01 = src.m01;
m11 = src.m11;
m21 = src.m21;
m02 = src.m02;
m12 = src.m12;
m22 = src.m22;
return this;
}
/**
* Load from a float buffer. The buffer stores the matrix in column major
* (OpenGL) order.
*
* @param buf A float buffer to read from
* @return this
*/
public Matrix load(FloatBuffer buf) {
m00 = buf.get();
m01 = buf.get();
m02 = buf.get();
m10 = buf.get();
m11 = buf.get();
m12 = buf.get();
m20 = buf.get();
m21 = buf.get();
m22 = buf.get();
return this;
}
/**
* Load from a float buffer. The buffer stores the matrix in row major
* (maths) order.
*
* @param buf A float buffer to read from
* @return this
*/
public Matrix loadTranspose(FloatBuffer buf) {
m00 = buf.get();
m10 = buf.get();
m20 = buf.get();
m01 = buf.get();
m11 = buf.get();
m21 = buf.get();
m02 = buf.get();
m12 = buf.get();
m22 = buf.get();
return this;
}
/**
* Store this matrix in a float buffer. The matrix is stored in column
* major (openGL) order.
* @param buf The buffer to store this matrix in
*/
public Matrix store(FloatBuffer buf) {
buf.put(m00);
buf.put(m01);
buf.put(m02);
buf.put(m10);
buf.put(m11);
buf.put(m12);
buf.put(m20);
buf.put(m21);
buf.put(m22);
return this;
}
/**
* Store this matrix in a float buffer. The matrix is stored in row
* major (maths) order.
* @param buf The buffer to store this matrix in
*/
public Matrix storeTranspose(FloatBuffer buf) {
buf.put(m00);
buf.put(m10);
buf.put(m20);
buf.put(m01);
buf.put(m11);
buf.put(m21);
buf.put(m02);
buf.put(m12);
buf.put(m22);
return this;
}
/**
* Add two matrices together and place the result in a third matrix.
* @param left The left source matrix
* @param right The right source matrix
* @param dest The destination matrix, or null if a new one is to be created
* @return the destination matrix
*/
public static Matrix3f add(Matrix3f left, Matrix3f right, Matrix3f dest) {
Matrix3f temp = null;
if (dest == null)
dest = new Matrix3f();
else if (dest == left || dest == right) {
temp = dest;
dest = new Matrix3f();
}
dest.m00 = left.m00 + right.m00;
dest.m01 = left.m01 + right.m01;
dest.m02 = left.m02 + right.m02;
dest.m10 = left.m10 + right.m10;
dest.m11 = left.m11 + right.m11;
dest.m12 = left.m12 + right.m12;
dest.m20 = left.m20 + right.m20;
dest.m21 = left.m21 + right.m21;
dest.m22 = left.m22 + right.m22;
if (temp != null) {
temp.load(dest);
return temp;
} else
return dest;
}
/**
* Subtract the right matrix from the left and place the result in a third matrix.
* @param left The left source matrix
* @param right The right source matrix
* @param dest The destination matrix, or null if a new one is to be created
* @return the destination matrix
*/
public static Matrix3f sub(Matrix3f left, Matrix3f right, Matrix3f dest) {
Matrix3f temp = null;
if (dest == null)
dest = new Matrix3f();
else if (dest == left || dest == right) {
temp = dest;
dest = new Matrix3f();
}
dest.m00 = left.m00 - right.m00;
dest.m01 = left.m01 - right.m01;
dest.m02 = left.m02 - right.m02;
dest.m10 = left.m10 - right.m10;
dest.m11 = left.m11 - right.m11;
dest.m12 = left.m12 - right.m12;
dest.m20 = left.m20 - right.m20;
dest.m21 = left.m21 - right.m21;
dest.m22 = left.m22 - right.m22;
if (temp != null) {
temp.load(dest);
return temp;
} else
return dest;
}
/**
* Multiply the right matrix by the left and place the result in a third matrix.
* @param left The left source matrix
* @param right The right source matrix
* @param dest The destination matrix, or null if a new one is to be created
* @return the destination matrix
*/
public static Matrix3f mul(Matrix3f left, Matrix3f right, Matrix3f dest) {
Matrix3f temp = null;
if (dest == null)
dest = new Matrix3f();
else if (dest == left || dest == right) {
temp = dest;
dest = new Matrix3f();
}
dest.m00 =
left.m00 * right.m00 + left.m10 * right.m01 + left.m20 * right.m02;
dest.m01 =
left.m01 * right.m00 + left.m11 * right.m01 + left.m21 * right.m02;
dest.m02 =
left.m02 * right.m00 + left.m12 * right.m01 + left.m22 * right.m02;
dest.m10 =
left.m00 * right.m10 + left.m10 * right.m11 + left.m20 * right.m12;
dest.m11 =
left.m01 * right.m10 + left.m11 * right.m11 + left.m21 * right.m12;
dest.m12 =
left.m02 * right.m10 + left.m12 * right.m11 + left.m22 * right.m12;
dest.m20 =
left.m00 * right.m20 + left.m10 * right.m21 + left.m20 * right.m22;
dest.m21 =
left.m01 * right.m20 + left.m11 * right.m21 + left.m21 * right.m22;
dest.m22 =
left.m02 * right.m20 + left.m12 * right.m21 + left.m22 * right.m22;
if (temp != null) {
temp.load(dest);
return temp;
} else
return dest;
}
/**
* Transform a Vector by a matrix and return the result in a destination
* vector.
* @param left The left matrix
* @param right The right vector
* @param dest The destination vector, or null if a new one is to be created
* @return the destination vector
*/
public static Vector3f transform(Matrix3f left, Vector3f right, Vector3f dest) {
Vector3f temp = null;
if (dest == null)
dest = new Vector3f();
else if (dest == right) {
temp = dest;
dest = new Vector3f();
}
dest.x = left.m00 * right.x + left.m10 * right.y + left.m20 * right.z;
dest.y = left.m01 * right.x + left.m11 * right.y + left.m21 * right.z;
dest.z = left.m02 * right.x + left.m12 * right.y + left.m22 * right.z;
if (temp != null) {
temp.set(dest);
return temp;
} else
return dest;
}
/**
* Transpose this matrix
* @return this
*/
public Matrix transpose() {
float f = m10;
m10 = m01;
m01 = f;
f = m20;
m20 = m02;
m02 = f;
f = m21;
m21 = m12;
m12 = f;
return this;
}
/**
* Transpose this matrix and place the result in another matrix
* @param dest The destination matrix or null if a new matrix is to be created
* @return the transposed matrix
*/
public Matrix3f transpose(Matrix3f dest) {
if (dest == null)
dest = new Matrix3f();
if (this != dest) {
m00 = dest.m00;
m01 = dest.m10;
m02 = dest.m20;
m10 = dest.m01;
m11 = dest.m11;
m12 = dest.m21;
m20 = dest.m02;
m21 = dest.m12;
m22 = dest.m22;
} else
transpose();
return this;
}
/**
* @return the determinant of the matrix
*/
public float determinant() {
float f =
m00 * (m11 * m22 - m12 * m21)
+ m01 * (m12 * m20 - m10 * m22)
+ m02 * (m10 * m21 - m11 * m20);
return f;
}
/**
* Returns a string representation of this matrix
*/
public String toString() {
StringBuffer buf = new StringBuffer();
buf.append(m00).append(' ').append(m10).append(' ').append(m20).append(' ').append('\n');
buf.append(m01).append(' ').append(m11).append(' ').append(m21).append(' ').append('\n');
buf.append(m02).append(' ').append(m12).append(' ').append(m22).append(' ').append('\n');
return buf.toString();
}
/**
* Invert this matrix
* @return this if successful, null otherwise
*/
public Matrix invert()
{
float determinant = determinant();
if (determinant != 0)
{
/* do it the ordinary way
*
* inv(A) = 1/det(A) * adj(T), where adj(T) = transpose(Conjugate Matrix)
*
* m00 m01 m02
* m10 m11 m12
* m20 m21 m22
*/
float determinant_inv = 1f/determinant;
// get the conjugate matrix
float t00 = m11 * m22 - m12* m21;
float t01 = - m10 * m22 + m12 *m20;
float t02 = m10 * m21 - m11 * m20;
float t10 = - m01 * m22 + m02 * m21;
float t11 = m00 * m22 - m02 * m20;
float t12 = - m00 * m21 + m01 * m20;
float t20 = m01 * m12 - m02 * m11;
float t21 = -m00 * m12 + m02 * m10;
float t22 = m00 * m11 - m01 * m10;
m00 = t00*determinant_inv;
m11 = t11*determinant_inv;
m22 = t22*determinant_inv;
m01 = t10*determinant_inv;
m10 = t01*determinant_inv;
m20 = t02*determinant_inv;
m02 = t20*determinant_inv;
m12 = t21*determinant_inv;
m21 = t12*determinant_inv;
return this;
} else
return null;
}
/**
* Negate this matrix
* @return this
*/
public Matrix negate() {
m00 = -m00;
m01 = -m02;
m02 = -m01;
m10 = -m10;
m11 = -m12;
m12 = -m11;
m20 = -m20;
m21 = -m22;
m22 = -m21;
return this;
}
/**
* Negate this matrix and place the result in a destination matrix.
* @param dest The destination matrix, or null if a new matrix is to be created
* @return the negated matrix
*/
public Matrix3f negate(Matrix3f dest) {
if (dest == null)
dest = new Matrix3f();
dest.m00 = -m00;
dest.m01 = -m02;
dest.m02 = -m01;
dest.m10 = -m10;
dest.m11 = -m12;
dest.m12 = -m11;
dest.m20 = -m20;
dest.m21 = -m22;
dest.m22 = -m21;
return dest;
}
/**
* Set this matrix to be the identity matrix.
* @return this
*/
public Matrix setIdentity() {
m00 = 1.0f;
m01 = 0.0f;
m02 = 0.0f;
m10 = 0.0f;
m11 = 1.0f;
m12 = 0.0f;
m20 = 0.0f;
m21 = 0.0f;
m22 = 1.0f;
return this;
}
/**
* Set this matrix to 0.
* @return this
*/
public Matrix setZero() {
m00 = 0.0f;
m01 = 0.0f;
m02 = 0.0f;
m10 = 0.0f;
m11 = 0.0f;
m12 = 0.0f;
m20 = 0.0f;
m21 = 0.0f;
m22 = 0.0f;
return this;
}
}

View File

@ -0,0 +1,818 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Lightweight Java Game Library' 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.vector;
import java.io.Serializable;
import java.nio.FloatBuffer;
/**
* Holds a 4x4 float matrix.
*
* @author foo
*/
public class Matrix4f extends Matrix implements Serializable {
public float m00 = 1.0f, m01, m02, m03, m10, m11 = 1.0f, m12, m13, m20, m21, m22 = 1.0f, m23, m30, m31, m32, m33 = 1.0f;
/**
* Construct a Matrix4f
*/
public Matrix4f() {
super();
}
/**
* Returns a string representation of this matrix
*/
public String toString() {
StringBuffer buf = new StringBuffer();
buf.append(m00).append(' ').append(m10).append(' ').append(m20).append(' ').append(m30).append('\n');
buf.append(m01).append(' ').append(m11).append(' ').append(m21).append(' ').append(m31).append('\n');
buf.append(m02).append(' ').append(m12).append(' ').append(m22).append(' ').append(m32).append('\n');
buf.append(m03).append(' ').append(m13).append(' ').append(m23).append(' ').append(m33).append('\n');
return buf.toString();
}
/**
* Set this matrix to be the identity matrix.
* @return this
*/
public Matrix setIdentity() {
m00 = 1.0f;
m01 = 0.0f;
m02 = 0.0f;
m03 = 0.0f;
m10 = 0.0f;
m11 = 1.0f;
m12 = 0.0f;
m13 = 0.0f;
m20 = 0.0f;
m21 = 0.0f;
m22 = 1.0f;
m23 = 0.0f;
m30 = 0.0f;
m31 = 0.0f;
m32 = 0.0f;
m33 = 1.0f;
return this;
}
/**
* Set this matrix to 0.
* @return this
*/
public Matrix setZero() {
m00 = 0.0f;
m01 = 0.0f;
m02 = 0.0f;
m03 = 0.0f;
m10 = 0.0f;
m11 = 0.0f;
m12 = 0.0f;
m13 = 0.0f;
m20 = 0.0f;
m21 = 0.0f;
m22 = 0.0f;
m23 = 0.0f;
m30 = 0.0f;
m31 = 0.0f;
m32 = 0.0f;
m33 = 0.0f;
return this;
}
/**
* Load from another matrix4f
* @param src The source matrix
* @return this
*/
public Matrix4f load(Matrix4f src) {
m00 = src.m00;
m01 = src.m01;
m02 = src.m02;
m03 = src.m03;
m10 = src.m10;
m11 = src.m11;
m12 = src.m12;
m13 = src.m13;
m20 = src.m20;
m21 = src.m21;
m22 = src.m22;
m23 = src.m23;
m30 = src.m30;
m31 = src.m31;
m32 = src.m32;
m33 = src.m33;
return this;
}
/**
* Load from a float buffer. The buffer stores the matrix in column major
* (OpenGL) order.
*
* @param buf A float buffer to read from
* @return this
*/
public Matrix load(FloatBuffer buf) {
m00 = buf.get();
m01 = buf.get();
m02 = buf.get();
m03 = buf.get();
m10 = buf.get();
m11 = buf.get();
m12 = buf.get();
m13 = buf.get();
m20 = buf.get();
m21 = buf.get();
m22 = buf.get();
m23 = buf.get();
m30 = buf.get();
m31 = buf.get();
m32 = buf.get();
m33 = buf.get();
return this;
}
/**
* Load from a float buffer. The buffer stores the matrix in row major
* (maths) order.
*
* @param buf A float buffer to read from
* @return this
*/
public Matrix loadTranspose(FloatBuffer buf) {
m00 = buf.get();
m10 = buf.get();
m20 = buf.get();
m30 = buf.get();
m01 = buf.get();
m11 = buf.get();
m21 = buf.get();
m31 = buf.get();
m02 = buf.get();
m12 = buf.get();
m22 = buf.get();
m32 = buf.get();
m03 = buf.get();
m13 = buf.get();
m23 = buf.get();
m33 = buf.get();
return this;
}
/**
* Store this matrix in a float buffer. The matrix is stored in column
* major (openGL) order.
* @param buf The buffer to store this matrix in
*/
public Matrix store(FloatBuffer buf) {
buf.put(m00);
buf.put(m01);
buf.put(m02);
buf.put(m03);
buf.put(m10);
buf.put(m11);
buf.put(m12);
buf.put(m13);
buf.put(m20);
buf.put(m21);
buf.put(m22);
buf.put(m23);
buf.put(m30);
buf.put(m31);
buf.put(m32);
buf.put(m33);
return this;
}
/**
* Store this matrix in a float buffer. The matrix is stored in row
* major (maths) order.
* @param buf The buffer to store this matrix in
*/
public Matrix storeTranspose(FloatBuffer buf) {
buf.put(m00);
buf.put(m10);
buf.put(m20);
buf.put(m30);
buf.put(m01);
buf.put(m11);
buf.put(m21);
buf.put(m31);
buf.put(m02);
buf.put(m12);
buf.put(m22);
buf.put(m32);
buf.put(m03);
buf.put(m13);
buf.put(m23);
buf.put(m33);
return this;
}
/**
* Add two matrices together and place the result in a third matrix.
* @param left The left source matrix
* @param right The right source matrix
* @param dest The destination matrix, or null if a new one is to be created
* @return the destination matrix
*/
public static Matrix4f add(Matrix4f left, Matrix4f right, Matrix4f dest) {
Matrix4f temp = null;
if (dest == null)
dest = new Matrix4f();
else if (dest == left || dest == right) {
temp = dest;
dest = new Matrix4f();
}
dest.m00 = left.m00 + right.m00;
dest.m01 = left.m01 + right.m01;
dest.m02 = left.m02 + right.m02;
dest.m03 = left.m03 + right.m03;
dest.m10 = left.m10 + right.m10;
dest.m11 = left.m11 + right.m11;
dest.m12 = left.m12 + right.m12;
dest.m13 = left.m13 + right.m13;
dest.m20 = left.m20 + right.m20;
dest.m21 = left.m21 + right.m21;
dest.m22 = left.m22 + right.m22;
dest.m23 = left.m23 + right.m23;
dest.m30 = left.m30 + right.m30;
dest.m31 = left.m31 + right.m31;
dest.m32 = left.m32 + right.m32;
dest.m33 = left.m33 + right.m33;
if (temp != null) {
temp.load(dest);
return temp;
} else
return dest;
}
/**
* Subtract the right matrix from the left and place the result in a third matrix.
* @param left The left source matrix
* @param right The right source matrix
* @param dest The destination matrix, or null if a new one is to be created
* @return the destination matrix
*/
public static Matrix4f sub(Matrix4f left, Matrix4f right, Matrix4f dest) {
Matrix4f temp = null;
if (dest == null)
dest = new Matrix4f();
else if (dest == left || dest == right) {
temp = dest;
dest = new Matrix4f();
}
dest.m00 = left.m00 - right.m00;
dest.m01 = left.m01 - right.m01;
dest.m02 = left.m02 - right.m02;
dest.m03 = left.m03 - right.m03;
dest.m10 = left.m10 - right.m10;
dest.m11 = left.m11 - right.m11;
dest.m12 = left.m12 - right.m12;
dest.m13 = left.m13 - right.m13;
dest.m20 = left.m20 - right.m20;
dest.m21 = left.m21 - right.m21;
dest.m22 = left.m22 - right.m22;
dest.m23 = left.m23 - right.m23;
dest.m30 = left.m30 - right.m30;
dest.m31 = left.m31 - right.m31;
dest.m32 = left.m32 - right.m32;
dest.m33 = left.m33 - right.m33;
if (temp != null) {
temp.load(dest);
return temp;
} else
return dest;
}
/**
* Multiply the right matrix by the left and place the result in a third matrix.
* @param left The left source matrix
* @param right The right source matrix
* @param dest The destination matrix, or null if a new one is to be created
* @return the destination matrix
*/
public static Matrix4f mul(Matrix4f left, Matrix4f right, Matrix4f dest) {
Matrix4f temp = null;
if (dest == null)
dest = new Matrix4f();
else if (dest == left || dest == right) {
temp = dest;
dest = new Matrix4f();
}
dest.m00 = left.m00 * right.m00 + left.m10 * right.m01 + left.m20 * right.m02 + left.m30 * right.m03;
dest.m01 = left.m01 * right.m00 + left.m11 * right.m01 + left.m21 * right.m02 + left.m31 * right.m03;
dest.m02 = left.m02 * right.m00 + left.m12 * right.m01 + left.m22 * right.m02 + left.m32 * right.m03;
dest.m03 = left.m03 * right.m00 + left.m13 * right.m01 + left.m23 * right.m02 + left.m33 * right.m03;
dest.m10 = left.m00 * right.m10 + left.m10 * right.m11 + left.m20 * right.m12 + left.m30 * right.m13;
dest.m11 = left.m01 * right.m10 + left.m11 * right.m11 + left.m21 * right.m12 + left.m31 * right.m13;
dest.m12 = left.m02 * right.m10 + left.m12 * right.m11 + left.m22 * right.m12 + left.m32 * right.m13;
dest.m13 = left.m03 * right.m10 + left.m13 * right.m11 + left.m23 * right.m12 + left.m33 * right.m13;
dest.m20 = left.m00 * right.m20 + left.m10 * right.m21 + left.m20 * right.m22 + left.m30 * right.m23;
dest.m21 = left.m01 * right.m20 + left.m11 * right.m21 + left.m21 * right.m22 + left.m31 * right.m23;
dest.m22 = left.m02 * right.m20 + left.m12 * right.m21 + left.m22 * right.m22 + left.m32 * right.m23;
dest.m23 = left.m03 * right.m20 + left.m13 * right.m21 + left.m23 * right.m22 + left.m33 * right.m23;
dest.m30 = left.m00 * right.m30 + left.m10 * right.m31 + left.m20 * right.m32 + left.m30 * right.m33;
dest.m31 = left.m01 * right.m30 + left.m11 * right.m31 + left.m21 * right.m32 + left.m31 * right.m33;
dest.m32 = left.m02 * right.m30 + left.m12 * right.m31 + left.m22 * right.m32 + left.m32 * right.m33;
dest.m33 = left.m03 * right.m30 + left.m13 * right.m31 + left.m23 * right.m32 + left.m33 * right.m33;
if (temp != null) {
temp.load(dest);
return temp;
} else
return dest;
}
/**
* Transform a Vector by a matrix and return the result in a destination
* vector.
* @param left The left matrix
* @param right The right vector
* @param dest The destination vector, or null if a new one is to be created
* @return the destination vector
*/
public static Vector4f transform(Matrix4f left, Vector4f right, Vector4f dest) {
Vector4f temp = null;
if (dest == null)
dest = new Vector4f();
else if (dest == right) {
temp = dest;
dest = new Vector4f();
}
dest.x = left.m00 * right.x + left.m10 * right.y + left.m20 * right.z + left.m30 * right.w;
dest.y = left.m01 * right.x + left.m11 * right.y + left.m21 * right.z + left.m31 * right.w;
dest.z = left.m02 * right.x + left.m12 * right.y + left.m22 * right.z + left.m32 * right.w;
dest.w = left.m03 * right.x + left.m13 * right.y + left.m23 * right.z + left.m33 * right.w;
if (temp != null) {
temp.set(dest);
return temp;
} else
return dest;
}
/**
* Transpose this matrix
* @return this
*/
public Matrix transpose() {
float f = m10;
m10 = m01;
m01 = f;
f = m20;
m20 = m02;
m02 = f;
f = m30;
m30 = m03;
m03 = f;
f = m21;
m21 = m12;
m12 = f;
f = m31;
m31 = m13;
m13 = f;
f = m32;
m32 = m23;
m23 = f;
return this;
}
/**
* Translate this matrix
* @param vec The vector to translate by
* @return this
*/
public Matrix4f translate(Vector2f vec) {
m30 += m00 * vec.x + m10 * vec.y;
m31 += m01 * vec.x + m11 * vec.y;
m32 += m02 * vec.x + m12 * vec.y;
m33 += m03 * vec.x + m13 * vec.y;
return this;
}
/**
* Translate this matrix
* @param vec The vector to translate by
* @return this
*/
public Matrix4f translate(Vector3f vec) {
m30 += m00 * vec.x + m10 * vec.y + m20 * vec.z;
m31 += m01 * vec.x + m11 * vec.y + m21 * vec.z;
m32 += m02 * vec.x + m12 * vec.y + m22 * vec.z;
m33 += m03 * vec.x + m13 * vec.y + m23 * vec.z;
return this;
}
/**
* Scales this matrix
* @param vec The vector to scale by
* @return this
*/
public Matrix4f scale(Vector3f vec) {
m00 *= vec.x;
m01 *= vec.x;
m02 *= vec.x;
m03 *= vec.x;
m10 *= vec.y;
m11 *= vec.y;
m12 *= vec.y;
m13 *= vec.y;
m20 *= vec.z;
m21 *= vec.z;
m22 *= vec.z;
m23 *= vec.z;
return this;
}
/**
* Rotates the matrix around the given axis the specified angle
* @param angle the angle, in degrees.
* @param axis The vector representing the rotation axis. Must be normalized.
* @return this
*/
public Matrix4f rotate(float angle, Vector3f axis) {
float c = (float) Math.cos(angle);
float s = (float) Math.sin(angle);
float oneminusc = 1.0f - c;
float xy = axis.x*axis.y;
float yz = axis.y*axis.z;
float xz = axis.x*axis.z;
float xs = axis.x*s;
float ys = axis.y*s;
float zs = axis.z*s;
float f00 = axis.x*axis.x*oneminusc+c;
float f01 = xy*oneminusc+zs;
float f02 = xz*oneminusc-ys;
// n[3] not used
float f10 = xy*oneminusc-zs;
float f11 = axis.y*axis.y*oneminusc+c;
float f12 = yz*oneminusc+xs;
// n[7] not used
float f20 = xz*oneminusc+ys;
float f21 = yz*oneminusc-xs;
float f22 = axis.z*axis.z*oneminusc+c;
float t00 = m00 * f00 + m10 * f01 + m20 * f02;
float t01 = m01 * f00 + m11 * f01 + m21 * f02;
float t02 = m02 * f00 + m12 * f01 + m22 * f02;
float t03 = m03 * f00 + m13 * f01 + m23 * f02;
float t10 = m00 * f10 + m10 * f11 + m20 * f12;
float t11 = m01 * f10 + m11 * f11 + m21 * f12;
float t12 = m02 * f10 + m12 * f11 + m22 * f12;
float t13 = m03 * f10 + m13 * f11 + m23 * f12;
m20 = m00 * f20 + m10 * f21 + m20 * f22;
m21 = m01 * f20 + m11 * f21 + m21 * f22;
m22 = m02 * f20 + m12 * f21 + m22 * f22;
m23 = m03 * f20 + m13 * f21 + m23 * f22;
m00 = t00;
m01 = t01;
m02 = t02;
m03 = t03;
m10 = t10;
m11 = t11;
m12 = t12;
m13 = t13;
return this;
}
/**
* Rotates the matrix around the given axis the specified angle, and stores it in the specified destination
* @param angle the angle, in degrees.
* @param axis The vector representing the rotation axis. Must be normalized.
* @param dest The destination matrix or null if a new matrix is to be created
* @return The rotated matrix
*/
public Matrix4f rotate(float angle, Vector3f axis, Matrix4f dest) {
if (dest == null)
dest = new Matrix4f();
else if (dest == this)
return rotate(angle, axis);
float c = (float) Math.cos(angle);
float s = (float) Math.sin(angle);
float oneminusc = 1.0f - c;
float xy = axis.x*axis.y;
float yz = axis.y*axis.z;
float xz = axis.x*axis.z;
float xs = axis.x*s;
float ys = axis.y*s;
float zs = axis.z*s;
float f0 = axis.x*axis.x*oneminusc+c;
float f1 = xy*oneminusc+zs;
float f2 = xz*oneminusc-ys;
// n[3] not used
float f4 = xy*oneminusc-zs;
float f5 = axis.y*axis.y*oneminusc+c;
float f6 = yz*oneminusc+xs;
// n[7] not used
float f8 = xz*oneminusc+ys;
float f9 = yz*oneminusc-xs;
float f10 = axis.z*axis.z*oneminusc+c;
/* m[12] to m[15] are not changed by a rotate */
dest.m00 = m00 * f0 + m10 * f1 + m20 * f2;
dest.m01 = m01 * f0 + m11 * f1 + m21 * f2;
dest.m02 = m02 * f0 + m12 * f1 + m22 * f2;
dest.m03 = m03 * f0 + m13 * f1 + m23 * f2;
dest.m10 = m00 * f4 + m10 * f5 + m20 * f6;
dest.m11 = m01 * f4 + m11 * f5 + m21 * f6;
dest.m12 = m02 * f4 + m12 * f5 + m22 * f6;
dest.m13 = m03 * f4 + m13 * f5 + m23 * f6;
dest.m20 = m00 * f8 + m10 * f9 + m20 * f10;
dest.m21 = m01 * f8 + m11 * f9 + m21 * f10;
dest.m22 = m02 * f8 + m12 * f9 + m22 * f10;
dest.m23 = m03 * f8 + m13 * f9 + m23 * f10;
return dest;
}
/**
* Translate this matrix and stash the result in another matrix
* @param vec The vector to translate by
* @param dest The destination matrix or null if a new matrix is to be created
* @return the translated matrix
*/
public Matrix4f translate(Vector3f vec, Matrix4f dest) {
if (dest == null)
dest = new Matrix4f();
else if (dest == this)
return translate(vec);
dest.m30 += m00 * vec.x + m10 * vec.y + m20 * vec.z;
dest.m31 += m01 * vec.x + m11 * vec.y + m21 * vec.z;
dest.m32 += m02 * vec.x + m12 * vec.y + m22 * vec.z;
dest.m33 += m03 * vec.x + m13 * vec.y + m23 * vec.z;
return dest;
}
/**
* Translate this matrix and stash the result in another matrix
* @param vec The vector to translate by
* @param dest The destination matrix or null if a new matrix is to be created
* @return the translated matrix
*/
public Matrix4f translate(Vector2f vec, Matrix4f dest) {
if (dest == null)
dest = new Matrix4f();
else if (dest == this)
return translate(vec);
dest.m30 += m00 * vec.x + m10 * vec.y;
dest.m31 += m01 * vec.x + m11 * vec.y;
dest.m32 += m02 * vec.x + m12 * vec.y;
dest.m33 += m03 * vec.x + m13 * vec.y;
return dest;
}
/**
* Transpose this matrix and place the result in another matrix
* @param dest The destination matrix or null if a new matrix is to be created
* @return the transposed matrix
*/
public Matrix4f transpose(Matrix4f dest) {
if (this != dest) {
m00 = dest.m00;
m01 = dest.m10;
m02 = dest.m20;
m03 = dest.m30;
m10 = dest.m01;
m11 = dest.m11;
m12 = dest.m21;
m13 = dest.m31;
m20 = dest.m02;
m21 = dest.m12;
m22 = dest.m22;
m23 = dest.m32;
m30 = dest.m03;
m31 = dest.m13;
m32 = dest.m23;
m33 = dest.m33;
} else
transpose();
return dest;
}
/**
* @return the determinant of the matrix
*/
public float determinant() {
float f =
m00
* ((m11 * m22 * m33 + m12 * m23 * m31 + m13 * m21 * m32)
- m13 * m22 * m31
- m11 * m23 * m32
- m12 * m21 * m33);
f -= m01
* ((m10 * m22 * m33 + m12 * m23 * m30 + m13 * m20 * m32)
- m13 * m22 * m30
- m10 * m23 * m32
- m12 * m20 * m33);
f += m02
* ((m10 * m21 * m33 + m11 * m23 * m30 + m13 * m20 * m31)
- m13 * m21 * m30
- m10 * m23 * m31
- m11 * m20 * m33);
f -= m03
* ((m10 * m21 * m32 + m11 * m22 * m30 + m12 * m20 * m31)
- m12 * m21 * m30
- m10 * m22 * m31
- m11 * m20 * m32);
return f;
}
/**
* Calculate the determinant of a 3x3 matrix
* @return result
*/
private float determinant3x3(float t00, float t01, float t02,
float t10, float t11, float t12,
float t20, float t21, float t22)
{
return t00 * (t11 * t22 - t12 * t21)
+ t01 * (t12 * t20 - t10 * t22)
+ t02 * (t10 * t21 - t11 * t20);
}
/**
* Invert this matrix
* @return this if successful, null otherwise
*/
public Matrix invert() {
float determinant = determinant();
if (determinant != 0)
{
/*
* m00 m01 m02 m03
* m10 m11 m12 m13
* m20 m21 m22 m23
* m30 m31 m32 m33
*/
float determinant_inv = 1f/determinant;
// first row
float t00 = determinant3x3(m11, m12, m13, m21, m22, m23, m31, m32, m33);
float t01 = -determinant3x3(m10, m12, m13, m20, m22, m23, m30, m32, m33);
float t02 = determinant3x3(m10, m11, m13, m20, m21, m23, m30, m31, m33);
float t03 = -determinant3x3(m10, m11, m12, m20, m21, m22, m30, m31, m32);
// second row
float t10 = -determinant3x3(m01, m02, m03, m21, m22, m23, m31, m32, m33);
float t11 = determinant3x3(m00, m02, m03, m20, m22, m23, m30, m32, m33);
float t12 = -determinant3x3(m00, m01, m03, m20, m21, m23, m30, m31, m33);
float t13 = determinant3x3(m00, m01, m02, m20, m21, m22, m30, m31, m32);
// third row
float t20 = determinant3x3(m01, m02, m03, m11, m12, m13, m31, m32, m33);
float t21 = -determinant3x3(m00, m02, m03, m10, m12, m13, m30, m32, m33);
float t22 = determinant3x3(m00, m01, m03, m10, m11, m13, m30, m31, m33);
float t23 = -determinant3x3(m00, m01, m02, m10, m11, m12, m30, m31, m32);
// fourth row
float t30 = -determinant3x3(m01, m02, m03, m11, m12, m13, m21, m22, m23);
float t31 = determinant3x3(m00, m02, m03, m10, m12, m13, m20, m22, m23);
float t32 = -determinant3x3(m00, m01, m03, m10, m11, m13, m20, m21, m23);
float t33 = determinant3x3(m00, m01, m02, m10, m11, m12, m20, m21, m22);
// transpose and divide by the determinant
m00 = t00*determinant_inv;
m11 = t11*determinant_inv;
m22 = t22*determinant_inv;
m33 = t33*determinant_inv;
m01 = t10*determinant_inv;
m10 = t01*determinant_inv;
m20 = t02*determinant_inv;
m02 = t20*determinant_inv;
m12 = t21*determinant_inv;
m21 = t12*determinant_inv;
m03 = t30*determinant_inv;
m30 = t03*determinant_inv;
m13 = t31*determinant_inv;
m31 = t13*determinant_inv;
m32 = t23*determinant_inv;
m23 = t32*determinant_inv;
return this;
} else
return null;
}
/**
* Negate this matrix
* @return this
*/
public Matrix negate() {
m00 = -m00;
m01 = -m01;
m02 = -m02;
m03 = -m03;
m10 = -m10;
m11 = -m11;
m12 = -m12;
m13 = -m13;
m20 = -m20;
m21 = -m21;
m22 = -m22;
m23 = -m23;
m30 = -m30;
m31 = -m31;
m32 = -m32;
m33 = -m33;
return this;
}
/**
* Negate this matrix and place the result in a destination matrix.
* @param dest The destination matrix, or null if a new matrix is to be created
* @return the negated matrix
*/
public Matrix4f negate(Matrix4f dest) {
if (dest == null)
dest = new Matrix4f();
dest.m00 = -m00;
dest.m01 = -m01;
dest.m02 = -m02;
dest.m03 = -m03;
dest.m10 = -m10;
dest.m11 = -m11;
dest.m12 = -m12;
dest.m13 = -m13;
dest.m20 = -m20;
dest.m21 = -m21;
dest.m22 = -m22;
dest.m23 = -m23;
dest.m30 = -m30;
dest.m31 = -m31;
dest.m32 = -m32;
dest.m33 = -m33;
return dest;
}
}

View File

@ -0,0 +1,114 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Lightweight Java Game Library' 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.vector;
import java.io.Serializable;
import java.nio.FloatBuffer;
/**
* $Id$
*
* Base class for vectors.
*
* @author cix_foo <cix_foo@users.sourceforge.net>
* @version $Revision$
*/
public abstract class Vector implements Serializable {
/**
* Constructor for Vector.
*/
public Vector() {
super();
}
/**
* @return the length of the vector
*/
public final float length() {
return (float) Math.sqrt(lengthSquared());
}
/**
* @return the length squared of the vector
*/
public abstract float lengthSquared();
/**
* Load this vector from a FloatBuffer
* @param buf The buffer to load it from, at the current position
* @return this
*/
public abstract Vector load(FloatBuffer buf);
/**
* Negate a vector
* @return this
*/
public abstract Vector negate();
/**
* Normalise this vector
* @return this
*/
public final Vector normalize() {
float len = length();
if (len != 0.0f) {
float l = 1.0f / len;
return scale(l);
} else {
assert false;
return this;
}
}
/**
* Store this vector in a FloatBuffer
* @param buf The buffer to store it in, at the current position
* @return this
*/
public abstract Vector store(FloatBuffer buf);
/**
* Scale this vector
* @param scale The scale factor
* @return this
*/
public abstract Vector scale(float scale);
}

View File

@ -0,0 +1,244 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Lightweight Java Game Library' 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.vector;
import java.io.Serializable;
import java.nio.FloatBuffer;
/**
* $Id$
*
* Holds a 2-tuple vector.
*
* @author cix_foo <cix_foo@users.sourceforge.net>
* @version $Revision$
*/
public class Vector2f extends Vector implements Serializable {
public float x, y;
/**
* Constructor for Vector3f.
*/
public Vector2f() {
super();
}
/**
* Constructor
*/
public Vector2f(Vector2f src) {
set(src);
}
/**
* Constructor
*/
public Vector2f(float x, float y) {
set(x, y);
}
/**
* Set values
* @return this
*/
public Vector2f set(float x, float y) {
this.x = x;
this.y = y;
return this;
}
/**
* Load from another Vector2f
* @param src The source vector
* @return this
*/
public Vector2f set(Vector2f src) {
x = src.x;
y = src.y;
return this;
}
/**
* @return the length squared of the vector
*/
public float lengthSquared() {
return x * x + y * y;
}
/**
* Translate a vector
* @param x The translation in x
* @param y the translation in y
* @return this
*/
public Vector2f translate(float x, float y) {
this.x += x;
this.y += y;
return this;
}
/**
* Negate a vector
* @return this
*/
public Vector negate() {
x = -x;
y = -y;
return this;
}
/**
* Negate a vector and place the result in a destination vector.
* @param dest The destination vector or null if a new vector is to be created
* @return the negated vector
*/
public Vector2f negate(Vector2f dest) {
if (dest == null)
dest = new Vector2f();
dest.x = -x;
dest.y = -y;
return dest;
}
/**
* Normalise this vector and place the result in another vector.
* @param dest The destination vector, or null if a new vector is to be created
* @return the normalised vector
*/
public Vector2f normalise(Vector2f dest) {
float l = length();
if (dest == null)
dest = new Vector2f(x / l, y / l);
else
dest.set(x / l, y / l);
return dest;
}
/**
* The dot product of two vectors is calculated as
* v1.x * v2.x + v1.y * v2.y + v1.z * v2.z
* @param left The LHS vector
* @param right The RHS vector
* @return left dot right
*/
public static float dot(Vector2f left, Vector2f right) {
return left.x * right.x + left.y * right.y;
}
/**
* Calculate the angle between two vectors, in degrees
* @param a A vector
* @param b The other vector
* @return the angle between the two vectors, in degrees
*/
public static float angle(Vector2f a, Vector2f b) {
float dls = dot(a, b) / (a.length() * b.length());
if (dls < -1f)
dls = -1f;
else if (dls > 1.0f)
dls = 1.0f;
return (float) Math.toDegrees(Math.acos(dls));
}
/**
* Add a vector to another vector and place the result in a destination
* vector.
* @param left The LHS vector
* @param right The RHS vector
* @param dest The destination vector, or null if a new vector is to be created
* @return the sum of left and right in dest
*/
public static Vector2f add(Vector2f left, Vector2f right, Vector2f dest) {
if (dest == null)
return new Vector2f(left.x + right.x, left.y + right.y);
else {
return dest.set(left.x + right.x, left.y + right.y);
}
}
/**
* Subtract a vector from another vector and place the result in a destination
* vector.
* @param left The LHS vector
* @param right The RHS vector
* @param dest The destination vector, or null if a new vector is to be created
* @return left minus right in dest
*/
public static Vector2f sub(Vector2f left, Vector2f right, Vector2f dest) {
if (dest == null)
return new Vector2f(left.x - right.x, left.y - right.y);
else {
return dest.set(left.x - right.x, left.y - right.y);
}
}
/**
* Store this vector in a FloatBuffer
* @param buf The buffer to store it in, at the current position
* @return this
*/
public Vector store(FloatBuffer buf) {
buf.put(x);
buf.put(y);
return this;
}
/**
* Load this vector from a FloatBuffer
* @param buf The buffer to load it from, at the current position
* @return this
*/
public Vector load(FloatBuffer buf) {
x = buf.get();
y = buf.get();
return this;
}
/* (non-Javadoc)
* @see org.lwjgl.vector.Vector#scale(float)
*/
public Vector scale(float scale) {
x *= scale;
y *= scale;
return this;
}
}

View File

@ -0,0 +1,294 @@
/*
* Copyright (c) 2002 Lightweight Java Game Library 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 'Lightweight Java Game Library' 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.vector;
import java.io.Serializable;
import java.nio.FloatBuffer;
/**
* $Id$
*
* Holds a 3-tuple vector.
*
* @author cix_foo <cix_foo@users.sourceforge.net>
* @version $Revision$
*/
public class Vector3f extends Vector implements Serializable {
public float x, y, z;
/**
* Constructor for Vector3f.
*/
public Vector3f() {
super();
}
/**
* Constructor
*/
public Vector3f(Vector3f src) {
set(src);
}
/**
* Constructor
*/
public Vector3f(float x, float y, float z) {
set(x, y, z);
}
/**
* Set values
* @return this
*/
public Vector3f set(float x, float y, float z) {
this.x = x;
this.y = y;
this.z = z;
return this;
}
/**
* Load from another Vector3f
* @param src The source vector
* @return this
*/
public Vector3f set(Vector3f src) {
x = src.x;
y = src.y;
z = src.z;
return this;
}
/**
* @return the length squared of the vector
*/
public float lengthSquared() {
return x * x + y * y + z * z;
}
/**
* Translate a vector
* @param x The translation in x
* @param y the translation in y
* @return this
*/
public Vector3f translate(float x, float y, float z) {
this.x += x;
this.y += y;
this.z += z;
return this;
}
/**
* Add a vector to another vector and place the result in a destination
* vector.
* @param left The LHS vector
* @param right The RHS vector
* @param dest The destination vector, or null if a new vector is to be created
* @return the sum of left and right in dest
*/
public static Vector3f add(Vector3f left, Vector3f right, Vector3f dest) {
if (dest == null)
return new Vector3f(left.x + right.x, left.y + right.y, left.z + right.z);
else {
return dest.set(left.x + right.x, left.y + right.y, left.z + right.z);
}
}
/**
* Subtract a vector from another vector and place the result in a destination
* vector.
* @param left The LHS vector
* @param right The RHS vector
* @param dest The destination vector, or null if a new vector is to be created
* @return left minus right in dest
*/
public static Vector3f sub(Vector3f left, Vector3f right, Vector3f dest) {
if (dest == null)
return new Vector3f(left.x - right.x, left.y - right.y, left.z - right.z);
else {
return dest.set(left.x - right.x, left.y - right.y, left.z - right.z);
}
}
/**
* The cross product of two vectors.
*
* @param left The LHS vector
* @param right The RHS vector
* @param dest The destination result, or null if a new vector is to be created
* @return left cross right
*/
public static Vector3f cross(
Vector3f left,
Vector3f right,
Vector3f dest)
{
if (dest == null)
dest = new Vector3f();
dest.set(
left.y * right.z - left.z * right.y,
right.x * left.z - right.z * left.x,
left.x * right.y - left.y * right.x
);
return dest;
}
/**
* Negate a vector
* @return this
*/
public Vector negate() {
x = -x;
y = -y;
z = -z;
return this;
}
/**
* Negate a vector and place the result in a destination vector.
* @param dest The destination vector or null if a new vector is to be created
* @return the negated vector
*/
public Vector3f negate(Vector3f dest) {
if (dest == null)
dest = new Vector3f();
dest.x = -x;
dest.y = -y;
dest.z = -z;
return dest;
}
/**
* Normalise this vector and place the result in another vector.
* @param dest The destination vector, or null if a new vector is to be created
* @return the normalised vector
*/
public Vector3f normalise(Vector3f dest) {
float l = length();
if (dest == null)
dest = new Vector3f(x / l, y / l, z / l);
else
dest.set(x / l, y / l, z / l);
return dest;
}
/**
* The dot product of two vectors is calculated as
* v1.x * v2.x + v1.y * v2.y + v1.z * v2.z
* @param left The LHS vector
* @param right The RHS vector
* @return left dot right
*/
public static float dot(Vector3f left, Vector3f right) {
return left.x * right.x + left.y * right.y + left.z * right.z;
}
/**
* Calculate the angle between two vectors, in degrees
* @param a A vector
* @param b The other vector
* @return the angle between the two vectors, in degrees
*/
public static float angle(Vector3f a, Vector3f b) {
float dls = dot(a, b) / (a.length() * b.length());
if (dls < -1f)
dls = -1f;
else if (dls > 1.0f)
dls = 1.0f;
return (float) Math.toDegrees(Math.acos(dls));
}
/* (non-Javadoc)
* @see org.lwjgl.vector.Vector#load(FloatBuffer)
*/
public Vector load(FloatBuffer buf) {
x = buf.get();
y = buf.get();
z = buf.get();
return this;
}
/* (non-Javadoc)
* @see org.lwjgl.vector.Vector#scale(float)
*/
public Vector scale(float scale) {
x *= scale;
y *= scale;
z *= scale;
return this;
}
/* (non-Javadoc)
* @see org.lwjgl.vector.Vector#store(FloatBuffer)
*/
public Vector store(FloatBuffer buf) {
buf.put(x);
buf.put(y);
buf.put(z);
return this;
}
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
public String toString() {
StringBuffer sb = new StringBuffer(64);
sb.append("Vector3f[");
sb.append(x);
sb.append(", ");
sb.append(y);
sb.append(", ");
sb.append(z);
sb.append(']');
return sb.toString();
}
}