29 import java.awt.GraphicsConfiguration; 30 import java.awt.GraphicsDevice; 31 import java.awt.GraphicsEnvironment; 32 import java.awt.Image; 33 import java.awt.Rectangle; 34 import java.awt.geom.AffineTransform; 35 import java.awt.image.ColorModel; 36 import sun.awt.SunToolkit; 37 import sun.awt.Win32GraphicsDevice; 38 import sun.awt.windows.WComponentPeer; 39 import sun.java2d.SurfaceData; 40 import sun.java2d.pipe.Region; 41 42 public abstract class WGLSurfaceData extends OGLSurfaceData { 43 44 protected WComponentPeer peer; 45 private WGLGraphicsConfig graphicsConfig; 46 protected double scaleX = 1; 47 protected double scaleY = 1; 48 49 private native void initOps(long pConfigInfo, WComponentPeer peer, 50 long hwnd); 51 52 protected WGLSurfaceData(WComponentPeer peer, WGLGraphicsConfig gc, 53 ColorModel cm, int type) 54 { 55 super(gc, cm, type); 56 this.peer = peer; 57 this.graphicsConfig = gc; 58 Win32GraphicsDevice device = gc.getDevice(); 59 this.scaleX = type == TEXTURE ? 1 : device.getDefaultScaleX(); 60 this.scaleY = type == TEXTURE ? 1 : device.getDefaultScaleY(); 61 62 long pConfigInfo = gc.getNativeConfigInfo(); 63 long hwnd = peer != null ? peer.getHWnd() : 0L; 64 65 initOps(pConfigInfo, peer, hwnd); 66 } 67 68 @Override 69 public double getDefaultScaleX() { 70 return scaleX; 71 } 72 73 @Override 74 public double getDefaultScaleY() { 75 return scaleY; 76 } 77 78 public GraphicsConfiguration getDeviceConfiguration() { 79 return graphicsConfig; 80 } 81 82 /** 83 * Creates a SurfaceData object representing the primary (front) buffer 84 * of an on-screen Window. 85 */ | 29 import java.awt.GraphicsConfiguration; 30 import java.awt.GraphicsDevice; 31 import java.awt.GraphicsEnvironment; 32 import java.awt.Image; 33 import java.awt.Rectangle; 34 import java.awt.geom.AffineTransform; 35 import java.awt.image.ColorModel; 36 import sun.awt.SunToolkit; 37 import sun.awt.Win32GraphicsDevice; 38 import sun.awt.windows.WComponentPeer; 39 import sun.java2d.SurfaceData; 40 import sun.java2d.pipe.Region; 41 42 public abstract class WGLSurfaceData extends OGLSurfaceData { 43 44 protected WComponentPeer peer; 45 private WGLGraphicsConfig graphicsConfig; 46 protected double scaleX = 1; 47 protected double scaleY = 1; 48 49 private native void initOps(OGLGraphicsConfig gc, long pConfigInfo, 50 WComponentPeer peer, long hwnd); 51 52 protected WGLSurfaceData(WComponentPeer peer, WGLGraphicsConfig gc, 53 ColorModel cm, int type) 54 { 55 super(gc, cm, type); 56 this.peer = peer; 57 this.graphicsConfig = gc; 58 Win32GraphicsDevice device = gc.getDevice(); 59 this.scaleX = type == TEXTURE ? 1 : device.getDefaultScaleX(); 60 this.scaleY = type == TEXTURE ? 1 : device.getDefaultScaleY(); 61 62 long pConfigInfo = gc.getNativeConfigInfo(); 63 long hwnd = peer != null ? peer.getHWnd() : 0L; 64 65 initOps(gc, pConfigInfo, peer, hwnd); 66 } 67 68 @Override 69 public double getDefaultScaleX() { 70 return scaleX; 71 } 72 73 @Override 74 public double getDefaultScaleY() { 75 return scaleY; 76 } 77 78 public GraphicsConfiguration getDeviceConfiguration() { 79 return graphicsConfig; 80 } 81 82 /** 83 * Creates a SurfaceData object representing the primary (front) buffer 84 * of an on-screen Window. 85 */ |