< prev index next >

src/java.desktop/windows/classes/sun/java2d/opengl/WGLGraphicsConfig.java

Print this page


   1 /*
   2  * Copyright (c) 2004, 2008, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  64     implements OGLGraphicsConfig
  65 {
  66     protected static boolean wglAvailable;
  67     private static ImageCapabilities imageCaps = new WGLImageCaps();
  68 
  69     private BufferCapabilities bufferCaps;
  70     private long pConfigInfo;
  71     private ContextCapabilities oglCaps;
  72     private OGLContext context;
  73     private Object disposerReferent = new Object();
  74 
  75     public static native int getDefaultPixFmt(int screennum);
  76     private static native boolean initWGL();
  77     private static native long getWGLConfigInfo(int screennum, int visualnum);
  78     private static native int getOGLCapabilities(long configInfo);
  79 
  80     static {
  81         wglAvailable = initWGL();
  82     }
  83 

  84     protected WGLGraphicsConfig(Win32GraphicsDevice device, int visualnum,
  85                                 long configInfo, ContextCapabilities oglCaps)
  86     {
  87         super(device, visualnum);
  88         this.pConfigInfo = configInfo;
  89         this.oglCaps = oglCaps;
  90         context = new OGLContext(OGLRenderQueue.getInstance(), this);
  91 
  92         // add a record to the Disposer so that we destroy the native
  93         // WGLGraphicsConfigInfo data when this object goes away
  94         Disposer.addRecord(disposerReferent,
  95                            new WGLGCDisposerRecord(pConfigInfo,
  96                                                    device.getScreen()));
  97     }
  98 
  99     public Object getProxyKey() {
 100         return this;
 101     }
 102 
 103     public SurfaceData createManagedSurface(int w, int h, int transparency) {


   1 /*
   2  * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  64     implements OGLGraphicsConfig
  65 {
  66     protected static boolean wglAvailable;
  67     private static ImageCapabilities imageCaps = new WGLImageCaps();
  68 
  69     private BufferCapabilities bufferCaps;
  70     private long pConfigInfo;
  71     private ContextCapabilities oglCaps;
  72     private OGLContext context;
  73     private Object disposerReferent = new Object();
  74 
  75     public static native int getDefaultPixFmt(int screennum);
  76     private static native boolean initWGL();
  77     private static native long getWGLConfigInfo(int screennum, int visualnum);
  78     private static native int getOGLCapabilities(long configInfo);
  79 
  80     static {
  81         wglAvailable = initWGL();
  82     }
  83 
  84     @SuppressWarnings("deprecation")
  85     protected WGLGraphicsConfig(Win32GraphicsDevice device, int visualnum,
  86                                 long configInfo, ContextCapabilities oglCaps)
  87     {
  88         super(device, visualnum);
  89         this.pConfigInfo = configInfo;
  90         this.oglCaps = oglCaps;
  91         context = new OGLContext(OGLRenderQueue.getInstance(), this);
  92 
  93         // add a record to the Disposer so that we destroy the native
  94         // WGLGraphicsConfigInfo data when this object goes away
  95         Disposer.addRecord(disposerReferent,
  96                            new WGLGCDisposerRecord(pConfigInfo,
  97                                                    device.getScreen()));
  98     }
  99 
 100     public Object getProxyKey() {
 101         return this;
 102     }
 103 
 104     public SurfaceData createManagedSurface(int w, int h, int transparency) {


< prev index next >