diff options
Diffstat (limited to 'gl4java/drawable/Win32SunJDK13GLDrawableFactory.java-jau')
-rw-r--r-- | gl4java/drawable/Win32SunJDK13GLDrawableFactory.java-jau | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/gl4java/drawable/Win32SunJDK13GLDrawableFactory.java-jau b/gl4java/drawable/Win32SunJDK13GLDrawableFactory.java-jau new file mode 100644 index 0000000..c10572e --- /dev/null +++ b/gl4java/drawable/Win32SunJDK13GLDrawableFactory.java-jau @@ -0,0 +1,47 @@ +package gl4java.drawable;
+
+import java.awt.*;
+import java.lang.reflect.*;
+import java.util.*;
+import sun.awt.*;
+import gl4java.*;
+
+public class Win32SunJDK13GLDrawableFactory
+ extends SunJDK13GLDrawableFactory
+{
+ public Win32SunJDK13GLDrawableFactory() {
+ // describeAllGraphicsConfigurations();
+ }
+
+ public GraphicsConfiguration
+ getGraphicsConfiguration(GLCapabilities capabilities,
+ GraphicsDevice device) {
+ // On Windows, ChoosePixelFormat does not work as desired; it
+ // shoehorns the given pixel format descriptor into what a
+ // particular window can render. Instead we enumerate all possible
+ // pixel formats for a given GraphicsDevice and try to find one
+ // matching the given capabilities. To do this we provide
+ // accessors which query the OpenGL-related properties of a
+ // GraphicsConfiguration. FIXME: should implement better selection
+ // algorithm; this one does not choose the most minimal.
+
+ Win32GraphicsDevice w32Device = (Win32GraphicsDevice) device;
+ int screen = w32Device.getScreen();
+
+ int nPixelFormat = (int) ChoosePixelFormatNum (screen,
+ capabilities,
+ GLContext.gljNativeDebug);
+
+ return Win32GraphicsConfig.getConfig(w32Device, nPixelFormat);
+ }
+
+ //----------------------------------------------------------------------
+ // Internals only below this point
+ //
+
+ // Needs to return an PixelFormatNumber can be wrapped in an
+ // X11GraphicsConfig object
+ static native long ChoosePixelFormatNum (int screen,
+ GLCapabilities capabilities,
+ boolean verbose);
+}
|