本文整理汇总了Java中java.awt.BufferCapabilities.isPageFlipping方法的典型用法代码示例。如果您正苦于以下问题:Java BufferCapabilities.isPageFlipping方法的具体用法?Java BufferCapabilities.isPageFlipping怎么用?Java BufferCapabilities.isPageFlipping使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.BufferCapabilities
的用法示例。
在下文中一共展示了BufferCapabilities.isPageFlipping方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: assertOperationSupported
import java.awt.BufferCapabilities; //导入方法依赖的package包/类
@Override
public void assertOperationSupported(final int numBuffers,
final BufferCapabilities caps)
throws AWTException {
// Assume this method is never called with numBuffers != 2, as 0 is
// unsupported, and 1 corresponds to a SingleBufferStrategy which
// doesn't depend on the peer. Screen is considered as a separate
// "buffer".
if (numBuffers != 2) {
throw new AWTException("Only double buffering is supported");
}
final BufferCapabilities configCaps = getBufferCapabilities();
if (!configCaps.isPageFlipping()) {
throw new AWTException("Page flipping is not supported");
}
if (caps.getFlipContents() == BufferCapabilities.FlipContents.PRIOR) {
throw new AWTException("FlipContents.PRIOR is not supported");
}
}
示例2: assertOperationSupported
import java.awt.BufferCapabilities; //导入方法依赖的package包/类
/**
* Checks that the requested configuration is natively supported; if not,
* an AWTException is thrown.
*/
@Override
public void assertOperationSupported(Component target,
int numBuffers,
BufferCapabilities caps)
throws AWTException
{
if (numBuffers > 2) {
throw new AWTException(
"Only double or single buffering is supported");
}
BufferCapabilities configCaps = getBufferCapabilities();
if (!configCaps.isPageFlipping()) {
throw new AWTException("Page flipping is not supported");
}
if (caps.getFlipContents() == BufferCapabilities.FlipContents.PRIOR) {
throw new AWTException("FlipContents.PRIOR is not supported");
}
}
示例3: createBackBuffer
import java.awt.BufferCapabilities; //导入方法依赖的package包/类
/**
* Attempts to create a GLX-based backbuffer for the given peer. If
* the requested configuration is not natively supported, an AWTException
* is thrown. Otherwise, if the backbuffer creation is successful, a
* value of 1 is returned.
*/
@Override
public long createBackBuffer(X11ComponentPeer peer,
int numBuffers, BufferCapabilities caps)
throws AWTException
{
if (numBuffers > 2) {
throw new AWTException(
"Only double or single buffering is supported");
}
BufferCapabilities configCaps = getBufferCapabilities();
if (!configCaps.isPageFlipping()) {
throw new AWTException("Page flipping is not supported");
}
if (caps.getFlipContents() == BufferCapabilities.FlipContents.PRIOR) {
throw new AWTException("FlipContents.PRIOR is not supported");
}
// non-zero return value means backbuffer creation was successful
// (checked in X11ComponentPeer.flip(), etc.)
return 1;
}
示例4: createBackBuffer
import java.awt.BufferCapabilities; //导入方法依赖的package包/类
/**
* Attempts to create an XDBE-based backbuffer for the given peer. If
* the requested configuration is not natively supported, an AWTException
* is thrown. Otherwise, if the backbuffer creation is successful, a
* handle to the native backbuffer is returned.
*/
public long createBackBuffer(X11ComponentPeer peer,
int numBuffers, BufferCapabilities caps)
throws AWTException
{
if (!X11GraphicsDevice.isDBESupported()) {
throw new AWTException("Page flipping is not supported");
}
if (numBuffers > 2) {
throw new AWTException(
"Only double or single buffering is supported");
}
BufferCapabilities configCaps = getBufferCapabilities();
if (!configCaps.isPageFlipping()) {
throw new AWTException("Page flipping is not supported");
}
long window = peer.getContentWindow();
int swapAction = getSwapAction(caps.getFlipContents());
return createBackBuffer(window, swapAction);
}