Add README.md + Check possible error on Surface.java
This commit is contained in:
parent
cb0fa04383
commit
2dee61f8e0
2 changed files with 13 additions and 2 deletions
|
@ -18,4 +18,9 @@ mvn exec:java
|
|||
|
||||
```console
|
||||
mvn package
|
||||
```
|
||||
```
|
||||
|
||||
## Usefull links
|
||||
|
||||
- https://vulkan-tutorial.com/fr/Introduction
|
||||
- https://github.com/Naitsirc98/Vulkan-Tutorial-Java/tree/master
|
|
@ -3,6 +3,7 @@ package fr.mrdev023.vulkan_java.renderer;
|
|||
import org.lwjgl.glfw.GLFWVulkan;
|
||||
import org.lwjgl.system.MemoryStack;
|
||||
import org.lwjgl.vulkan.KHRSurface;
|
||||
import org.lwjgl.vulkan.VK10;
|
||||
import org.tinylog.Logger;
|
||||
|
||||
import java.nio.LongBuffer;
|
||||
|
@ -17,8 +18,13 @@ public class Surface {
|
|||
this.physicalDevice = physicalDevice;
|
||||
try (MemoryStack stack = MemoryStack.stackPush()) {
|
||||
LongBuffer pSurface = stack.mallocLong(1);
|
||||
GLFWVulkan.glfwCreateWindowSurface(this.physicalDevice.getVkPhysicalDevice().getInstance(), windowHandle,
|
||||
var result = GLFWVulkan.glfwCreateWindowSurface(this.physicalDevice.getVkPhysicalDevice().getInstance(), windowHandle,
|
||||
null, pSurface);
|
||||
|
||||
if (result != VK10.VK_SUCCESS) {
|
||||
throw new RuntimeException("Failed to create Vulkan surface");
|
||||
}
|
||||
|
||||
vkSurface = pSurface.get(0);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue