Skip to content

ingram12/vulkan_api_first_triangle_c_lang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

A tutorial example of a program that draws a triangle. Written in C language, for MacOS.

image

For run this program, you need to install:

  1. Vulkan SDK for MacOS (https://vulkan.lunarg.com/sdk/home#mac)
  2. glfw library brew install glfw
  3. cglm library brew install cglm

compile shaders:

/path/to/VulkanSDK/1.3.268.1/macOS/bin/glslc /path/to/shader.frag -o /path/to/frag.spv
/path/to/VulkanSDK/1.3.268.1/macOS/bin/glslc /path/to/shader.vert -o /path/to/vert.spv

To compile main.c without VScode you need to run something like:

/usr/bin/clang -g /path/to/main.c -o /path/to/main -I/path/to/glfw/3.3.8/include -I/path/to/cglm/0.8.9/include -I/path/to/VulkanSDK/1.3.268.1/macOS/include -L/path/to/glfw/3.3.8/lib -L/path/to/cglm/0.8.9/lib -lglfw -L/path/to/VulkanSDK/1.3.268.1/macOS/lib -lvulkan

About

Rendering a triangle using the Vulkan API in C

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors