diff options
author | Kenneth Russel <[email protected]> | 2005-07-18 21:28:47 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2005-07-18 21:28:47 +0000 |
commit | 5e36587af91f43faff49f4ff61c40cf084bae298 (patch) | |
tree | afa7bf5f33e96520ffe71d26ef3bede13a67c515 /src/net/java/games/jogl/impl/windows/WindowsPbufferGLDrawable.java | |
parent | 9ccfb4b547a75be721d9bbc2d760e51f170832cd (diff) |
Implemented pbuffer instantiation support in GLDrawableFactory rather
than GLCanvas on Windows. Restructured GLJPanel and jogl-demos to use
new APIs. Still needs to be ported to other platforms.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JSR-231@326 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/net/java/games/jogl/impl/windows/WindowsPbufferGLDrawable.java')
-rw-r--r-- | src/net/java/games/jogl/impl/windows/WindowsPbufferGLDrawable.java | 68 |
1 files changed, 37 insertions, 31 deletions
diff --git a/src/net/java/games/jogl/impl/windows/WindowsPbufferGLDrawable.java b/src/net/java/games/jogl/impl/windows/WindowsPbufferGLDrawable.java index 6917b281d..d91feb27c 100644 --- a/src/net/java/games/jogl/impl/windows/WindowsPbufferGLDrawable.java +++ b/src/net/java/games/jogl/impl/windows/WindowsPbufferGLDrawable.java @@ -54,7 +54,11 @@ public class WindowsPbufferGLDrawable extends WindowsGLDrawable { private int floatMode; - public WindowsPbufferGLDrawable(GLCapabilities capabilities, int initialWidth, int initialHeight) { + public WindowsPbufferGLDrawable(GLCapabilities capabilities, + int initialWidth, + int initialHeight, + WindowsGLDrawable dummyDrawable, + GL gl) { super(null, capabilities, null); this.initWidth = initialWidth; this.initHeight = initialHeight; @@ -69,6 +73,8 @@ public class WindowsPbufferGLDrawable extends WindowsGLDrawable { (capabilities.getOffscreenRenderToTextureRectangle() ? " [rect]" : "") + (capabilities.getOffscreenFloatingPointBuffers() ? " [float]" : "")); } + + createPbuffer(dummyDrawable.getHDC(), gl); } public GLContext createContext(GLContext shareWith) { @@ -106,7 +112,36 @@ public class WindowsPbufferGLDrawable extends WindowsGLDrawable { return height; } - public void createPbuffer(GL gl, long parentHdc) { + public GLCapabilities getCapabilities() { + return capabilities; + } + + public long getPbuffer() { + return buffer; + } + + public int getFloatingPointMode() { + return floatMode; + } + + public void swapBuffers() throws GLException { + // FIXME: this doesn't make sense any more because we don't have + // access to our OpenGL context here + /* + // FIXME: do we need to do anything if the pbuffer is double-buffered? + // For now, just grab the pixels for the render-to-texture support. + if (rtt && !hasRTT) { + if (DEBUG) { + System.err.println("Copying pbuffer data to GL_TEXTURE_2D state"); + } + + GL gl = getGL(); + gl.glCopyTexSubImage2D(textureTarget, 0, 0, 0, 0, 0, width, height); + } + */ + } + + private void createPbuffer(long parentHdc, GL gl) { int[] iattributes = new int [2*MAX_ATTRIBS]; float[] fattributes = new float[2*MAX_ATTRIBS]; int nfattribs = 0; @@ -358,35 +393,6 @@ public class WindowsPbufferGLDrawable extends WindowsGLDrawable { } } - public GLCapabilities getCapabilities() { - return capabilities; - } - - public long getPbuffer() { - return buffer; - } - - public int getFloatingPointMode() { - return floatMode; - } - - public void swapBuffers() throws GLException { - // FIXME: this doesn't make sense any more because we don't have - // access to our OpenGL context here - /* - // FIXME: do we need to do anything if the pbuffer is double-buffered? - // For now, just grab the pixels for the render-to-texture support. - if (rtt && !hasRTT) { - if (DEBUG) { - System.err.println("Copying pbuffer data to GL_TEXTURE_2D state"); - } - - GL gl = getGL(); - gl.glCopyTexSubImage2D(textureTarget, 0, 0, 0, 0, 0, width, height); - } - */ - } - private static String wglGetLastError() { return WindowsGLContextFactory.wglGetLastError(); } |