Add Vulkan instance creation
This commit is contained in:
parent
7c6130cb3e
commit
25be7b09e8
2 changed files with 11 additions and 1 deletions
|
@ -4,6 +4,8 @@ project(Graph)
|
|||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
|
||||
|
||||
find_package(SDL2 REQUIRED)
|
||||
find_package(Vulkan REQUIRED)
|
||||
|
||||
add_executable(Graph main.cpp)
|
||||
target_link_libraries(Graph PUBLIC SDL2::SDL2 SDL2::SDL2main)
|
||||
target_link_libraries(Graph PUBLIC SDL2::SDL2 SDL2::SDL2main ${Vulkan_LIBRARY})
|
||||
target_include_directories(Graph PUBLIC ${Vulkan_INCLUDE_DIRS})
|
||||
|
|
8
main.cpp
8
main.cpp
|
@ -1,11 +1,19 @@
|
|||
#include <iostream>
|
||||
#include <SDL.h>
|
||||
#include <vulkan/vulkan.h>
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
SDL_Init(SDL_INIT_VIDEO);
|
||||
|
||||
SDL_Window* window = SDL_CreateWindow("Graph", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 640, 480, 0);
|
||||
|
||||
VkInstanceCreateInfo info = {};
|
||||
|
||||
VkInstance instance;
|
||||
vkCreateInstance(&info, nullptr, &instance);
|
||||
if(!instance)
|
||||
return -1;
|
||||
|
||||
bool running = true;
|
||||
while(running) {
|
||||
SDL_Event event = {};
|
||||
|
|
Reference in a new issue