/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
public class WGLGraphicsConfig
extends Win32GraphicsConfig
implements OGLGraphicsConfig
{
protected static boolean wglAvailable;
private long pConfigInfo;
private static native boolean initWGL();
static {
wglAvailable = initWGL();
}
{
this.pConfigInfo = configInfo;
// add a record to the Disposer so that we destroy the native
// WGLGraphicsConfigInfo data when this object goes away
}
return this;
}
return WGLSurfaceData.createData(this, w, h,
null,
}
int pixfmt)
{
if (!wglAvailable) {
return null;
}
long cfginfo = 0;
try {
// getWGLConfigInfo() creates and destroys temporary
// Java-level context and flush the queue...
if (cfginfo != 0L) {
public void run() {
}
});
}
} finally {
}
if (cfginfo == 0) {
return null;
}
}
/**
* This is a small helper class that allows us to execute
* getWGLConfigInfo() on the queue flushing thread.
*/
private int screen;
private int pixfmt;
private long cfginfo;
}
public void run() {
}
public long getConfigInfo() {
return cfginfo;
}
}
public static boolean isWGLAvailable() {
return wglAvailable;
}
/**
* Returns true if the provided capability bit is present for this config.
* See OGLContext.java for a list of supported capabilities.
*/
}
public final long getNativeConfigInfo() {
return pConfigInfo;
}
/**
* {@inheritDoc}
*
* @see sun.java2d.pipe.hw.BufferedContextProvider#getContext
*/
return context;
}
private long pCfgInfo;
private int screen;
}
public void dispose() {
try {
public void run() {
}
});
} finally {
}
if (pCfgInfo != 0) {
pCfgInfo = 0;
}
}
}
public synchronized void displayChanged() {
super.displayChanged();
// the context could hold a reference to a WGLSurfaceData, which in
// turn has a reference back to this WGLGraphicsConfig, so in order
// for this instance to be disposed we need to break the connection
try {
} finally {
}
}
switch (transparency) {
case Transparency.OPAQUE:
// REMIND: once the ColorModel spec is changed, this should be
// an opaque premultiplied DCM...
case Transparency.BITMASK:
case Transparency.TRANSLUCENT:
0xff0000, 0xff00, 0xff, 0xff000000,
true, DataBuffer.TYPE_INT);
default:
return null;
}
}
}
/**
* The following methods are invoked from WComponentPeer.java rather
* than having the Win32-dependent implementations hardcoded in that
* class. This way the appropriate actions are taken based on the peer's
* GraphicsConfig, whether it is a Win32GraphicsConfig or a
* WGLGraphicsConfig.
*/
/**
* Creates a new SurfaceData that will be associated with the given
* WComponentPeer.
*/
int numBackBuffers)
{
}
return sd;
}
/**
* The following methods correspond to the multibuffering methods in
* WComponentPeer.java...
*/
/**
* Checks that the requested configuration is natively supported; if not,
* an AWTException is thrown.
*/
int numBuffers,
throws AWTException
{
if (numBuffers > 2) {
throw new AWTException(
"Only double or single buffering is supported");
}
if (!configCaps.isPageFlipping()) {
throw new AWTException("Page flipping is not supported");
}
throw new AWTException("FlipContents.PRIOR is not supported");
}
}
/**
* Creates a WGL-based backbuffer for the given peer and returns the
* image wrapper.
*/
return new SunVolatileImage(target,
}
/**
* Performs the native WGL flip operation for the given target Component.
*/
{
if (sd instanceof WGLVSyncOffScreenSurfaceData) {
try {
} finally {
}
} else {
try {
null);
} finally {
g.dispose();
}
return;
}
// not supported by WGL...
return;
}
try {
backBuffer.getHeight());
} finally {
g.dispose();
}
}
}
}
}
if (bufferCaps == null) {
}
return bufferCaps;
}
private WGLImageCaps() {
super(true);
}
public boolean isTrueVolatile() {
return true;
}
}
return imageCaps;
}
/**
* {@inheritDoc}
*
* @see sun.java2d.pipe.hw.AccelGraphicsConfig#createCompatibleVolatileImage
*/
public VolatileImage
int transparency, int type)
{
{
return null;
}
if (!isCapPresent(CAPS_EXT_FBOBJECT)) {
return null;
}
return null;
}
}
transparency, type);
if (!(sd instanceof AccelSurface) ||
{
}
return vi;
}
/**
* {@inheritDoc}
*
* @see sun.java2d.pipe.hw.AccelGraphicsConfig#getContextCapabilities
*/
return oglCaps;
}
}
}
}