Upload files to "/"
This commit is contained in:
45
glfwVulkan.c
Normal file
45
glfwVulkan.c
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <vulkan/vulkan.h>
|
||||||
|
#include <GLFW/glfw3.h>
|
||||||
|
|
||||||
|
const uint32_t WIDTH = 1920;
|
||||||
|
const uint32_t HEIGHT = 1080;
|
||||||
|
GLFWwindow* window = NULL;
|
||||||
|
|
||||||
|
const char test[] = "window";
|
||||||
|
|
||||||
|
void initWindow(){
|
||||||
|
glfwInit();
|
||||||
|
|
||||||
|
glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
|
||||||
|
glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE);
|
||||||
|
|
||||||
|
window = glfwCreateWindow(WIDTH, HEIGHT, test, nullptr, nullptr);
|
||||||
|
|
||||||
|
}
|
||||||
|
void initVulkan(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void mainLoop(){
|
||||||
|
while(!glfwWindowShouldClose(window)){
|
||||||
|
glfwPollEvents();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
void cleanUp(){
|
||||||
|
glfwDestroyWindow(window);
|
||||||
|
glfwTerminate();
|
||||||
|
}
|
||||||
|
|
||||||
|
void run(){
|
||||||
|
initWindow();
|
||||||
|
initVulkan();
|
||||||
|
mainLoop();
|
||||||
|
cleanUp();
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
run();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
28
main.c
Normal file
28
main.c
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <vulkan/vulkan.h>
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
VkInstance instance;
|
||||||
|
VkInstanceCreateInfo createInfo = {};
|
||||||
|
createInfo.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
|
||||||
|
|
||||||
|
if(vkCreateInstance(&createInfo, NULL, &instance) !=VK_SUCCESS){
|
||||||
|
printf("Failed to create Vulkan\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t extensionCount = 0;
|
||||||
|
vkEnumerateInstanceExtensionProperties(NULL, &extensionCount, NULL);
|
||||||
|
|
||||||
|
VkExtensionProperties extensions[extensionCount];
|
||||||
|
vkEnumerateInstanceExtensionProperties(NULL, &extensionCount, extensions);
|
||||||
|
|
||||||
|
|
||||||
|
printf("Available extensions:\n");
|
||||||
|
for (uint32_t i = 0; i < extensionCount; i++) {
|
||||||
|
printf("\t%s\n", extensions[i].extensionName);
|
||||||
|
}
|
||||||
|
|
||||||
|
vkDestroyInstance(instance, NULL);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user