当前位置: 首页>>代码示例>>Java>>正文


Java BufferCapabilities.getFlipContents方法代码示例

本文整理汇总了Java中java.awt.BufferCapabilities.getFlipContents方法的典型用法代码示例。如果您正苦于以下问题:Java BufferCapabilities.getFlipContents方法的具体用法?Java BufferCapabilities.getFlipContents怎么用?Java BufferCapabilities.getFlipContents使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.awt.BufferCapabilities的用法示例。


在下文中一共展示了BufferCapabilities.getFlipContents方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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");
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:CGLGraphicsConfig.java

示例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 || numBuffers > 4) {
        throw new AWTException("Only 2-4 buffers supported");
    }
    if (caps.getFlipContents() == BufferCapabilities.FlipContents.COPIED &&
        numBuffers != 2)
    {
        throw new AWTException("FlipContents.COPIED is only" +
                               "supported for 2 buffers");
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:D3DGraphicsConfig.java

示例3: createData

import java.awt.BufferCapabilities; //导入方法依赖的package包/类
/**
 * Creates a SurfaceData object representing the back buffer of a
 * double-buffered on-screen Window.
 */
public static D3DSurfaceData createData(WComponentPeer peer, Image image) {
    D3DGraphicsConfig gc = getGC(peer);
    if (gc == null || !peer.isAccelCapable()) {
        return null;
    }
    BufferCapabilities caps = peer.getBackBufferCaps();
    VSyncType vSyncType = VSYNC_DEFAULT;
    if (caps instanceof ExtendedBufferCapabilities) {
        vSyncType = ((ExtendedBufferCapabilities)caps).getVSync();
    }
    Rectangle r = peer.getBounds();
    BufferCapabilities.FlipContents flip = caps.getFlipContents();
    int swapEffect;
    if (flip == FlipContents.COPIED) {
        swapEffect = SWAP_COPY;
    } else if (flip == FlipContents.PRIOR) {
        swapEffect = SWAP_FLIP;
    } else { // flip == FlipContents.UNDEFINED || .BACKGROUND
        swapEffect = SWAP_DISCARD;
    }
    return new D3DSurfaceData(peer, gc, r.width, r.height,
                              image, peer.getColorModel(),
                              peer.getBackBuffersNum(),
                              swapEffect, vSyncType, FLIP_BACKBUFFER);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:30,代码来源:D3DSurfaceData.java

示例4: 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");
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:WGLGraphicsConfig.java

示例5: 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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:28,代码来源:GLXGraphicsConfig.java

示例6: ExtendedBufferCapabilities

import java.awt.BufferCapabilities; //导入方法依赖的package包/类
/**
 * Creates an ExtendedBufferCapabilities object with front/back/flip caps
 * from the passed cap, and VSYNC_DEFAULT v-sync mode.
 */
public ExtendedBufferCapabilities(BufferCapabilities caps) {
    super(caps.getFrontBufferCapabilities(),
          caps.getBackBufferCapabilities(),
          caps.getFlipContents());

    this.vsync = VSyncType.VSYNC_DEFAULT;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:ExtendedBufferCapabilities.java

示例7: ExtendedBufferCapabilities

import java.awt.BufferCapabilities; //导入方法依赖的package包/类
/**
 * Creates an ExtendedBufferCapabilities instance with front/back/flip caps
 * from the passed cap, and the passed v-sync mode.
 */
public ExtendedBufferCapabilities(BufferCapabilities caps, VSyncType t) {
    super(caps.getFrontBufferCapabilities(),
          caps.getBackBufferCapabilities(),
          caps.getFlipContents());

    this.vsync = t;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:ExtendedBufferCapabilities.java


注:本文中的java.awt.BufferCapabilities.getFlipContents方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。