aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes/com/sun/opengl/impl/windows/wgl
diff options
context:
space:
mode:
Diffstat (limited to 'src/classes/com/sun/opengl/impl/windows/wgl')
-rw-r--r--src/classes/com/sun/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java12
-rw-r--r--src/classes/com/sun/opengl/impl/windows/wgl/WindowsOnscreenWGLDrawable.java4
-rw-r--r--src/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java20
-rw-r--r--src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java6
4 files changed, 15 insertions, 27 deletions
diff --git a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java
index 8dded7069..38215fd46 100644
--- a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java
+++ b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java
@@ -48,20 +48,18 @@ public class WindowsOffscreenWGLDrawable extends WindowsWGLDrawable {
public WindowsOffscreenWGLDrawable(GLDrawableFactory factory,
GLCapabilities requestedCapabilities,
- GLCapabilitiesChooser chooser) {
+ GLCapabilitiesChooser chooser,
+ int width,
+ int height) {
super(factory, new NullWindow(), true, requestedCapabilities, chooser);
+ ((NullWindow) getNativeWindow()).setSize(width, height);
+ create();
}
public GLContext createContext(GLContext shareWith) {
return new WindowsOffscreenWGLContext(this, shareWith);
}
- public void setSize(int newWidth, int newHeight) {
- super.setSize(newWidth, newHeight);
- destroy();
- create();
- }
-
private void create() {
getFactoryImpl().lockToolkit();
try {
diff --git a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsOnscreenWGLDrawable.java b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsOnscreenWGLDrawable.java
index 145858d5d..52812f0e9 100644
--- a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsOnscreenWGLDrawable.java
+++ b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsOnscreenWGLDrawable.java
@@ -62,10 +62,6 @@ public class WindowsOnscreenWGLDrawable extends WindowsWGLDrawable {
return new WindowsOnscreenWGLContext(this, shareWith);
}
- public void setSize(int width, int height) {
- component.setSize(width, height);
- }
-
public int getWidth() {
return component.getWidth();
}
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 40e46a232..f82653bcd 100644
--- a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java
+++ b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java
@@ -52,17 +52,17 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
public WindowsPbufferWGLDrawable(GLDrawableFactory factory,
GLCapabilities requestedCapabilities,
- int initialWidth,
- int initialHeight,
+ int width,
+ int height,
WindowsWGLDrawable dummyDrawable,
WGLExt wglExt) {
super(factory, new NullWindow(), true, requestedCapabilities, null);
- if (initialWidth <= 0 || initialHeight <= 0) {
- throw new GLException("Initial width and height of pbuffer must be positive (were (" +
- initialWidth + ", " + initialHeight + "))");
+ if (width <= 0 || height <= 0) {
+ throw new GLException("Width and height of pbuffer must be positive (were (" +
+ width + ", " + height + "))");
}
NullWindow nw = (NullWindow) getNativeWindow();
- nw.setSize(initialWidth, initialHeight);
+ nw.setSize(width, height);
if (DEBUG) {
System.out.println("Pbuffer caps on init: " + requestedCapabilities +
@@ -104,14 +104,6 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
super.destroy();
}
- public void setSize(int newWidth, int newHeight) {
- super.setSize(newWidth, newHeight);
- destroy();
- if(cachedParentHdc!=0 && cachedWGLExt!=null) {
- createPbuffer(cachedParentHdc, cachedWGLExt);
- }
- }
-
public long getPbuffer() {
return buffer;
}
diff --git a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java
index 762714690..4fe0900a6 100644
--- a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java
+++ b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java
@@ -80,8 +80,10 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
}
public GLDrawableImpl createOffscreenDrawable(GLCapabilities capabilities,
- GLCapabilitiesChooser chooser) {
- return new WindowsOffscreenWGLDrawable(this, capabilities, chooser);
+ GLCapabilitiesChooser chooser,
+ int width,
+ int height) {
+ return new WindowsOffscreenWGLDrawable(this, capabilities, chooser, width, height);
}
private boolean pbufferSupportInitialized = false;