diff --git a/.gitignore b/.gitignore index 655f4f3..a155db7 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,5 @@ cpp/vscode/helloworld cpp/vulkan/vulkantest/VulkanTest +cpp/ANSI/W1/Day1/1.1/helloworld +cpp/vulkan/HelloTriangle/HelloTriangle diff --git a/cpp/vulkan/HelloTriangle/Makefile b/cpp/vulkan/HelloTriangle/Makefile new file mode 100644 index 0000000..2a29e75 --- /dev/null +++ b/cpp/vulkan/HelloTriangle/Makefile @@ -0,0 +1,13 @@ +CFLAGS = -std=c++17 -O2 +LDFLAGS = -lglfw -lvulkan -ldl -lpthread -lX11 -lXxf86vm -lXrandr -lXi + +HelloTriangle: main.cpp + g++ $(CFLAGS) -o HelloTriangle main.cpp $(LDFLAGS) + +.PHONY: test clean + +test: HelloTriangle + ./HelloTriangle + +clean: + rm -f HelloTriangle diff --git a/cpp/vulkan/HelloTriangle/main.cpp b/cpp/vulkan/HelloTriangle/main.cpp new file mode 100644 index 0000000..d13be09 --- /dev/null +++ b/cpp/vulkan/HelloTriangle/main.cpp @@ -0,0 +1,53 @@ +#define GLFW_INCLUDE_VULKAN +#include + +#include + +#include +#include +#include + +class HelloTriangleApplication { +public: + void run() { + initWindow(); + initVulkan(); + mainLoop(); + cleanup(); + } + +private: + void initWindow() { + glfwInit(); + glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API); + glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE); + GLFWwindow* window; + window = glfwCreateWindow(800, 600, "Vulkan", nullptr, nullptr); + } + + void initVulkan() { + + } + + void mainLoop() { + + } + + void cleanup() { + + } +}; + +int main() { + HelloTriangleApplication app; + + try { + app.run(); + } catch (const std::exception& e) { + std::cerr << e.what() << std::endl; + return EXIT_FAILURE; + } + +// std::cout << "Success!!!"; + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/cpp/vulkan/vulkantest/Makefile b/cpp/vulkan/vulkantest/Makefile index bfc7aee..180ff44 100644 --- a/cpp/vulkan/vulkantest/Makefile +++ b/cpp/vulkan/vulkantest/Makefile @@ -3,3 +3,11 @@ LDFLAGS = -lglfw -lvulkan -ldl -lpthread -lX11 -lXxf86vm -lXrandr -lXi VulkanTest: main.cpp g++ $(CFLAGS) -o VulkanTest main.cpp $(LDFLAGS) + +.PHONY: test clean + +test: VulkanTest + ./VulkanTest + +clean: + rm -f VulkanTest