add lwjgl debug stuff
parent
adfdfccd64
commit
14db9b4a22
|
@ -1,10 +1,11 @@
|
|||
package com.github.hydos.ginger;
|
||||
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
import org.lwjgl.system.Configuration;
|
||||
|
||||
import com.github.hydos.ginger.engine.common.info.RenderAPI;
|
||||
import com.github.hydos.ginger.engine.common.io.Window;
|
||||
import com.github.hydos.ginger.engine.vulkan.api.*;
|
||||
import com.github.hydos.ginger.engine.vulkan.api.GingerVK;
|
||||
|
||||
/** @author hydos06
|
||||
* the non ARR vulkan test example */
|
||||
|
@ -52,7 +53,7 @@ public class VulkanStarter
|
|||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
Configuration.DEBUG.set(true);
|
||||
BasicGinger2VulkanExample app = new BasicGinger2VulkanExample();
|
||||
|
||||
app.run();
|
||||
|
|
|
@ -4,6 +4,7 @@ import java.nio.*;
|
|||
import java.util.*;
|
||||
|
||||
import org.lwjgl.system.MemoryStack;
|
||||
import org.lwjgl.system.MemoryUtil;
|
||||
import org.lwjgl.vulkan.*;
|
||||
|
||||
import com.github.hydos.ginger.engine.common.io.Window;
|
||||
|
@ -109,7 +110,7 @@ public class Swapchain
|
|||
imageCount.put(0, swapChainSupport.capabilities.maxImageCount());
|
||||
}
|
||||
|
||||
VkSwapchainCreateInfoKHR createInfo = VkSwapchainCreateInfoKHR.callocStack(stack)
|
||||
VkSwapchainCreateInfoKHR createInfo = VkSwapchainCreateInfoKHR.calloc()
|
||||
.sType(KHRSwapchain.VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR)
|
||||
.minImageCount(imageCount.get(0))
|
||||
.imageFormat(surfaceFormat.format())
|
||||
|
@ -132,11 +133,18 @@ public class Swapchain
|
|||
createInfo.presentMode(presentMode);
|
||||
createInfo.clipped(true);
|
||||
|
||||
createInfo.oldSwapchain(VK12.VK_NULL_HANDLE);
|
||||
createInfo.oldSwapchain(1);
|
||||
|
||||
LongBuffer pSwapChain = stack.longs(VK12.VK_NULL_HANDLE);
|
||||
LongBuffer pSwapChain = MemoryUtil.memAllocLong(1);
|
||||
|
||||
int result = KHRSwapchain.vkCreateSwapchainKHR(VKConstants.device, createInfo, null, pSwapChain);
|
||||
int result = KHRSwapchain.
|
||||
vkCreateSwapchainKHR
|
||||
(
|
||||
VKConstants.device,
|
||||
createInfo,
|
||||
null,
|
||||
pSwapChain
|
||||
);
|
||||
if(result != VK12.VK_SUCCESS) {
|
||||
throw new RuntimeException("Failed to create swap chain reason: " + VKUtils.translateVulkanResult(result));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue