aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2008-07-04 23:08:49 +0000
committerSven Gothel <[email protected]>2008-07-04 23:08:49 +0000
commit37208ef3dcf1a12468838106d578e6abbf3dda9b (patch)
treea6a9205f77f8b8489d662e1cbbb265cd3383c67a /src/classes
parentf08608ab753588728f1ee9d3d2d3920087107b98 (diff)
GL Unification 2nd round.
Terminology: ARB Extensions: "GL2", "ARB", "OES", "OML" Vendor Extensions: "EXT", "NV", "ATI", "SGI", "SGIS", "SGIX", "HP", "IBM", "WIN" Pass-1 Unify ARB extensions with the same value Pass-2 Unify vendor extensions, if exist as an ARB extension with the same value. Pass-3 Emit Done: - Unification of GL enumerates - Unification of GL functions - dynamic extension lookup - .. TODO: - Break down GL.java: GL + GL2ES1ES2 (for future GL3, etc) - Add a GL2 small implementation, to only support the GL2ES2 subset, 'GL2SubES2' .. +++ - Fixed X11 build breakage of 'jawt' linkage. - Fixed NEWT native code mouse- and keyevent id's, missed sync while moving them from the bitfield notation. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1708 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes')
-rw-r--r--src/classes/com/sun/opengl/impl/GLContextImpl.java3
-rw-r--r--src/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLContext.java4
-rw-r--r--src/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java24
-rw-r--r--src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawable.java16
-rw-r--r--src/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawableFactory.java3
-rw-r--r--src/classes/javax/media/opengl/GLProfile.java5
6 files changed, 29 insertions, 26 deletions
diff --git a/src/classes/com/sun/opengl/impl/GLContextImpl.java b/src/classes/com/sun/opengl/impl/GLContextImpl.java
index fd3b73b42..ffdf81f1a 100644
--- a/src/classes/com/sun/opengl/impl/GLContextImpl.java
+++ b/src/classes/com/sun/opengl/impl/GLContextImpl.java
@@ -44,6 +44,7 @@ import java.lang.reflect.*;
import javax.media.opengl.*;
import com.sun.gluegen.runtime.*;
+import com.sun.gluegen.runtime.opengl.*;
public abstract class GLContextImpl extends GLContext {
protected GLContextLock lock = new GLContextLock();
@@ -302,7 +303,7 @@ public abstract class GLContextImpl extends GLContext {
/** Helper routine which resets a ProcAddressTable generated by the
GLEmitter by looking up anew all of its function pointers. */
protected void resetProcAddressTable(Object table) {
- ProcAddressHelper.resetProcAddressTable(table, (GLDrawableFactoryImpl)getGLDrawable().getFactory());
+ GLProcAddressHelper.resetProcAddressTable(table, (GLDrawableFactoryImpl)getGLDrawable().getFactory());
}
/** Indicates whether the underlying OpenGL context has been
diff --git a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLContext.java b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLContext.java
index f6be43f57..429f67abd 100644
--- a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLContext.java
+++ b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLContext.java
@@ -68,7 +68,7 @@ public class WindowsPbufferWGLContext extends WindowsWGLContext {
WGLExt wglExt = getWGLExt();
gl.glBindTexture(textureTarget, texture);
if (rtt && hasRTT) {
- if (!wglExt.wglBindTexImageARB(drawable.getPbuffer(), WGLExt.WGL_FRONT_LEFT)) {
+ if (!wglExt.wglBindTexImage(drawable.getPbuffer(), WGLExt.WGL_FRONT_LEFT)) {
throw new GLException("Binding of pbuffer to texture failed: " + wglGetLastError());
}
}
@@ -84,7 +84,7 @@ public class WindowsPbufferWGLContext extends WindowsWGLContext {
}
if (rtt && hasRTT) {
WGLExt wglExt = getWGLExt();
- if (!wglExt.wglReleaseTexImageARB(drawable.getPbuffer(), WGLExt.WGL_FRONT_LEFT)) {
+ if (!wglExt.wglReleaseTexImage(drawable.getPbuffer(), WGLExt.WGL_FRONT_LEFT)) {
throw new GLException("Releasing of pbuffer from texture failed: " + wglGetLastError());
}
}
diff --git a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java
index 0cc8133d8..cda810d86 100644
--- a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java
+++ b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java
@@ -88,11 +88,11 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
// not be called here, so we skip the use of any composable
// pipelines (see WindowsOnscreenWGLContext.makeCurrentImpl)
WGLExt wglExt = cachedWGLExt;
- if (wglExt.wglReleasePbufferDCARB(buffer, nw.getSurfaceHandle()) == 0) {
+ if (wglExt.wglReleasePbufferDC(buffer, nw.getSurfaceHandle()) == 0) {
throw new GLException("Error releasing pbuffer device context: error code " + WGL.GetLastError());
}
nw.setSurfaceHandle(0);
- if (!wglExt.wglDestroyPbufferARB(buffer)) {
+ if (!wglExt.wglDestroyPbuffer(buffer)) {
throw new GLException("Error destroying pbuffer: error code " + WGL.GetLastError());
}
buffer = 0;
@@ -177,13 +177,13 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
int[] pformats = new int[MAX_PFORMATS];
int nformats;
int[] nformatsTmp = new int[1];
- if (!wglExt.wglChoosePixelFormatARB(parentHdc,
+ if (!wglExt.wglChoosePixelFormat(parentHdc,
iattributes, 0,
fattributes, 0,
MAX_PFORMATS,
pformats, 0,
nformatsTmp, 0)) {
- throw new GLException("pbuffer creation error: wglChoosePixelFormatARB() failed");
+ throw new GLException("pbuffer creation error: wglChoosePixelFormat() failed");
}
nformats = nformatsTmp[0];
if (nformats <= 0) {
@@ -206,7 +206,7 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
iattributes[8] = WGLExt.WGL_DRAW_TO_PBUFFER;
int[] ivalues = new int[9];
for (int i = 0; i < nformats; i++) {
- if (!wglExt.wglGetPixelFormatAttribivARB(parentHdc, pformats[i], 0, 9, iattributes, 0, ivalues, 0)) {
+ if (!wglExt.wglGetPixelFormatAttribiv(parentHdc, pformats[i], 0, 9, iattributes, 0, ivalues, 0)) {
throw new GLException("Error while querying pixel format " + pformats[i] +
"'s (index " + i + "'s) capabilities for debugging");
}
@@ -270,7 +270,7 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
iattributes[niattribs++] = 0;
- tmpBuffer = wglExt.wglCreatePbufferARB(parentHdc, format, getWidth(), getHeight(), iattributes, 0);
+ tmpBuffer = wglExt.wglCreatePbuffer(parentHdc, format, getWidth(), getHeight(), iattributes, 0);
if (tmpBuffer != 0) {
// Done
break;
@@ -278,14 +278,14 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
}
if (tmpBuffer == 0) {
- throw new GLException("pbuffer creation error: wglCreatePbufferARB() failed: tried " + nformats +
+ throw new GLException("pbuffer creation error: wglCreatePbuffer() failed: tried " + nformats +
" pixel formats, last error was: " + wglGetLastError());
}
// Get the device context.
- long tmpHdc = wglExt.wglGetPbufferDCARB(tmpBuffer);
+ long tmpHdc = wglExt.wglGetPbufferDC(tmpBuffer);
if (tmpHdc == 0) {
- throw new GLException("pbuffer creation error: wglGetPbufferDCARB() failed");
+ throw new GLException("pbuffer creation error: wglGetPbufferDC() failed");
}
NullWindow nw = (NullWindow) getNativeWindow();
@@ -317,16 +317,16 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
iattributes[niattribs++] = WGLExt.WGL_DRAW_TO_PBUFFER;
int[] ivalues = new int[niattribs];
// FIXME: usually prefer to throw exceptions, but failure here is not critical
- if (wglExt.wglGetPixelFormatAttribivARB(parentHdc, pformats[whichFormat], 0, niattribs, iattributes, 0, ivalues, 0)) {
+ if (wglExt.wglGetPixelFormatAttribiv(parentHdc, pformats[whichFormat], 0, niattribs, iattributes, 0, ivalues, 0)) {
setChosenGLCapabilities(iattributes2GLCapabilities(iattributes, niattribs, ivalues, false));
}
}
// Determine the actual width and height we were able to create.
int[] tmp = new int[1];
- wglExt.wglQueryPbufferARB( buffer, WGLExt.WGL_PBUFFER_WIDTH, tmp, 0 );
+ wglExt.wglQueryPbuffer( buffer, WGLExt.WGL_PBUFFER_WIDTH, tmp, 0 );
width = tmp[0];
- wglExt.wglQueryPbufferARB( buffer, WGLExt.WGL_PBUFFER_HEIGHT, tmp, 0 );
+ wglExt.wglQueryPbuffer( buffer, WGLExt.WGL_PBUFFER_HEIGHT, tmp, 0 );
height = tmp[0];
nw.setSize(width, height);
} finally {
diff --git a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawable.java b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawable.java
index 3b69ad3a2..2e6d03e93 100644
--- a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawable.java
+++ b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawable.java
@@ -163,12 +163,12 @@ public abstract class WindowsWGLDrawable extends GLDrawableImpl {
null)) {
int[] pformats = new int[MAX_PFORMATS];
int[] numFormatsTmp = new int[1];
- if (dummyWGLExt.wglChoosePixelFormatARB(hdc,
- iattributes, 0,
- fattributes, 0,
- MAX_PFORMATS,
- pformats, 0,
- numFormatsTmp, 0)) {
+ if (dummyWGLExt.wglChoosePixelFormat(hdc,
+ iattributes, 0,
+ fattributes, 0,
+ MAX_PFORMATS,
+ pformats, 0,
+ numFormatsTmp, 0)) {
numFormats = numFormatsTmp[0];
if (numFormats > 0) {
// Remove one-basing of pixel format (added on later)
@@ -204,7 +204,7 @@ public abstract class WindowsWGLDrawable extends GLDrawableImpl {
// window, to a pbuffer, or to a pixmap)
int niattribs = 0;
iattributes[0] = WGLExt.WGL_NUMBER_PIXEL_FORMATS;
- if (dummyWGLExt.wglGetPixelFormatAttribivARB(hdc, 0, 0, 1, iattributes, 0, iresults, 0)) {
+ if (dummyWGLExt.wglGetPixelFormatAttribiv(hdc, 0, 0, 1, iattributes, 0, iresults, 0)) {
numFormats = iresults[0];
if (DEBUG) {
@@ -238,7 +238,7 @@ public abstract class WindowsWGLDrawable extends GLDrawableImpl {
availableCaps = new GLCapabilities[numFormats];
for (int i = 0; i < numFormats; i++) {
- if (!dummyWGLExt.wglGetPixelFormatAttribivARB(hdc, i+1, 0, niattribs, iattributes, 0, iresults, 0)) {
+ if (!dummyWGLExt.wglGetPixelFormatAttribiv(hdc, i+1, 0, niattribs, iattributes, 0, iresults, 0)) {
throw new GLException("Error getting pixel format attributes for pixel format " + (i + 1) + " of device context");
}
availableCaps[i] = iattributes2GLCapabilities(iattributes, niattribs, iresults, true);
diff --git a/src/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawableFactory.java b/src/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawableFactory.java
index e9e4fc055..3ba3f060f 100644
--- a/src/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawableFactory.java
+++ b/src/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawableFactory.java
@@ -41,6 +41,7 @@ import java.security.*;
import java.util.*;
import javax.media.opengl.*;
import com.sun.gluegen.runtime.*;
+import com.sun.gluegen.runtime.opengl.*;
import com.sun.opengl.impl.*;
import com.sun.opengl.impl.x11.*;
@@ -97,7 +98,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
super();
// Must initialize GLX support eagerly in case a pbuffer is the
// first thing instantiated
- ProcAddressHelper.resetProcAddressTable(GLX.getGLXProcAddressTable(), this);
+ GLProcAddressHelper.resetProcAddressTable(GLX.getGLXProcAddressTable(), this);
}
private static final int MAX_ATTRIBS = 128;
diff --git a/src/classes/javax/media/opengl/GLProfile.java b/src/classes/javax/media/opengl/GLProfile.java
index c2c82f018..21dccc8ed 100644
--- a/src/classes/javax/media/opengl/GLProfile.java
+++ b/src/classes/javax/media/opengl/GLProfile.java
@@ -64,8 +64,9 @@ public class GLProfile {
throw new GLException("com.sun.opengl.impl.egl.EGLDrawableFactory not available");
}
}
- } catch (Exception e) {
- System.out.println("Profile: "+profile+" not available");
+ } catch (Throwable e) {
+ System.out.println("Profile: "+profile+" not available.");
+ System.out.println("\t"+e);
profile=null;
}
}