Browse Source

Add simple window creation and instance extension enumation.

master
Garnet 2 years ago
parent
commit
03a5e0174f
  1. 5
      meson.build
  2. 25
      src/main.c

5
meson.build

@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
project('vulkan learning', 'c')
deps = [dependency('glfw3'), dependency('vulkan'), dependency('dl'), dependency('threads'), dependency('X11'), dependency('xxf86vm'), dependency('xrandr'), dependency('xi'), dependency('cglm')]
executable('triangle', 'src/main.c', dependencies: deps)

25
src/main.c

@ -0,0 +1,25 @@ @@ -0,0 +1,25 @@
#define GLFW_INCLUDE_VULKAN
#include <GLFW/glfw3.h>
#include <stdio.h>
int main() {
glfwInit();
glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
GLFWwindow* window = glfwCreateWindow(2560, 1440, "vulkan learning example", NULL, NULL);
uint32_t num_extensions = 0;
vkEnumerateInstanceExtensionProperties(NULL, &num_extensions, NULL);
printf("number of supported extensions %Xh\n", num_extensions);
while(!glfwWindowShouldClose(window)) {
glfwPollEvents();
}
glfwDestroyWindow(window);
glfwTerminate();
return 0;
}
Loading…
Cancel
Save