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


Java Platform.WINDOWS属性代码示例

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


在下文中一共展示了Platform.WINDOWS属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: glfwCreateWindow

public static long glfwCreateWindow(int width, int height, ByteBuffer title, long monitor, long share) {
    if (Properties.VALIDATE.enabled) {
        RT.checkGlfwMonitor(monitor);
        RT.checkGlfwWindow(share);
        org.lwjgl.glfw.GLFW.glfwWindowHint(org.lwjgl.glfw.GLFW.GLFW_OPENGL_DEBUG_CONTEXT, org.lwjgl.glfw.GLFW.GLFW_TRUE);
        if (Platform.get() == Platform.WINDOWS || Properties.STRICT.enabled) {
            Context ctx = CONTEXTS.get(share);
            if (ctx != null && ctx.currentInThread != null && ctx.currentInThread != Thread.currentThread()) {
                RT.throwISEOrLogError("Context of share window[" + ctx.counter + "] is current in another thread [" + ctx.currentInThread + "]");
            }
        }
    }
    long window = org.lwjgl.glfw.GLFW.glfwCreateWindow(width, height, title, monitor, share);
    createWindow(window, share);
    return window;
}
 
开发者ID:LWJGLX,项目名称:debug,代码行数:16,代码来源:GLFW.java

示例2: load

/*************************************************************************
 * Loads an icon in ByteBuffer form.
 * 
 * @param is
 *            The location of the Image to use as an icon.
 * 
 * @return An array of ByteBuffers containing the pixel data for the icon in
 *         varying sizes.
 *************************************************************************/
public static ByteBuffer[] load(InputStream is) {
    BufferedImage image = null;
    try {
        image = ImageIO.read(is);
    } catch (IOException e) {
        e.printStackTrace();
    }
    ByteBuffer[] buffers = null;
    Platform plat = Platform.get();
    System.err.println("Assuming platform " + LUtils.PLATFORM_NAME);
    if (plat == Platform.WINDOWS) {
        buffers = new ByteBuffer[2];
        buffers[0] = loadInstance(image, 16);
        buffers[1] = loadInstance(image, 32);
    } else if (plat == Platform.MACOSX) {
        buffers = new ByteBuffer[1];
        buffers[0] = loadInstance(image, 128);
    } else {
        buffers = new ByteBuffer[1];
        buffers[0] = loadInstance(image, 32);
    }
    return buffers;
}
 
开发者ID:TechShroom,项目名称:EmergencyLanding,代码行数:32,代码来源:IconLoader.java

示例3: initNatives

private static void initNatives() throws InitializationException {
	Platform platform = Platform.get();
	String path = NATIVE_DIR + "/";
	if (platform == Platform.WINDOWS)
		path += "windows";
	else if (platform == Platform.MACOSX)
		path += "macos";
	else if (platform == Platform.LINUX)
		path += "linux";
	else
		throw new InitializationException("Unsupported platform");
	System.setProperty("org.lwjgl.librarypath", new File(path).getAbsolutePath());
}
 
开发者ID:warlockcodes,项目名称:Null-Engine,代码行数:13,代码来源:NullEngine.java

示例4: createInstance

/**
 * Create a Vulkan instance using LWJGL 3.
 * 
 * @return the VkInstance handle
 */
private static VkInstance createInstance() {
    VkApplicationInfo appInfo = VkApplicationInfo.calloc()
            .sType(VK_STRUCTURE_TYPE_APPLICATION_INFO)
            .pApplicationName(memUTF8("SWT Vulkan Demo"))
            .pEngineName(memUTF8(""))
            .apiVersion(VK_MAKE_VERSION(1, 0, 2));
    ByteBuffer VK_KHR_SURFACE_EXTENSION = memUTF8(VK_KHR_SURFACE_EXTENSION_NAME);
    ByteBuffer VK_KHR_OS_SURFACE_EXTENSION;
    if (Platform.get() == Platform.WINDOWS)
        VK_KHR_OS_SURFACE_EXTENSION = memUTF8(VK_KHR_WIN32_SURFACE_EXTENSION_NAME);
    else
        VK_KHR_OS_SURFACE_EXTENSION = memUTF8(VK_KHR_XLIB_SURFACE_EXTENSION_NAME);
    PointerBuffer ppEnabledExtensionNames = memAllocPointer(2);
    ppEnabledExtensionNames.put(VK_KHR_SURFACE_EXTENSION);
    ppEnabledExtensionNames.put(VK_KHR_OS_SURFACE_EXTENSION);
    ppEnabledExtensionNames.flip();
    VkInstanceCreateInfo pCreateInfo = VkInstanceCreateInfo.calloc()
            .sType(VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO)
            .pNext(0L)
            .pApplicationInfo(appInfo);
    if (ppEnabledExtensionNames.remaining() > 0) {
        pCreateInfo.ppEnabledExtensionNames(ppEnabledExtensionNames);
    }
    PointerBuffer pInstance = MemoryUtil.memAllocPointer(1);
    int err = vkCreateInstance(pCreateInfo, null, pInstance);
    if (err != VK_SUCCESS) {
        throw new RuntimeException("Failed to create VkInstance: " + translateVulkanResult(err));
    }
    long instance = pInstance.get(0);
    memFree(pInstance);
    VkInstance ret = new VkInstance(instance, pCreateInfo);
    memFree(ppEnabledExtensionNames);
    memFree(VK_KHR_OS_SURFACE_EXTENSION);
    memFree(VK_KHR_SURFACE_EXTENSION);
    appInfo.free();
    return ret;
}
 
开发者ID:httpdigest,项目名称:lwjgl3-swt,代码行数:42,代码来源:SimpleDemo.java

示例5: createInstance

/**
 * Create a Vulkan instance using LWJGL 3.
 * 
 * @return the VkInstance handle
 */
private static VkInstance createInstance() {
    VkApplicationInfo appInfo = VkApplicationInfo.calloc()
            .sType(VK_STRUCTURE_TYPE_APPLICATION_INFO)
            .pApplicationName(memUTF8("AWT Vulkan Demo"))
            .pEngineName(memUTF8(""))
            .apiVersion(VK_MAKE_VERSION(1, 0, 2));
    ByteBuffer VK_KHR_SURFACE_EXTENSION = memUTF8(VK_KHR_SURFACE_EXTENSION_NAME);
    ByteBuffer VK_KHR_OS_SURFACE_EXTENSION;
    if (Platform.get() == Platform.WINDOWS)
        VK_KHR_OS_SURFACE_EXTENSION = memUTF8(VK_KHR_WIN32_SURFACE_EXTENSION_NAME);
    else
        VK_KHR_OS_SURFACE_EXTENSION = memUTF8(VK_KHR_XLIB_SURFACE_EXTENSION_NAME);
    PointerBuffer ppEnabledExtensionNames = memAllocPointer(2);
    ppEnabledExtensionNames.put(VK_KHR_SURFACE_EXTENSION);
    ppEnabledExtensionNames.put(VK_KHR_OS_SURFACE_EXTENSION);
    ppEnabledExtensionNames.flip();
    VkInstanceCreateInfo pCreateInfo = VkInstanceCreateInfo.calloc()
            .sType(VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO)
            .pNext(0L)
            .pApplicationInfo(appInfo);
    if (ppEnabledExtensionNames.remaining() > 0) {
        pCreateInfo.ppEnabledExtensionNames(ppEnabledExtensionNames);
    }
    PointerBuffer pInstance = MemoryUtil.memAllocPointer(1);
    int err = vkCreateInstance(pCreateInfo, null, pInstance);
    if (err != VK_SUCCESS) {
        throw new RuntimeException("Failed to create VkInstance: " + translateVulkanResult(err));
    }
    long instance = pInstance.get(0);
    memFree(pInstance);
    VkInstance ret = new VkInstance(instance, pCreateInfo);
    memFree(ppEnabledExtensionNames);
    memFree(VK_KHR_OS_SURFACE_EXTENSION);
    memFree(VK_KHR_SURFACE_EXTENSION);
    appInfo.free();
    return ret;
}
 
开发者ID:httpdigest,项目名称:lwjgl3-awt,代码行数:42,代码来源:SimpleDemo.java

示例6: createInstance

/**
 * Create a Vulkan {@link VkInstance} using LWJGL 3.
 * <p>
 * The {@link VkInstance} represents a handle to the Vulkan API and we need that instance for about everything we do.
 * 
 * @return the VkInstance handle
 */
private static VkInstance createInstance() {
    VkApplicationInfo appInfo = VkApplicationInfo.calloc()
            .sType(VK_STRUCTURE_TYPE_APPLICATION_INFO)
            .pApplicationName(memUTF8("SWT Vulkan Demo"))
            .pEngineName(memUTF8(""))
            .apiVersion(VK_MAKE_VERSION(1, 0, 2));
    ByteBuffer VK_KHR_SURFACE_EXTENSION = memUTF8(VK_KHR_SURFACE_EXTENSION_NAME);
    ByteBuffer VK_EXT_DEBUG_REPORT_EXTENSION = memUTF8(VK_EXT_DEBUG_REPORT_EXTENSION_NAME);
    ByteBuffer VK_KHR_OS_SURFACE_EXTENSION;
    if (Platform.get() == Platform.WINDOWS)
        VK_KHR_OS_SURFACE_EXTENSION = memUTF8(VK_KHR_WIN32_SURFACE_EXTENSION_NAME);
    else
        VK_KHR_OS_SURFACE_EXTENSION = memUTF8(VK_KHR_XLIB_SURFACE_EXTENSION_NAME);
    PointerBuffer ppEnabledExtensionNames = memAllocPointer(3)
      .put(VK_KHR_SURFACE_EXTENSION)
      .put(VK_KHR_OS_SURFACE_EXTENSION)
      .put(VK_EXT_DEBUG_REPORT_EXTENSION)
      .flip();
    PointerBuffer ppEnabledLayerNames = memAllocPointer(layers.length);
    for (int i = 0; validation && i < layers.length; i++)
        ppEnabledLayerNames.put(layers[i]);
    ppEnabledLayerNames.flip();
    VkInstanceCreateInfo pCreateInfo = VkInstanceCreateInfo.calloc()
            .sType(VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO)
            .pNext(NULL)
            .pApplicationInfo(appInfo)
            .ppEnabledExtensionNames(ppEnabledExtensionNames)
            .ppEnabledLayerNames(ppEnabledLayerNames);
    PointerBuffer pInstance = memAllocPointer(1);
    int err = vkCreateInstance(pCreateInfo, null, pInstance);
    long instance = pInstance.get(0);
    memFree(pInstance);
    if (err != VK_SUCCESS) {
        throw new AssertionError("Failed to create VkInstance: " + translateVulkanResult(err));
    }
    VkInstance ret = new VkInstance(instance, pCreateInfo);
    pCreateInfo.free();
    memFree(ppEnabledLayerNames);
    memFree(ppEnabledExtensionNames);
    memFree(VK_KHR_OS_SURFACE_EXTENSION);
    memFree(VK_EXT_DEBUG_REPORT_EXTENSION);
    memFree(VK_KHR_SURFACE_EXTENSION);
    appInfo.free();
    return ret;
}
 
开发者ID:httpdigest,项目名称:lwjgl3-swt,代码行数:52,代码来源:ClearScreenDemo.java

示例7: VKCanvas

/**
 * Create a {@link VKCanvas} widget using the attributes described in the supplied {@link VKData} object.
 *
 * @param parent
 *            a parent composite widget
 * @param style
 *            the bitwise OR'ing of widget styles
 * @param data
 *            the necessary data to create a VKCanvas
 */
public VKCanvas(Composite parent, int style, VKData data) {
    super(parent, platformCanvas.checkStyle(parent, style));
    if (Platform.get() == Platform.WINDOWS) {
        platformCanvas.resetStyle(parent);
    }
    if (data == null)
        SWT.error(SWT.ERROR_NULL_ARGUMENT);
    surface = platformCanvas.create(this, data);
}
 
开发者ID:httpdigest,项目名称:lwjgl3-swt,代码行数:19,代码来源:VKCanvas.java

示例8: GLCanvas

/**
 * Create a GLCanvas widget using the attributes described in the GLData
 * object provided.
 *
 * @param parent a composite widget
 * @param style the bitwise OR'ing of widget styles
 * @param data the requested attributes of the GLCanvas
 *
 * @exception IllegalArgumentException
 * <ul>
 * <li>ERROR_NULL_ARGUMENT when the data is null
 * <li>ERROR_UNSUPPORTED_DEPTH when the requested attributes cannot be provided
 * </ul>
 */
public GLCanvas(Composite parent, int style, GLData data) {
    super(parent, platformCanvas.checkStyle(parent, style));
    if (Platform.get() == Platform.WINDOWS) {
        platformCanvas.resetStyle(parent);
    }
    if (data == null)
        SWT.error(SWT.ERROR_NULL_ARGUMENT);
    effective = new GLData();
    context = platformCanvas.create(this, data, effective);
}
 
开发者ID:httpdigest,项目名称:lwjgl3-swt,代码行数:24,代码来源:GLCanvas.java


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