diff options
author | Sven Gothel <[email protected]> | 2001-12-06 09:18:00 +0000 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2001-12-06 09:18:00 +0000 |
commit | 8fdc4baaee82a63247a9f4203dace4ee910881bb (patch) | |
tree | f9ff045a8756d695c3afafadb5256c86813eecef /gl4java/swing/GLJPanel.java | |
parent | 5a67c0f5302dbd445d744450db58d1122096b742 (diff) |
2.8.1 rc 0rel-2-8-1-0-rc
Diffstat (limited to 'gl4java/swing/GLJPanel.java')
-rw-r--r-- | gl4java/swing/GLJPanel.java | 55 |
1 files changed, 30 insertions, 25 deletions
diff --git a/gl4java/swing/GLJPanel.java b/gl4java/swing/GLJPanel.java index d13cc89..011e381 100644 --- a/gl4java/swing/GLJPanel.java +++ b/gl4java/swing/GLJPanel.java @@ -359,11 +359,11 @@ public class GLJPanel extends JPanel cvsDispose();
}
preInit();
- glj = GLContext.createOffScreenCtx ( this, gl, glu,
+ glj = GLContext.createOffScreenCtx ( gl, glu,
stereoView,
rgba, stencilBits, accumSize,
sharedGLContext,
- offScrnSize
+ getSize()
);
if(glj!=null)
@@ -387,7 +387,7 @@ public class GLJPanel extends JPanel (float)col.getGreen()/255.0f,
(float)col.getBlue()/255.0f, 0.0f);
init();
- Dimension size = size=getSize();
+ Dimension size = getSize();
reshape(size.width, size.height);
// fetch the top-level window ,
@@ -472,12 +472,7 @@ public class GLJPanel extends JPanel if(mustResize)
{
mustResize=false;
- Dimension size = null;
-
- if(customOffScrnSize)
- size=offScrnSize;
- else
- size=getSize();
+ Dimension size = getSize();
reshape(size.width, size.height);
/*
@@ -496,12 +491,7 @@ public class GLJPanel extends JPanel glj.gljCheckGL();
}
- Dimension size = null;
-
- if(customOffScrnSize)
- size=offScrnSize;
- else
- size=getSize();
+ Dimension size = getSize();
int w=size.width;
int h=size.height;
@@ -512,10 +502,25 @@ public class GLJPanel extends JPanel {
GLCapabilities caps = glj.getGLCapabilities();
- if(caps.getAlphaBits()>0)
- awtFormat = BufferedImage.TYPE_4BYTE_ABGR;
- else
- awtFormat = BufferedImage.TYPE_3BYTE_BGR;
+ switch ( GLContext.getNativeOSType() )
+ {
+ case GLContext.OsWindoof:
+ if(caps.getAlphaBits()>0)
+ awtFormat = BufferedImage.TYPE_INT_ARGB;
+ else
+ awtFormat = BufferedImage.TYPE_INT_RGB;
+ break;
+ case GLContext.OsX11:
+ case GLContext.OsMac9:
+ case GLContext.OsMacX:
+ case GLContext.OsUnknown:
+ default:
+ if(caps.getAlphaBits()>0)
+ awtFormat = BufferedImage.TYPE_4BYTE_ABGR;
+ else
+ awtFormat = BufferedImage.TYPE_3BYTE_BGR;
+ break;
+ }
if(offImage!=null)
offImage.flush();
@@ -539,27 +544,27 @@ public class GLJPanel extends JPanel break;
case BufferedImage.TYPE_4BYTE_ABGR:
if(GLContext.gljClassDebug)
- System.out.println("awt=4BYTE_ABGR, gl=BGRA,UNSIGNED_INT_8_8_8_8");
+ System.out.println("awt=4BYTE_ABGR, gl=BGRA,UNSIGNED_BYTE");
glFormat = GL_BGRA;
- glType = GL_UNSIGNED_INT_8_8_8_8;
+ glType = GL_UNSIGNED_BYTE;
glComps = 4;
dbByte = (DataBufferByte)
offImage.getRaster().getDataBuffer();
break;
case BufferedImage.TYPE_INT_RGB:
if(GLContext.gljClassDebug)
- System.out.println("awt=INT_RGB, gl=BGRA,UNSIGNED_INT_8_8_8_8_REV");
+ System.out.println("awt=INT_RGB, gl=BGRA,UNSIGNED_BYTE");
glFormat = GL_BGRA;
- glType = GL_UNSIGNED_INT_8_8_8_8_REV;
+ glType = GL_UNSIGNED_BYTE;
glComps = 4;
dbInt = (DataBufferInt)
offImage.getRaster().getDataBuffer();
break;
case BufferedImage.TYPE_INT_ARGB:
if(GLContext.gljClassDebug)
- System.out.println("awt=INT_ARGB, gl=BGRA,INT_8_8_8_8_REV");
+ System.out.println("awt=INT_ARGB, gl=BGRA,UNSIGNED_BYTE");
glFormat = GL_BGRA;
- glType = GL_UNSIGNED_INT_8_8_8_8_REV;
+ glType = GL_UNSIGNED_BYTE;
glComps = 4;
dbInt = (DataBufferInt)
offImage.getRaster().getDataBuffer();
|